Sort

Operation name

Sort

Function overview

Sorts the input data.

Data model

The data model of this component is table model type.

= Remarks =

For more details on input/output schema, refer to Table model type .

Properties

Basic settings

Item name

Required/Optional

Use of variables

Description

Remarks

Name

Required

Not available

Enter a name that is used on the script canvas.

 

Input data

Required

Not available

Select a component on the script canvas.

 

Required settings

Item name

Required/Optional

Use of variables

Description

Remarks

Sort key configuration

Required

-

Specify the columns to be used as keys for the Sort operation.

A key set for a higher row has a higher comparison priority.

Each row can be operated with the following buttons:

Up

Raises the comparison priority of the key.

Down

Lowers the comparison priority of the key.

Add

Adds a key.

Delete

Deletes the key.

  • When multiple columns are specified as keys, comparison is performed sequentially beginning with the key with highest priority. Only when the comparison results are equal, the subsequent keys are compared.

  • When the positions of the rows are equal in the order after comparing all the key columns, default operation doesn't ensure the output order of the rows.

Note

You can't specify a byte[] type column and sort data.

Sort key configuration/Column name

Required

Not available

Select the name of the column to be used as a key.

  • The index that shows the position of the column in the order is displayed at the end of the column name.

  • When the value of Input data is selected or changed, column name will be updated.

Sort key configuration/Data type

Required

Not available

If the key column is a string, select the data type to be used during sorting.

String

(Default)

The column is compared as is, without converting it.

Number

The column is converted into numbers and then compared.

Date/Time

The column is converted into date/time and then compared.

  • Enabled when the data type of the column specified in Sort key configuration/Column name is string.

  • When Date/Time is selected, the data type of the column is converted from string to date and time using the date format of HULFT Square.

Sort key configuration/Order

Required

Not available

Select the order of sort.

Ascending

(Default)

The rows are sorted so that the column is in ascending order.

Descending

The rows are sorted so that the column is in descending order.

  • When the values in the column are strings, sorting is performed according to the data type specified in Sort key configuration/Data type.

  • When the values in the column are other than strings, sorting is performed according to the data type specified in the column.

  • When sorting it as string, it will be in Unicode order.

Preserve the initial order of keys with equal values

Optional

Not available

Select whether to preserve the order of the input data or not, when the values of sort key are equal.

Selected

The order is preserved.

Not selected

(Default)

The order isn't preserved.

  • When it's selected, the performance of the processing may degrade.

Output settings

Item name

Required/Optional

Use of variables

Description

Remarks

Configure output manually

Optional

Not available

Select whether or not to manually set columns to be output.

Selected

Output targets are set manually.

Not selected

(Default)

Output targets are automatically set according to the content of the specified property items.

  • When it's not selected, the output targets are in the following order:

    1. The order of the input schema of Input data

Output target configuration

Optional

-

Specify columns to be output.

Each row can be operated with the following buttons:

Up

Moves the output target upward by one row in the output order.

Down

Moves the output target downward by one row in the output order.

Add

Adds an output target.

Delete

Deletes the output target.

  • Enabled when Configure output manually is selected.

Output target configuration/Column name

Required

Not available

Select the name of a column to be output.

  • The index that shows the position of the column in the order is displayed at the end of the column name.

  • When the value of Input data is selected or changed, column name will be updated.

Comment

Item name

Required/Optional

Use of variables

Description

Remarks

Comment

Optional

Not available

You can write a short description of this connector.

 

Schemas

Input schema

Same as the schema of input source component.

Output schema

The number of columns varies depending on the settings for Output Settings.

= Remarks =

For schema structure, refer to Table model type .

Loading schema in Mapper

The output schema is loaded automatically while the input schema needs to be loaded manually.

Specify the schema of the data to be loaded.

= Remarks =

For details, refer to Edit Schema.

Mass data processing

Mass data processing isn't supported.

Parallel Stream Processing

PSP isn't supported.

Available component variables

Component variable name

Description

Remarks

message_category

When an error occurs, the category of the message code corresponding to the error is stored.

  • The default value is null.

message_code

When an error occurs, the code of the message code corresponding to the error is stored.

  • The default value is null.

message_level

When an error occurs, the severity of the message code corresponding to the error is stored.

  • The default value is null.

error_type

When an error occurs, the error type is stored.

  • The default value is null.

  • The format of the error type is as follows.

    Example: java.io.FileNotFoundException

error_message

When an error occurs, the error message is stored.

  • The default value is null.

error_trace

When an error occurs, the trace information for the error is stored.

  • The default value is null.

Modifying schema of input source component

  • When the schema of the component specified in Input data is modified, to reflect those changes to the Sort operation, open the property setting dialog of the Sort operation and click Finish button.

  • When the schema structure of the component specified in Input data is modified (such as changes to the order of the schema elements, or deletion of schema elements), settings for Sort key configuration/Column name and Output target configuration/Column name must be modified accordingly.

    The reason is that the Sort operation keeps the information of columns by their positions in the order (indices) rather than by their names.

Null and empty strings

  • An error occurs when there's a null value for the value of the column which is specified in Sort key configuration.

  • When there's an empty string for the value of the column which is specified in Sort key configuration, the behavior of the operation depends on the value specified in Sort key configuration/Data type.

    • If it's String, an empty string is processed as the sort key value.

    • If it's a value other than String, an error occurs.

Specification limits

  • Multi-thread processing is supported.

    = Remarks =

    For the specification limits on multi-thread processing, refer to Specification limitations.

  • When specifying Sort key configuration and Output target configuration, the output schema of input source component must be configured.

    For components that require manual schema settings, load schemas with Mapper.

  • When Date/Time is selected for Sort key configuration/Data type, an error occurs during execution if multiple date formats exist for the values of the specified column.

  • Even when mass data processing is performed by the input source component, data is temporarily held in the memory during the execution of the Sort operation.

    Therefore, when the data amount is huge, OutOfMemoryError may occur even with mass data processing enabled.

Exception messages

Exception name

Cause

Solution

InputDataNotFoundException

Input data isn't specified.

Specify Input data or draw a data flow.

InvalidInputTypeException

Input data isn't table model type.

Check whether the component specified in Input data is table model type.

InvalidPropertyConfigurationException

Value is not specified in <property name>

A value isn't specified in <property name>.

Specify <property name>.

InvalidPropertyConfigurationException

Value is not specified in <property name2> of the row [<row number>] in [<property name1>].

A value isn't specified in <property name2>.

Specify <property name2>.

InvalidPropertyConfigurationException

The value specified in the row [<row number>] of <property name> is duplicated.

The value specified in <property name> is duplicated.

Check whether the value specified in <property name> is appropriate.

ConversionFailedException

Column value cannot be processed as specified sort key.

The contents of the input data contain some values that can't be processed as per the specification in Sort key configuration.

Check whether the input data is compatible with the contents specified in Sort key configuration, or whether any null or empty string is contained.

ConversionFailedException

Date format applicable to [<value of column>] was not found.

A date format applicable to <value of column> was not found.

Check whether <value of column> follows the date format of HULFT Square.