Unpack

Takes a single column with packed data and transforms it into a table with multiple columns, as specified by the user's parameters.

Options

Accumulate
Specifies the input table columns to copy to the output table. By default, the function copies no input table columns to the output table.
ColumnLength (strings seperated by new line)
Specifies the lengths of the virtual columns; therefore, to use this argument, you must know the length of each virtual column. If ColumnLength specifies only one value and OutputColumns specifies multiple columns, then the specified value applies to every output_column. If ColumnLength specifies multiple values, then it must specify a value for each output_column. The nth datatype corresponds to the nth output_column. However, the last column_name can be an asterisk (*), which represents a single virtual column that contains the remaining data. For example, if the first three virtual columns have the lengths 2, 1, and 3, and all remaining data belongs to the fourth virtual column, you can specify ColumnLength ('2', '1', '3', *). If you specify this argument, you must omit the Delimiter argument.
Delimiter
Specifies the delimiter (a string) that separates the virtual columns in the packed data.The default delimiter is comma (,). If the virtual columns are separated by a delimiter, then specify the delimiter with this argument; otherwise, specify the ColumnLength argument. Do not specify both this argument and the ColumnLength argument.
IgnoreInvalid
Specifies whether the function ignores rows that contain invalid data; that is, continues without outputting them. The default value is 'false', which causes the function to fail if it encounters a row with invalid data.
OutputColumns (strings seperated by new line)
Specifies the names to give to the output columns, in the order in which the corresponding virtual columns appear in input_column.If you specify fewer output column names than there are virtual input columns, the function ignores the extra virtual input columns. That is, if the packed data contains x+y virtual columns and the OutputColumns argument specifies x output column names, the function assigns the names to the first x virtual columns and ignores the remaining y virtual columns.
OutputDataTypes (strings seperated by new line)
Specifies the datatypes of the unpacked output columns.Supported OutputDataTypes are VARCHAR, INTEGER, DOUBLE PRECISION, TIME, DATE, and TIMESTAMP.If OutputDataTypes specifies only one value and OutputColumns specifies multiple columns, then the specified value applies to every output_column. If OutputDataTypes specifies multiple values, then it must specify a value for each output_column. The nth datatype corresponds to the nth output_column.The function can output only 16 VARCHAR columns.
Regex
Specifies a regular expression that describes a row of packed data, enabling the function to find the data values. A row of packed data contains one data value for each virtual column, but the row might also contain other information (such as the virtual column name). In the regular_expression, each data value is enclosed in parentheses. For example, suppose that the packed data has two virtual columns, age and sex, and that one row of packed data is: age:34,sex:male The regular_expression that describes the row is '.*:(.*)'. The '.*:' matches the virtual column names, age and sex, and the '(.*)' matches the values, 34 and male. The default regular_expression is '(.*)' which matches the whole string (between delimiters, if any). When applied to the preceding sample row, the default regular_expression causes the function to return 'age:34' and 'sex:male' as data values. To represent multiple data groups in regular_expression, use multiple pairs of parentheses. Bydefault, the last data group in regular_expression represents the data value (other data groups are assumed to be virtual column names or unwanted data). If a different data group represents the data value, specify its group number with the RegexSet argument.
RegexSet
Specifies the ordinal number of the data group in regular_expression that represents the data value in a virtual column. By default, the last data group in regular_expression represents the data value. For example, suppose that regular_expression is: '([a-zA-Z]*):(.*)' If group_number is '1', then '([a-zA-Z]*)' represents the data value. If group_number is '2', then '(.*)' represents the data value.
Output Schema
Output Schema, if Volatile is true then use user login as the schema.
Output Table
Output Table
VAL Location
VAL Location
TargetColumn
Specifies the name of the input column that contains the packed data.
Volatile
Specifies whether the table should be a VOLATILE table. If true, then the table is automatically deleted, otherwise it is users responsibility to remove or clean it up for space.

Input Ports

Icon
Connection to a Teradata Database Instance
Icon
The table containing the input attributes.

Output Ports

Icon
output of Unpack

Nodes

Extensions

Links