Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions assemblies/debug/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-misc-naming</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-misc-projects</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions assemblies/plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,12 @@
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-misc-naming</artifactId>
<version>${project.version}</version>
<type>zip</type>
</dependency>
<dependency>
<groupId>org.apache.hop</groupId>
<artifactId>hop-misc-passwords</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public enum HopMetadataPropertyType {
// STATIC SCHEMA
STATIC_SCHEMA_DEFINITION,

// NAMING
NAMING_SCHEME,

// VFS
VFS_GCP_CONNECTION,
VFS_AZURE_CONNECTION,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/hop-user-manual/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ under the License.
*** xref:metadata-types/variable-resolver/openbao-variable-resolver.adoc[OpenBAO variable resolver]
*** xref:metadata-types/variable-resolver/pipeline-variable-resolver.adoc[Pipeline variable resolver]
** xref:metadata-types/static-schema-definition.adoc[Static Schema Definition]
** xref:metadata-types/naming-scheme.adoc[Naming Scheme]
** xref:hop-server/web-service.adoc[Web Service]
** xref:metadata-types/webdav-connection.adoc[WebDAV Connection]
** xref:metadata-types/workflow-log.adoc[Workflow Log]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ xref:metadata-types/data-stream/data-stream.adoc[Data Stream]: A Data Stream can
* xref:metadata-types/mongodb-connection.adoc[MongoDB Connection]: Describes a MongoDB connection
* xref:metadata-types/mail-server-connection.adoc[Mail Server Connection]: Describes a mail server connection
* xref:metadata-types/minio-connection.adoc[Minio (S3) Connection]: Connect to one or more S3 endpoints using a Minio client
* xref:metadata-types/naming-scheme.adoc[Naming Scheme]: Reusable rules to normalize Hop field names, database identifiers, and file or folder names
* xref:metadata-types/webdav-connection.adoc[WebDAV Connection]: Named WebDAV or WebDAV-over-HTTPS endpoint used as a VFS scheme in file paths
* xref:metadata-types/neo4j/neo4j-connection.adoc[Neo4j Connection]: A shared connection to a Neo4j server
* xref:metadata-types/neo4j/neo4j-graphmodel.adoc[Neo4j Graph Model]: Description of the nodes, relationships, indexes, ... of a Neo4j graph
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////
:imagesdir: ../../assets/images/
:page-pagination:
:description: A Naming Scheme defines reusable rules to normalize Hop field names, database identifiers, and file or folder names.

= Naming Scheme

== Description

A *Naming Scheme* describes how free-form names should be turned into consistent identifiers.
Typical uses include cleaning field names that arrive with spaces (for example `Order ID` → `order_id`) and applying a shared project convention (snake_case, camelCase, PascalCase, and so on).

Naming Schemes are managed as project metadata. You can apply a scheme of type *Hop field names* from any editable table in Hop Gui via the TableView toolbar action **Apply a Naming Scheme to a column**.

NOTE: Types for database tables/columns and files/folders are reserved for future UI surfaces; the same engine and options apply.

== Options

image:metadata-types/naming-scheme-editor.png[Naming Scheme editor, width="75%"]

The screenshot above shows a scheme named `lowercase-dashes`: lower case words joined with dashes, so `Order ID` previews as `order-id`.

[options="header"]
|===
|Option|Description
|Name|Unique metadata name of this scheme.
|Description|Optional free-text description.
|Type|Target kind: Hop field names, database tables, database columns, files, or folders.
|Case style|`As is`, `Lower case`, `Upper case`, `camelCase`, or `PascalCase`.
|Word separator|How words are joined when not using camel/Pascal case: none, underscore (`_`), or dash (`-`).
|Extra delimiters|Additional characters treated as word boundaries (beyond spaces, `_`, `-`, and camelCase edges).
|Remove special characters|When enabled, strip non letter/digit characters from each word.
|Collapse repeated separators|When enabled, collapse repeated separators such as `__` to a single separator.
|Trim leading/trailing separators|When enabled, remove separators at the start or end of the result.
|Prefix / Suffix|Optional strings prepended or appended after the transform.
|Preview input / output|Live sample showing how the current options transform a name.
|===

== Examples

[options="header"]
|===
|Input|Case style|Word separator|Result
|`Order ID`|Lower case|Underscore (`_`)|`order_id`
|`Order ID`|As is|Underscore (`_`)|`Order_ID`
|`Order ID`|camelCase|_|`orderId`
|`Order ID`|PascalCase|_|`OrderId`
|`order-id`|Upper case|Underscore (`_`)|`ORDER_ID`
|`Order ID`|Lower case|Dash (`-`)|`order-id`
|===

== Applying from TableView

. Open a transform or dialog that shows a field list (or any other editable table).
. Ensure table toolbars are visible (Hop Gui options).
. Click the **Apply a Naming Scheme to a column** toolbar icon (label / tag icon on the TableView toolbar).
. Select the column to rename (usually the first / name column).
. Select a Naming Scheme of type *Hop field names*.
. Confirm — values in non-empty rows are updated. Use the table Undo action if needed.

TIP: Create at least one Naming Scheme in the Metadata perspective before using the toolbar action.

=== Example: CSV File Input fields

The following example uses the `lowercase-dashes` scheme on the **Name** column of a xref:pipeline/transforms/csvinput.adoc[CSV File Input] field list.

*Before* — mixed styles (`ID`, `FirstName`, `birth_date`, `stateCode`, …):

image:metadata-types/naming-scheme-csv-input-before.png[CSV File Input fields before applying a Naming Scheme, width="90%"]

*After* — consistent lower-case names with dashes (`id`, `first-name`, `birth-date`, `state-code`, …):

image:metadata-types/naming-scheme-csv-input-after.png[CSV File Input fields after applying the lowercase-dashes Naming Scheme, width="90%"]

== Related

* GitHub issue https://github.com/apache/hop/issues/2683[#2683] — field name cleanup / naming toolbar
32 changes: 32 additions & 0 deletions plugins/misc/naming/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache.hop</groupId>
<artifactId>hop-plugins-misc</artifactId>
<version>2.19.0-SNAPSHOT</version>
</parent>

<artifactId>hop-misc-naming</artifactId>
<packaging>jar</packaging>
<name>Hop Naming Scheme</name>

</project>
35 changes: 35 additions & 0 deletions plugins/misc/naming/src/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->

<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd">
<id>hop-misc-naming</id>
<formats>
<format>zip</format>
</formats>
<baseDirectory>.</baseDirectory>
<dependencySets>
<dependencySet>
<includes>
<include>org.apache.hop:hop-misc-naming:jar</include>
</includes>
<outputDirectory>lib/core</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
Loading
Loading