Array Privileges and Configuration

In order to create an ARRAY data type or to run array functions, users must have either the UDTTYPE or UDTMETHOD privilege on the SYSUDTLIB database.

Use below syntax to grant permission to user.
GRANT UDTMETHOD ON SYSUDTLIB TO <USER>
GRANT SELECT ON UDTInfo TO <USER>

Configuration options for arrays enable users to specify element types and array length to work within Teradata's 64KB array size limit. This is necessary because Teradata uses structured UDT-based arrays with predefined options, while PySpark employs dynamic allocation without size constraints.

default_array_size is a configuration option used to set the array size irrespective of type, defaulted to 100. This affects the maximum number of elements that can be stored in array columns.

Usage Example

>>> from teradatamlspk import TeradataSession
>>> session = TeradataSession.builder.getOrCreate(...)
# Set the configuration option to store only 10 elements across the session.
>>> session.conf.set("default_array_size", 10)

Configuration Options

Array type Config Option Default Value
array_decimal decimal_precision 39
decimal_scale 19
array_number number_precision 38
number_scale 19
array_interval_year_to_month interval_precision 4
array_interval_day_to_second interval_frac_precision 6
interval_precision 4
array_char char_length 2000
array_varchar char_length 2000
array_byte byte_length 64000
array_varbyte byte_length 64000