1.1 - 8.10 - XMLRelation Syntax Elements - Teradata Vantage

Teradata Vantage™ - Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
1.1
8.10
Release Date
October 2019
Content Type
Programming Reference
Publication ID
B700-4003-079K
Language
English (United States)
TextColumn
Specify the name of the input table column that contains the XML documents. The function skips malformed XML documents.
DocIDColumns
Specify the names of the input table columns that contain the identifiers of the XML documents. No docid_column can have the same name as an output table column. For output column names, see XMLRelation Output.
MaxDepth
[Optional] Specify the maximum depth in the XML tree at which to process XML documents. The MaxDepth and OutputType syntax elements determine the schema of the output table.
Default: 5
Maximum: 1000
ExcludeElements
[Optional] Specify the paths to the nodes to exclude from processing. The function excludes each specified node and its child nodes. Here are examples of paths to nodes:
  • 'chapter'
  • 'root/book'
  • 'root/book/{author,chapter}'
AttributeAsNode
[Optional] Specify whether to treat the attributes of a node as its child nodes.
Default: 'false' (Attributes of a node are stored in one element of the output tuple.)
AttributeDelimiter
[Optional] Specify the delimiter used to separate multiple attributes of one node in XML documents.
Default: ',' (comma)
OutputType
[Optional] Specify the output table schema. The MaxDepth and OutputType syntax elements determine the schema of the output table, and the number of columns in the output table must not exceed 1600.
Default: 'fullpath'
ErrorHandler
[Optional] Specify whether the function handles errors that occur when parsing an XML document.
If you specify 'true':
  • If an error occurs while parsing a row, the function skips that row. When the function completes the parsing, it outputs only the nodes that were error-free.
  • You can tell the function to output an additional column named output_column and populate it with the values of the specified columns.

    The name output_column can contain only lowercase letters and underscores. Default: errorhandler

    In the output column, the values of the specified columns are separated with semicolons.

    For example, the following syntax element adds the column error_info to the output table and populates it with the values of input columns col1 and col2 (with a semicolon after each value):

    ErrorHandler ('true;error_info:col1,col2')
Default: 'false' (The function aborts and throws an exception.)
Accumulate
[Optional] Specify the names of input column names to copy to the output table. No accumulate_column can have the same name as an output table column. For output column names, see XMLRelation Output.