Sort

Operation Name

Sort

Function Overview

Sorts the input data.

Data Model

Table model type.
Refer to "Table model type schema" for input/output schema.

Properties

Basic settings
Item name Required/Optional Use of variables Description Remarks
Name Required Not available Enter the name to show 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 columns which would be the key for sort operation.
Comparison priority for a key set to upper row will be high.

Each column 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, the key with higher priority will be compared sequentially. Only when the comparison result is equal, the subsequent keys will be compared.
  • As default, when the order of a result of comparing all the key columns is equal, the operation does not assure the output order of the row data.
  • You cannot specify a byte[] type column and sort data.
Sort key configuration/Column name Required Not available Select a column name that would be a key.
  • Displays the index that shows the order after 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 Select a data type at the time of sort, when the key column is string.
  • [String]: (Default)
    Compares the column as is without converting it.
  • [Number]:
    Converts the column into number and then compares it.
  • [Date/Time]:
    Converts the column into date and then compares it.
  • Enabled when the data type of the column specified in [Sort key configuration/Column name] is string.
  • When [Date/Time] is selected, converts from string to date and time using date format of DataSpider Servista.
Sort key configuration/Order Required Not available Select the order of sort.
  • [Ascending]: (Default)
    Sorts row data so that the column will be in ascending order.
  • [Descending]:
    Sorts row data so that the column will be in descending order.
  • When the column is string, sorting is done in the order corresponding to the data type specified by [Sort key configuration/Data type].
  • When the column is other than string, sorting is done in the order of 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 value of sort key is equal.
  • [Checked]:
    Preserves the order.
  • [Not Checked]: (Default)
    Does not preserve the order.
  • When it is checked, the performance of the processing may be worse.
Output settings
Item name Required/Optional Use of variables Description Remarks
Configure output manually Optional Not available Select whether or not to set columns to be output manually.
  • [Checked]:
    Output target is set manually.
  • [Not checked]:(Default)
    Output target will be automatically set according to the content of the specified property items.
  • When it is not checked, the output target would be in the following order.
    1. Order of the input schema of [Input data]
Output target configuration Optional - Specify columns to be output.

Each column can be operated with the following buttons.
  • [Up]:
    Moves the output order of the output target upwards by one .
  • [Down]:
    Moves the output order of the output target downwards by one.
  • [Add]:
    Adds an output target.
  • [Delete]:
    Deletes the output target.
  • Enabled when [Configure output manually] is checked.
Output target configuration/Column name Required Not available Select the name of a column to be output.
  • Displays the index that shows the order after 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 adapter.
The description will be reflected in the specifications.
 

Schema

Input Schema

Same as the schema of input source component.

Output Schema

Depending on [Output setting], the number of column differ.
For schema structure, refer to "Table Model Type Schema".

Loading Schema in Mapper

Output schema will be loaded automatically while input schema should be done manually.
Specify the schema for data to be loaded.
For more details, refer to "Edit Schema".

Mass Data Processing

Mass data processing is not supported.

PSP Usage

PSP is not supported.

Available Component Variables

Component variable name Description Remarks
message_category Stores the category to which corresponding message code belongs to, when error occurs.
  • Default value is null.
message_code Stores its corresponding message code of the occurred error.
  • Default value is null.
message_level Stores the severity of the corresponding message code of the occurred error.
  • Default value is null.
error_type Stores the error type when error occurs.
  • Default value is null.
  • Error is represented in the format depicted below.
    Example: "java.io.FileNotFoundException"
  • Stored contents may vary depending on the version of DataSpider Servista.
error_message Stores the error message when error occurs.
  • Default value is null.
  • Stored contents may vary depending on the version of DataSpider Servista.
error_trace Stores the trace information when error occurs.
  • Default value is null.
  • Stored contents may vary depending on the version of DataSpider Servista or the client application used.

Schema Modification of Input Source Component

Null and Empty String

Specification Limits

Main Exceptions

Exception name Cause Solution
InputDataNotFoundException [Input data] is not specified. Specify the [Input data] or, draw an input data flow.
InvalidInputTypeException [Input data] is not table model type. Check whether the component specified in [Input data]is table model.
InvalidPropertyConfigurationException
Value is not specified in <property name>
Value is not specified in [<property name>] Specify the [<property name>].
InvalidPropertyConfigurationException
Value is not specified in <property name2> of the row [<row number>] in [<property name1>].
Value is not specified in [<property name2>]. Specify the [<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 for [<property name>] is appropriate.
ConversionFailedException
Column value cannot be processed as specified sort key.
The contents of input data contains some values that cannot 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.
Date format applicable to [<value of column>] was not found. Check whether [<value of column>] is following the date format of DataSpider Servista.