diff --git a/README.md b/README.md
index 20b9b17..6d1103e 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,13 @@ This package enables Python applications to connect to the Teradata Database.
This package implements the [PEP-249 Python Database API Specification 2.0](https://www.python.org/dev/peps/pep-0249/).
-This package requires 64-bit Python 3.7 or later, and runs on Windows, macOS, and Linux. 32-bit Python is not supported.
+This package requires 64-bit Python 3.7 or later and runs on the following operating systems and processor architectures. 32-bit Python is not supported.
+* Windows x64 on 64-bit Intel and AMD processors
+* macOS on 64-bit ARM processors
+* macOS on 64-bit Intel processors
+* Linux x64 on 64-bit Intel and AMD processors
+* Linux ARM64 on 64-bit ARM processors
+* Linux ppc64le on 64-bit Power processors
For community support, please visit [Teradata Community](https://support.teradata.com/community).
@@ -12,25 +18,28 @@ For Teradata customer support, please visit [Teradata Customer Service](https://
Please note, this driver may contain beta/preview features ("Beta Features"). As such, by downloading and/or using the driver, in addition to agreeing to the licensing terms below, you acknowledge that the Beta Features are experimental in nature and that the Beta Features are provided "AS IS" and may not be functional on any machine or in any environment.
-Copyright 2024 Teradata. All Rights Reserved.
+Copyright 2026 Teradata. All Rights Reserved.
### Table of Contents
* [Features](#Features)
-* [Limitations](#Limitations)
* [Installation](#Installation)
* [License](#License)
* [Documentation](#Documentation)
* [Sample Programs](#SamplePrograms)
* [Using the Driver](#Using)
* [Connection Parameters](#ConnectionParameters)
+* [FIPS Mode](#FIPSMode)
* [COP Discovery](#COPDiscovery)
+* [Proxy Server Support](#ProxyServer)
* [Stored Password Protection](#StoredPasswordProtection)
* [Logon Authentication Methods](#LogonMethods)
* [Client Attributes](#ClientAttributes)
* [User STARTUP SQL Request](#UserStartup)
+* [Session Reconnect](#SessionReconnect)
* [Transaction Mode](#TransactionMode)
* [Auto-Commit](#AutoCommit)
+* [Trusted SQL and Query Band Impersonation](#TrustedSQL)
* [Data Types](#DataTypes)
* [Null Values](#NullValues)
* [Character Export Width](#CharacterExportWidth)
@@ -47,7 +56,13 @@ Copyright 2024 Teradata. All Rights Reserved.
* [FastLoad](#FastLoad)
* [FastExport](#FastExport)
* [CSV Batch Inserts](#CSVBatchInserts)
+* [Parquet Batch Inserts](#ParquetBatchInserts)
+* [JSON Batch Inserts](#JSONBatchInserts)
+* [JSONL Batch Inserts](#JSONLBatchInserts)
* [CSV Export Results](#CSVExportResults)
+* [Parquet Export Results](#ParquetExportResults)
+* [JSON Export Results](#JSONExportResults)
+* [JSONL Export Results](#JSONLExportResults)
* [Command Line Interface](#CommandLineInterface)
* [Change Log](#ChangeLog)
@@ -57,8 +72,6 @@ Copyright 2024 Teradata. All Rights Reserved.
The *Teradata SQL Driver for Python* is a DBAPI Driver that enables Python applications to connect to the Teradata Database. The driver implements the [PEP-249 Python Database API Specification 2.0](https://www.python.org/dev/peps/pep-0249/).
-The driver is a young product that offers a basic feature set. We are working diligently to add features to the driver, and our goal is feature parity with the Teradata JDBC Driver.
-
At the present time, the driver offers the following features.
* Supported for use with Teradata database 16.20 and later releases.
@@ -70,8 +83,9 @@ At the present time, the driver offers the following features.
* [OpenID Connect (OIDC)](https://en.wikipedia.org/wiki/OpenID#OpenID_Connect_(OIDC)) logon authentication methods `BEARER`, `BROWSER`, `CODE`, `CRED`, `JWT`, `ROPC`, and `SECRET`.
* Data encryption provided by TLS for HTTPS connections.
* For non-HTTPS connections, data encryption governed by central administration or enabled via the `encryptdata` connection parameter.
-* Unicode character data transferred via the UTF8 session character set.
-* [Auto-commit]((#AutoCommit)) for ANSI and TERA transaction modes.
+* Recoverable Network Protocol and Redrive.
+* Unicode character data transferred via the UTF8 or UTF16 session character set.
+* [Auto-commit](#AutoCommit) for ANSI and TERA transaction modes.
* Result set row size up to 1 MB.
* Multi-statement requests that return multiple result sets.
* Most JDBC escape syntax.
@@ -86,13 +100,6 @@ At the present time, the driver offers the following features.
* FastLoad and FastExport.
* Monitor partition.
-
-
-### Limitations
-
-* The UTF8 session character set is always used. The `charset` connection parameter is not supported.
-* No support yet for Recoverable Network Protocol and Redrive.
-
### Installation
@@ -122,7 +129,6 @@ Platform | Command
macOS or Linux | `pip install --no-deps teradatasql`
Windows | `py -3 -m pip install --no-deps teradatasql`
-
### License
@@ -151,10 +157,14 @@ The sample programs are coded with a fake database hostname `whomooz`, username
Program | Purpose
------------------------------------------------------------------------------------------------------------------- | ---
+[AbortSession.py](https://github.com/Teradata/python-driver/blob/master/samples/AbortSession.py) | Demonstrates how to abort a session
[AGKRBatchInsert.py](https://github.com/Teradata/python-driver/blob/master/samples/AGKRBatchInsert.py) | Demonstrates how to insert a batch of rows with Auto-Generated Key Retrieval (AGKR)
[AGKRInsertSelect.py](https://github.com/Teradata/python-driver/blob/master/samples/AGKRInsertSelect.py) | Demonstrates Insert/Select with Auto-Generated Key Retrieval (AGKR)
[BatchInsert.py](https://github.com/Teradata/python-driver/blob/master/samples/BatchInsert.py) | Demonstrates how to insert a batch of rows
[BatchInsertCSV.py](https://github.com/Teradata/python-driver/blob/master/samples/BatchInsertCSV.py) | Demonstrates how to insert a batch of rows from a CSV file
+[BatchInsertJSON.py](https://github.com/Teradata/python-driver/blob/master/samples/BatchInsertJSON.py) | Demonstrates how to insert a batch of rows from a JSON file
+[BatchInsertJSONL.py](https://github.com/Teradata/python-driver/blob/master/samples/BatchInsertJSONL.py) | Demonstrates how to insert a batch of rows from a JSONL file
+[BatchInsertParquet.py](https://github.com/Teradata/python-driver/blob/master/samples/BatchInsertParquet.py) | Demonstrates how to insert a batch of rows from a Parquet file
[BatchInsPerf.py](https://github.com/Teradata/python-driver/blob/master/samples/BatchInsPerf.py) | Measures time to insert one million rows
[CancelSleep.py](https://github.com/Teradata/python-driver/blob/master/samples/CancelSleep.py) | Demonstrates how to use the cancel method to interrupt a query
[CharPadding.py](https://github.com/Teradata/python-driver/blob/master/samples/CharPadding.py) | Demonstrates the database's *Character Export Width* behavior
@@ -164,18 +174,35 @@ Program
[ElicitFile.py](https://github.com/Teradata/python-driver/blob/master/samples/ElicitFile.py) | Demonstrates C source file upload to create a User-Defined Function (UDF)
[ExportCSVResult.py](https://github.com/Teradata/python-driver/blob/master/samples/ExportCSVResult.py) | Demonstrates how to export a query result set to a CSV file
[ExportCSVResults.py](https://github.com/Teradata/python-driver/blob/master/samples/ExportCSVResults.py) | Demonstrates how to export multiple query result sets to CSV files
+[ExportJSONLResult.py](https://github.com/Teradata/python-driver/blob/master/samples/ExportJSONLResult.py) | Demonstrates how to export a query result set to a JSONL file
+[ExportJSONLResults.py](https://github.com/Teradata/python-driver/blob/master/samples/ExportJSONLResults.py) | Demonstrates how to export multiple query result sets to JSONL files
+[ExportJSONResult.py](https://github.com/Teradata/python-driver/blob/master/samples/ExportJSONResult.py) | Demonstrates how to export a query result set to a JSON file
+[ExportJSONResults.py](https://github.com/Teradata/python-driver/blob/master/samples/ExportJSONResults.py) | Demonstrates how to export multiple query result sets to JSON files
+[ExportParquetResult.py](https://github.com/Teradata/python-driver/blob/master/samples/ExportParquetResult.py) | Demonstrates how to export a query result set to a Parquet file
+[ExportParquetResults.py](https://github.com/Teradata/python-driver/blob/master/samples/ExportParquetResults.py) | Demonstrates how to export multiple query result sets to Parquet files
[FakeExportCSVResults.py](https://github.com/Teradata/python-driver/blob/master/samples/FakeExportCSVResults.py) | Demonstrates how to export multiple query result sets with the metadata to CSV files
+[FakeExportJSONLResults.py](https://github.com/Teradata/python-driver/blob/master/samples/FakeExportJSONLResults.py) | Demonstrates how to export multiple query result sets with the metadata to JSONL files
+[FakeExportJSONResults.py](https://github.com/Teradata/python-driver/blob/master/samples/FakeExportJSONResults.py) | Demonstrates how to export multiple query result sets with the metadata to JSON files
+[FakeExportParquetResults.py](https://github.com/Teradata/python-driver/blob/master/samples/FakeExportParquetResults.py) | Demonstrates how to export multiple query result sets with the metadata to Parquet files
[FakeResultSetCon.py](https://github.com/Teradata/python-driver/blob/master/samples/FakeResultSetCon.py) | Demonstrates connection parameter for fake result sets
[FakeResultSetEsc.py](https://github.com/Teradata/python-driver/blob/master/samples/FakeResultSetEsc.py) | Demonstrates escape function for fake result sets
[FastExportCSV.py](https://github.com/Teradata/python-driver/blob/master/samples/FastExportCSV.py) | Demonstrates how to FastExport rows from a table to a CSV file
+[FastExportJSON.py](https://github.com/Teradata/python-driver/blob/master/samples/FastExportJSON.py) | Demonstrates how to FastExport rows from a table to a JSON file
+[FastExportJSONL.py](https://github.com/Teradata/python-driver/blob/master/samples/FastExportJSONL.py) | Demonstrates how to FastExport rows from a table to a JSONL file
+[FastExportParquet.py](https://github.com/Teradata/python-driver/blob/master/samples/FastExportParquet.py) | Demonstrates how to FastExport rows from a table to a Parquet file
[FastExportTable.py](https://github.com/Teradata/python-driver/blob/master/samples/FastExportTable.py) | Demonstrates how to FastExport rows from a table
[FastLoadBatch.py](https://github.com/Teradata/python-driver/blob/master/samples/FastLoadBatch.py) | Demonstrates how to FastLoad batches of rows
[FastLoadCSV.py](https://github.com/Teradata/python-driver/blob/master/samples/FastLoadCSV.py) | Demonstrates how to FastLoad batches of rows from a CSV file
+[FastLoadJSON.py](https://github.com/Teradata/python-driver/blob/master/samples/FastLoadJSON.py) | Demonstrates how to FastLoad batches of rows from a JSON file
+[FastLoadJSONL.py](https://github.com/Teradata/python-driver/blob/master/samples/FastLoadJSONL.py) | Demonstrates how to FastLoad batches of rows from a JSONL file
+[FastLoadParquet.py](https://github.com/Teradata/python-driver/blob/master/samples/FastLoadParquet.py) | Demonstrates how to FastLoad batches of rows from a Parquet file
[HelpSession.py](https://github.com/Teradata/python-driver/blob/master/samples/HelpSession.py) | Displays session information
[IgnoreErrors.py](https://github.com/Teradata/python-driver/blob/master/samples/IgnoreErrors.py) | Demonstrates how to ignore errors
[InsertLob.py](https://github.com/Teradata/python-driver/blob/master/samples/InsertLob.py) | Demonstrates how to insert BLOB and CLOB values
+[InsertVector.py](https://github.com/Teradata/python-driver/blob/master/samples/InsertVector.py) | Demonstrates how to insert Vector values
[InsertXML.py](https://github.com/Teradata/python-driver/blob/master/samples/InsertXML.py) | Demonstrates how to insert and retrieve XML values
[LoadCSVFile.py](https://github.com/Teradata/python-driver/blob/master/samples/LoadCSVFile.py) | Demonstrates how to load data from a CSV file into a table
+[LoadParquetFile.py](https://github.com/Teradata/python-driver/blob/master/samples/LoadParquetFile.py) | Demonstrates how to load data from a Parquet file into a table
[LobLocators.py](https://github.com/Teradata/python-driver/blob/master/samples/LobLocators.py) | Demonstrates how to use LOB locators
[MetadataFromPrepare.py](https://github.com/Teradata/python-driver/blob/master/samples/MetadataFromPrepare.py) | Demonstrates how to prepare a SQL request and obtain SQL statement metadata
[MonitorAbort.py](https://github.com/Teradata/python-driver/blob/master/samples/MonitorAbort.py) | Demonstrates how to use the Monitor partition to abort a session
@@ -222,71 +249,112 @@ Our goal is consistency for the connection parameters offered by this driver and
Parameter | Default | Type | Description
----------------------- | ----------- | -------------- | ---
-`account` | | string | Specifies the database account. Equivalent to the Teradata JDBC Driver `ACCOUNT` connection parameter.
-`browser` | | string | Specifies the command to open the browser for Browser Authentication when `logmech` is `BROWSER`. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `BROWSER` connection parameter.
The specified command must include a placeholder token, literally specified as `PLACEHOLDER`, which the driver will replace with the Identity Provider authorization endpoint URL. The `PLACEHOLDER` token is case-sensitive and must be specified in uppercase.
• On Windows, the default command is `cmd /c start "title" "PLACEHOLDER"`. Windows command syntax requires the quoted title to precede the quoted URL.
• On macOS, the default command is `open PLACEHOLDER`. macOS command syntax does not allow the URL to be quoted.
-`browser_tab_timeout` | `"5"` | quoted integer | Specifies the number of seconds to wait before closing the browser tab after Browser Authentication is completed. The default is 5 seconds. The behavior is under the browser's control, and not all browsers support automatic closing of browser tabs. Typically, the tab used to log on will remain open indefinitely, but the second and subsequent tabs will be automatically closed. Specify `0` (zero) to close the tab immediately. Specify `-1` to turn off automatic closing of browser tabs. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `BROWSER_TAB_TIMEOUT` connection parameter.
-`browser_timeout` | `"180"` | quoted integer | Specifies the number of seconds that the driver will wait for Browser Authentication to complete. The default is 180 seconds (3 minutes). Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `BROWSER_TIMEOUT` connection parameter.
-`code_append_file` | `"-out"` | string | Specifies how to display the verification URL and code. Optional when `logmech` is `CODE` and ignored for other `logmech` values. The default `-out` prints the verification URL and code to stdout. Specify `-err` to print the verification URL and code to stderr. Specify a file name to append the verification URL and code to an existing file or create a new file if the file does not exist. Equivalent to the Teradata JDBC Driver `CODE_APPEND_FILE` connection parameter.
-`column_name` | `"false"` | quoted boolean | Controls the behavior of cursor `.description` sequence `name` items. Equivalent to the Teradata JDBC Driver `COLUMN_NAME` connection parameter. False specifies that a cursor `.description` sequence `name` item provides the AS-clause name if available, or the column name if available, or the column title. True specifies that a cursor `.description` sequence `name` item provides the column name if available, but has no effect when StatementInfo parcel support is unavailable.
-`connect_failure_ttl` | `"0"` | quoted integer | Specifies the time-to-live in seconds to remember the most recent connection failure for each IP address/port combination. The driver subsequently skips connection attempts to that IP address/port for the duration of the time-to-live. The default value of zero disables this feature. The recommended value is half the database restart time. Equivalent to the Teradata JDBC Driver `CONNECT_FAILURE_TTL` connection parameter.
-`connect_function` | `"0"` | quoted integer | Specifies whether the database should allocate a Logon Sequence Number (LSN) for this session, or associate this session with an existing LSN. Specify `0` for a session with no LSN (the default). Specify `1` to allocate a new LSN for the session. Specify `2` to associate the session with the existing LSN identified by the `logon_sequence_number` connection parameter. The database only permits sessions for the same user to share an LSN. Equivalent to the Teradata JDBC Driver `CONNECT_FUNCTION` connection parameter.
-`connect_timeout` | `"10000"` | quoted integer | Specifies the timeout in milliseconds for establishing a TCP socket connection. Specify `0` for no timeout. The default is 10 seconds (10000 milliseconds).
-`cop` | `"true"` | quoted boolean | Specifies whether COP Discovery is performed. Equivalent to the Teradata JDBC Driver `COP` connection parameter.
-`coplast` | `"false"` | quoted boolean | Specifies how COP Discovery determines the last COP hostname. Equivalent to the Teradata JDBC Driver `COPLAST` connection parameter. When `coplast` is `false` or omitted, or COP Discovery is turned off, then no DNS lookup occurs for the coplast hostname. When `coplast` is `true`, and COP Discovery is turned on, then a DNS lookup occurs for a coplast hostname.
-`database` | | string | Specifies the initial database to use after logon, instead of the user's default database. Equivalent to the Teradata JDBC Driver `DATABASE` connection parameter.
-`dbs_port` | `"1025"` | quoted integer | Specifies the database port number. Equivalent to the Teradata JDBC Driver `DBS_PORT` connection parameter.
-`encryptdata` | `"false"` | quoted boolean | Controls encryption of data exchanged between the driver and the database. Equivalent to the Teradata JDBC Driver `ENCRYPTDATA` connection parameter.
-`error_query_count` | `"21"` | quoted integer | Specifies how many times the driver will attempt to query FastLoad Error Table 1 after a FastLoad operation. Equivalent to the Teradata JDBC Driver `ERROR_QUERY_COUNT` connection parameter.
-`error_query_interval` | `"500"` | quoted integer | Specifies how many milliseconds the driver will wait between attempts to query FastLoad Error Table 1. Equivalent to the Teradata JDBC Driver `ERROR_QUERY_INTERVAL` connection parameter.
-`error_table_1_suffix` | `"_ERR_1"` | string | Specifies the suffix for the name of FastLoad Error Table 1. Equivalent to the Teradata JDBC Driver `ERROR_TABLE_1_SUFFIX` connection parameter.
-`error_table_2_suffix` | `"_ERR_2"` | string | Specifies the suffix for the name of FastLoad Error Table 2. Equivalent to the Teradata JDBC Driver `ERROR_TABLE_2_SUFFIX` connection parameter.
-`error_table_database` | | string | Specifies the database name for the FastLoad error tables. By default, FastLoad error tables reside in the same database as the destination table being loaded. Equivalent to the Teradata JDBC Driver `ERROR_TABLE_DATABASE` connection parameter.
-`fake_result_sets` | `"false"` | quoted boolean | Controls whether a fake result set containing statement metadata precedes each real result set.
-`field_quote` | `"\""` | string | Specifies a single character string used to quote fields in a CSV file.
-`field_sep` | `","` | string | Specifies a single character string used to separate fields in a CSV file. Equivalent to the Teradata JDBC Driver `FIELD_SEP` connection parameter.
-`govern` | `"true"` | quoted boolean | Controls FastLoad and FastExport throttling by Teradata workload management rules. When set to `true` (the default), workload management rules may delay a FastLoad or FastExport. When set to `false`, workload management rules will reject rather than delay a FastLoad or FastExport. Equivalent to the Teradata JDBC Driver `GOVERN` connection parameter.
-`host` | | string | Specifies the database hostname.
-`http_proxy` | | string | Specifies the proxy server URL for HTTP connections to TLS certificate verification CRL and OCSP endpoints. The URL must begin with `http://` and must include a colon `:` and port number.
-`http_proxy_password` | | string | Specifies the proxy server password for the proxy server identified by the `http_proxy` parameter. This parameter may only be specified in conjunction with the `http_proxy` parameter. When this parameter is omitted, no proxy server password is provided to the proxy server identified by the `http_proxy` parameter.
-`http_proxy_user` | | string | Specifies the proxy server username for the proxy server identified by the `http_proxy` parameter. This parameter may only be specified in conjunction with the `http_proxy` parameter. When this parameter is omitted, no proxy server username is provided to the proxy server identified by the `http_proxy` parameter.
-`https_port` | `"443"` | quoted integer | Specifies the database port number for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver `HTTPS_PORT` connection parameter.
-`https_proxy` | | string | Specifies the proxy server URL for HTTPS/TLS connections to the database and to Identity Provider endpoints. The URL must begin with `http://` and must include a colon `:` and port number. The driver connects to the proxy server using a non-TLS HTTP connection, then uses the HTTP CONNECT method to establish an HTTPS/TLS connection to the destination. Equivalent to the Teradata JDBC Driver `HTTPS_PROXY` connection parameter.
-`https_proxy_password` | | string | Specifies the proxy server password for the proxy server identified by the `https_proxy` parameter. This parameter may only be specified in conjunction with the `https_proxy` parameter. When this parameter is omitted, no proxy server password is provided to the proxy server identified by the `https_proxy` parameter. Equivalent to the Teradata JDBC Driver `HTTPS_PROXY_PASSWORD` connection parameter.
-`https_proxy_user` | | string | Specifies the proxy server username for the proxy server identified by the `https_proxy` parameter. This parameter may only be specified in conjunction with the `https_proxy` parameter. When this parameter is omitted, no proxy server username is provided to the proxy server identified by the `https_proxy` parameter. Equivalent to the Teradata JDBC Driver `HTTPS_PROXY_USER` connection parameter.
-`jws_algorithm` | `"RS256"` | string | Specifies the JSON Web Signature (JWS) algorithm to sign the JWT Bearer Token for client authentication. Optional when `logmech` is `BEARER` and ignored for other `logmech` values. The default `RS256` is RSASSA-PKCS1-v1_5 using SHA-256. Specify `RS384` for RSASSA-PKCS1-v1_5 using SHA-384. Specify `RS512` for RSASSA-PKCS1-v1_5 using SHA-512. Equivalent to the Teradata JDBC Driver `JWS_ALGORITHM` connection parameter.
-`jws_cert` | | string | Specifies the file name of the X.509 certificate PEM file that contains the public key corresponding to the private key from `jws_private_key`. Optional when `logmech` is `BEARER` and ignored for other `logmech` values. When this parameter is specified, the "x5t" header thumbprint is added to the JWT Bearer Token for the Identity Provider to select the public key for JWT signature verification. Some Identity Providers, such as Microsoft Entra ID, require this. When this parameter is omitted, the "x5t" header thumbprint is not added to the JWT Bearer Token. Some Identity Providers do not require the "x5t" header thumbprint. Equivalent to the Teradata JDBC Driver `JWS_CERT` connection parameter.
-`jws_private_key` | | string | Specifies the file name of the PEM or JWK file containing the private key to sign the JWT Bearer Token for client authentication. Required when `logmech` is `BEARER` and ignored for other `logmech` values. PEM and JWK file formats are supported. The private key filename must end with the `.pem` or `.jwk` extension. A PEM file must contain the BEGIN/END PRIVATE KEY header and trailer. If a JWK file contains a "kid" (key identifier) parameter, the "kid" header is added to the JWT Bearer Token for the Identity Provider to select the public key for JWT signature verification. Equivalent to the Teradata JDBC Driver `JWS_PRIVATE_KEY` connection parameter.
-`lob_support` | `"true"` | quoted boolean | Controls LOB support. Equivalent to the Teradata JDBC Driver `LOB_SUPPORT` connection parameter.
-`log` | `"0"` | quoted integer | Controls debug logging. Somewhat equivalent to the Teradata JDBC Driver `LOG` connection parameter. This parameter's behavior is subject to change in the future. This parameter's value is currently defined as an integer in which the 1-bit governs function and method tracing, the 2-bit governs debug logging, the 4-bit governs transmit and receive message hex dumps, and the 8-bit governs timing. Compose the value by adding together 1, 2, 4, and/or 8.
-`logdata` | | string | Specifies extra data for the chosen logon authentication method. Equivalent to the Teradata JDBC Driver `LOGDATA` connection parameter.
-`logmech` | `"TD2"` | string | Specifies the logon authentication method. Equivalent to the Teradata JDBC Driver `LOGMECH` connection parameter. The database user must have the "logon with null password" permission for `KRB5` Single Sign On (SSO) or any of the [OpenID Connect (OIDC)](https://en.wikipedia.org/wiki/OpenID#OpenID_Connect_(OIDC)) methods `BEARER`, `BROWSER`, `CODE`, `CRED`, `JWT`, `ROPC`, or `SECRET`. [GSS-API](https://en.wikipedia.org/wiki/Generic_Security_Services_Application_Program_Interface) methods are `KRB5`, `LDAP`, `TD2`, and `TDNEGO`. Values are case-insensitive.
• `BEARER` uses OIDC Client Credentials Grant with JWT Bearer Token for client authentication.
• `BROWSER` uses Browser Authentication, supported for Windows and macOS.
• `CODE` uses OIDC Device Code Flow, also known as OIDC Device Authorization Grant.
• `CRED` uses OIDC Client Credentials Grant with client_secret_post for client authentication.
• `JWT` uses JSON Web Token.
• `KRB5` uses Kerberos V5.
• `LDAP` uses Lightweight Directory Access Protocol.
• `ROPC` uses OIDC Resource Owner Password Credentials (ROPC).
• `SECRET` uses OIDC Client Credentials Grant with client_secret_basic for client authentication.
• `TD2` uses Teradata Method 2.
• `TDNEGO` automatically selects an appropriate GSS-API logon authentication method. OIDC methods are not selected.
-`logon_sequence_number` | | quoted integer | Associates this session with an existing Logon Sequence Number (LSN) when `connect_function` is `2`. The database only permits sessions for the same user to share an LSN. An LSN groups multiple sessions together for workload management. Using an LSN is a three-step process. First, establish a control session with `connect_function` as `1`, which allocates a new LSN. Second, obtain the LSN from the control session using the escape function `{fn teradata_logon_sequence_number}`. Third, establish an associated session with `connect_function` as `2` and the logon sequence number. Equivalent to the Teradata JDBC Driver `LOGON_SEQUENCE_NUMBER` connection parameter.
-`logon_timeout` | `"0"` | quoted integer | Specifies the logon timeout in seconds. Zero means no timeout.
-`manage_error_tables` | `"true"` | quoted boolean | Controls whether the driver manages the FastLoad error tables.
-`max_message_body` | `"2097000"` | quoted integer | Specifies the maximum Response Message size in bytes. Equivalent to the Teradata JDBC Driver `MAX_MESSAGE_BODY` connection parameter.
-`oidc_clientid` | | string | Specifies the OpenID Connect (OIDC) Client ID to use for Browser Authentication and other OIDC methods. When omitted, the default Client ID comes from the database's TdgssUserConfigFile.xml file. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `OIDC_CLIENTID` connection parameter.
-`oidc_scope` | `"openid"` | string | Specifies the OpenID Connect (OIDC) scope to use for Browser Authentication. Beginning with Teradata Database 17.20.03.11, the default scope can be specified in the database's `TdgssUserConfigFile.xml` file, using the `IdPConfig` element's `Scope` attribute. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `OIDC_SCOPE` connection parameter.
-`oidc_sslmode` | | string | Specifies the mode for HTTPS connections to the Identity Provider. Equivalent to the Teradata JDBC Driver `OIDC_SSLMODE` connection parameter. Values are case-insensitive. When this parameter is omitted, the default is the value of the `sslmode` connection parameter.
• `ALLOW` does not perform certificate verification for HTTPS connections to the Identity Provider.
• `VERIFY-CA` verifies that the server certificate is valid and trusted.
• `VERIFY-FULL` verifies that the server certificate is valid and trusted, and verifies that the server certificate matches the Identity Provider hostname.
-`oidc_token` | `"access_token"` | string | Specifies the kind of OIDC token to use for Browser Authentication. Specify `id_token` to use the id_token instead of the access_token. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `OIDC_TOKEN` connection parameter.
-`partition` | `"DBC/SQL"` | string | Specifies the database partition. Equivalent to the Teradata JDBC Driver `PARTITION` connection parameter.
-`password` | | string | Specifies the database password. Equivalent to the Teradata JDBC Driver `PASSWORD` connection parameter.
-`proxy_bypass_hosts` | | string | Specifies a matching pattern for hostnames and addresses to bypass the proxy server identified by the `http_proxy` and/or `https_proxy` parameter. This parameter may only be specified in conjunction with the `http_proxy` and/or `https_proxy` parameter. Separate multiple hostnames and addresses with a vertical bar `\|` character. Specify an asterisk `*` as a wildcard character. When this parameter is omitted, the default pattern `localhost\|127.*\|[::1]` bypasses the proxy server identified by the `http_proxy` and/or `https_proxy` parameter for common variations of the loopback address. Equivalent to the Teradata JDBC Driver `PROXY_BYPASS_HOSTS` connection parameter.
-`request_timeout` | `"0"` | quoted integer | Specifies the timeout for executing each SQL request. Zero means no timeout.
-`runstartup` | `"false"` | quoted boolean | Controls whether the user's `STARTUP` SQL request is executed after logon. For more information, refer to [User STARTUP SQL Request](#UserStartup). Equivalent to the Teradata JDBC Driver `RUNSTARTUP` connection parameter.
-`sessions` | | quoted integer | Specifies the number of data transfer connections for FastLoad or FastExport. The default (recommended) lets the database choose the appropriate number of connections. Equivalent to the Teradata JDBC Driver `SESSIONS` connection parameter.
-`sip_support` | `"true"` | quoted boolean | Controls whether StatementInfo parcel is used. Equivalent to the Teradata JDBC Driver `SIP_SUPPORT` connection parameter.
-`sp_spl` | `"true"` | quoted boolean | Controls whether stored procedure source code is saved in the database when a SQL stored procedure is created. Equivalent to the Teradata JDBC Driver `SP_SPL` connection parameter.
-`sslca` | | string | Specifies the file name of a PEM file that contains Certificate Authority (CA) certificates for use with `sslmode` or `oidc_sslmode` values `VERIFY-CA` or `VERIFY-FULL`. Equivalent to the Teradata JDBC Driver `SSLCA` connection parameter.
-`sslcapath` | | string | Specifies a directory of PEM files that contain Certificate Authority (CA) certificates for use with `sslmode` or `oidc_sslmode` values `VERIFY-CA` or `VERIFY-FULL`. Only files with an extension of `.pem` are used. Other files in the specified directory are not used. Equivalent to the Teradata JDBC Driver `SSLCAPATH` connection parameter.
-`sslcipher` | | string | Specifies the TLS cipher for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver `SSLCIPHER` connection parameter.
-`sslcrc` | `"ALLOW"` | string | Controls TLS certificate revocation checking (CRC) for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver `SSLCRC` connection parameter. Values are case-insensitive.
• `ALLOW` performs CRC for `sslmode` or `oidc_sslmode` `VERIFY-CA` and `VERIFY-FULL`, and provides soft fail CRC for `VERIFY-CA` and `VERIFY-FULL` to ignore CRC communication failures.
• `PREFER` performs CRC for all HTTPS connections, and provides soft fail CRC for `VERIFY-CA` and `VERIFY-FULL` to ignore CRC communication failures.
• `REQUIRE` performs CRC for all HTTPS connections, and requires CRC for `VERIFY-CA` and `VERIFY-FULL`.
-`sslcrl` | `"true"` | quoted boolean | Controls the use of Certificate Revocation List (CRL) for TLS certificate revocation checking for HTTPS/TLS connections. Online Certificate Status Protocol (OCSP) is preferred over CRL, so CRL is used when OSCP is unavailable. Equivalent to the Teradata JDBC Driver `SSLCRL` connection parameter.
-`sslmode` | `"PREFER"` | string | Specifies the mode for connections to the database. Equivalent to the Teradata JDBC Driver `SSLMODE` connection parameter. Values are case-insensitive.
• `DISABLE` disables HTTPS/TLS connections and uses only non-TLS connections.
• `ALLOW` uses non-TLS connections unless the database requires HTTPS/TLS connections.
• `PREFER` uses HTTPS/TLS connections unless the database does not offer HTTPS/TLS connections.
• `REQUIRE` uses only HTTPS/TLS connections.
• `VERIFY-CA` uses only HTTPS/TLS connections and verifies that the server certificate is valid and trusted.
• `VERIFY-FULL` uses only HTTPS/TLS connections, verifies that the server certificate is valid and trusted, and verifies that the server certificate matches the database hostname.
-`sslocsp` | `"true"` | quoted boolean | Controls the use of Online Certificate Status Protocol (OCSP) for TLS certificate revocation checking for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver `SSLOCSP` connection parameter.
-`sslprotocol` | `"TLSv1.2"` | string | Specifies the TLS protocol for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver `SSLPROTOCOL` connection parameter.
-`teradata_values` | `"true"` | quoted boolean | Controls whether `str` or a more specific Python data type is used for certain result set column value types. Refer to the [Data Types](#DataTypes) table below for details.
-`tmode` | `"DEFAULT"` | string | Specifies the transaction mode. Equivalent to the Teradata JDBC Driver `TMODE` connection parameter. Possible values are `DEFAULT` (the default), `ANSI`, or `TERA`.
-`user` | | string | Specifies the database username. Equivalent to the Teradata JDBC Driver `USER` connection parameter.
+`account` | | string | Specifies the database account. Equivalent to the Teradata JDBC Driver `ACCOUNT` connection parameter.
+`browser` | | string | Specifies the command to open the browser for Browser Authentication when `logmech` is `BROWSER`. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `BROWSER` connection parameter.
The specified command must match the value of the `TERADATA_BROWSER` environment variable.
The specified command must include a placeholder token, literally specified as `PLACEHOLDER`, which the driver will replace with the Identity Provider authorization endpoint URL. The `PLACEHOLDER` token is case-sensitive and must be specified in uppercase.
• On Windows, the default command is `cmd /c start "title" "PLACEHOLDER"`. Windows command syntax requires the quoted title to precede the quoted URL.
• On macOS, the default command is `open PLACEHOLDER`. macOS command syntax does not allow the URL to be quoted.
The `TERADATA_BROWSER` environment variable is not required when this connection parameter is omitted on Windows or macOS.
+`browser_tab_timeout` | `"5"` | quoted integer | Specifies the number of seconds to wait before closing the browser tab after Browser Authentication is completed. The default is 5 seconds. The behavior is under the browser's control, and not all browsers support automatic closing of browser tabs. Typically, the tab used to log on will remain open indefinitely, but the second and subsequent tabs will be automatically closed. Specify `0` (zero) to close the tab immediately. Specify `-1` to turn off automatic closing of browser tabs. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `BROWSER_TAB_TIMEOUT` connection parameter.
+`browser_timeout` | `"180"` | quoted integer | Specifies the number of seconds that the driver will wait for Browser Authentication to complete. The default is 180 seconds (3 minutes). Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `BROWSER_TIMEOUT` connection parameter.
+`charset` | `"UTF8"` | string | Specifies the session character set. Possible values are `UTF8` (the default), `UTF16`, or `ASCII`. Values are case-insensitive. Equivalent to the Teradata JDBC Driver `CHARSET` connection parameter.
+`client_charset` | | string | Specifies the client character set. Required with session character set `ASCII` and possible values are `CP1252` or `CP1255`. Optional with session character set `UTF8` or `UTF16` and must match the session character set. Values are case-insensitive. Equivalent to the Teradata JDBC Driver `CLIENT_CHARSET` connection parameter.
+`code_append_file` | `"-out"` | string | Specifies how to display the verification URL and code. Optional when `logmech` is `CODE` and ignored for other `logmech` values. The default `-out` prints the verification URL and code to stdout. Specify `-err` to print the verification URL and code to stderr. Specify a file name to append the verification URL and code to an existing file or create a new file if the file does not exist. Equivalent to the Teradata JDBC Driver `CODE_APPEND_FILE` connection parameter.
+`column_name` | `"false"` | quoted boolean | Controls the behavior of cursor `.description` sequence `name` items. Equivalent to the Teradata JDBC Driver `COLUMN_NAME` connection parameter. False specifies that a cursor `.description` sequence `name` item provides the AS-clause name if available, or the column name if available, or the column title. True specifies that a cursor `.description` sequence `name` item provides the column name if available, but has no effect when StatementInfo parcel support is unavailable.
+`column_type` | `"false"` | quoted boolean | Controls the behavior of cursor `.description` sequence `name` items. False specifies that each name does not include the column type. True adds a tab character and column type suffix to each name, but has no effect when StatementInfo parcel support is unavailable.
+`concurrent_interval` | `"1000"` | quoted integer | Specifies the interval in milliseconds for Laddered Concurrent Connect (LCC) to wait before starting another concurrent connection attempt.
+`concurrent_limit` | `"3"` | quoted integer | Limits the number of concurrent connection attempts.
+`connect_failure_ttl` | `"0"` | quoted integer | Specifies the time-to-live in seconds to remember the most recent connection failure for each IP address/port combination. The driver subsequently skips connection attempts to that IP address/port for the duration of the time-to-live. The default value of zero disables this feature. The recommended value is half the database restart time. Equivalent to the Teradata JDBC Driver `CONNECT_FAILURE_TTL` connection parameter.
+`connect_function` | `"0"` | quoted integer | Specifies whether the database should allocate a Logon Sequence Number (LSN) for this session, or associate this session with an existing LSN. Specify `0` for a session with no LSN (the default). Specify `1` to allocate a new LSN for the session. Specify `2` to associate the session with the existing LSN identified by the `logon_sequence_number` connection parameter. The database only permits sessions for the same user to share an LSN. Equivalent to the Teradata JDBC Driver `CONNECT_FUNCTION` connection parameter.
+`connect_timeout` | `"10000"` | quoted integer | Specifies the timeout in milliseconds for establishing a TCP socket connection. Specify `0` for no timeout. The default is 10 seconds (10000 milliseconds).
+`cop` | `"true"` | quoted boolean | Specifies whether COP Discovery is performed. Equivalent to the Teradata JDBC Driver `COP` connection parameter.
+`coplast` | `"false"` | quoted boolean | Specifies how COP Discovery determines the last COP hostname. Equivalent to the Teradata JDBC Driver `COPLAST` connection parameter. When `coplast` is `false` or omitted, or COP Discovery is turned off, then no DNS lookup occurs for the coplast hostname. When `coplast` is `true`, and COP Discovery is turned on, then a DNS lookup occurs for a coplast hostname.
+`database` | | string | Specifies the initial database to use after logon, instead of the user's default database. Equivalent to the Teradata JDBC Driver `DATABASE` connection parameter.
+`dbs_port` | `"1025"` | quoted integer | Specifies the database port number. Equivalent to the Teradata JDBC Driver `DBS_PORT` connection parameter.
+`encryptdata` | `"false"` | quoted boolean | Controls encryption of data exchanged between the driver and the database. Equivalent to the Teradata JDBC Driver `ENCRYPTDATA` connection parameter.
+`error_query_count` | `"21"` | quoted integer | Specifies how many times the driver will attempt to query FastLoad Error Table 1 after a FastLoad operation. Equivalent to the Teradata JDBC Driver `ERROR_QUERY_COUNT` connection parameter.
+`error_query_interval` | `"500"` | quoted integer | Specifies how many milliseconds the driver will wait between attempts to query FastLoad Error Table 1. Equivalent to the Teradata JDBC Driver `ERROR_QUERY_INTERVAL` connection parameter.
+`error_table_1_suffix` | `"_ERR_1"` | string | Specifies the suffix for the name of FastLoad Error Table 1. Equivalent to the Teradata JDBC Driver `ERROR_TABLE_1_SUFFIX` connection parameter.
+`error_table_2_suffix` | `"_ERR_2"` | string | Specifies the suffix for the name of FastLoad Error Table 2. Equivalent to the Teradata JDBC Driver `ERROR_TABLE_2_SUFFIX` connection parameter.
+`error_table_database` | | string | Specifies the database name for the FastLoad error tables. By default, FastLoad error tables reside in the same database as the destination table being loaded. Equivalent to the Teradata JDBC Driver `ERROR_TABLE_DATABASE` connection parameter.
+`fake_result_sets` | `"false"` | quoted boolean | Controls whether a fake result set containing statement metadata precedes each real result set.
+`field_quote` | `"\""` | string | Specifies a single character string used to quote fields in a CSV file.
+`field_sep` | `","` | string | Specifies a single character string used to separate fields in a CSV file. Equivalent to the Teradata JDBC Driver `FIELD_SEP` connection parameter.
+`gateway_deadline` | `"50"` | quoted integer | Specifies the Gateway deadline in seconds. The driver automatically closes and re-establishes the database socket connection if the OpenID Connect (OIDC) flow takes longer than this. Should be smaller than the Gateway's denial-of-service protection timeout: `gtwcontrol` setting "connection timeout in seconds" with default 60 seconds. Equivalent to the Teradata JDBC Driver `GATEWAY_DEADLINE` connection parameter.
+`govern` | `"true"` | quoted boolean | Controls FastLoad and FastExport throttling by Teradata workload management rules. When set to `true` (the default), workload management rules may delay a FastLoad or FastExport. When set to `false`, workload management rules will reject rather than delay a FastLoad or FastExport. Equivalent to the Teradata JDBC Driver `GOVERN` connection parameter.
+`host` | | string | Specifies the database hostname.
+`http_proxy` | | string | Specifies the proxy server URL for HTTP connections to TLS certificate verification CRL and OCSP endpoints. The URL must begin with `http://` and must include a colon `:` and port number.
+`http_proxy_password` | | string | Specifies the proxy server password for the proxy server identified by the `http_proxy` parameter. This parameter may only be specified in conjunction with the `http_proxy` parameter. When this parameter is omitted, no proxy server password is provided to the proxy server identified by the `http_proxy` parameter.
+`http_proxy_user` | | string | Specifies the proxy server username for the proxy server identified by the `http_proxy` parameter. This parameter may only be specified in conjunction with the `http_proxy` parameter. When this parameter is omitted, no proxy server username is provided to the proxy server identified by the `http_proxy` parameter.
+`https_port` | `"443"` | quoted integer | Specifies the database port number for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver `HTTPS_PORT` connection parameter.
+`https_proxy` | | string | Specifies the proxy server URL for HTTPS/TLS connections to the database and to Identity Provider endpoints. The URL must begin with `http://` and must include a colon `:` and port number. The driver connects to the proxy server using a non-TLS HTTP connection, then uses the HTTP CONNECT method to establish an HTTPS/TLS connection to the destination. Equivalent to the Teradata JDBC Driver `HTTPS_PROXY` connection parameter.
+`https_proxy_password` | | string | Specifies the proxy server password for the proxy server identified by the `https_proxy` parameter. This parameter may only be specified in conjunction with the `https_proxy` parameter. When this parameter is omitted, no proxy server password is provided to the proxy server identified by the `https_proxy` parameter. Equivalent to the Teradata JDBC Driver `HTTPS_PROXY_PASSWORD` connection parameter.
+`https_proxy_user` | | string | Specifies the proxy server username for the proxy server identified by the `https_proxy` parameter. This parameter may only be specified in conjunction with the `https_proxy` parameter. When this parameter is omitted, no proxy server username is provided to the proxy server identified by the `https_proxy` parameter. Equivalent to the Teradata JDBC Driver `HTTPS_PROXY_USER` connection parameter.
+`https_retry` | `"2"` | quoted integer | Specifies the number of HTTPS connection retries for a single-node database. Specify `0` (zero) to turn off HTTPS connection retries. Equivalent to the Teradata JDBC Driver `HTTPS_RETRY` connection parameter.
+`jws_algorithm` | `"RS256"` | string | Specifies the JSON Web Signature (JWS) algorithm to sign the JWT Bearer Token for client authentication. Optional when `logmech` is `BEARER` and ignored for other `logmech` values. The default `RS256` is RSASSA-PKCS1-v1_5 using SHA-256. Specify `RS384` for RSASSA-PKCS1-v1_5 using SHA-384. Specify `RS512` for RSASSA-PKCS1-v1_5 using SHA-512. Equivalent to the Teradata JDBC Driver `JWS_ALGORITHM` connection parameter.
+`jws_audience` | | string | Specifies the JWT Bearer Token audience claim for client authentication. Optional when `logmech` is `BEARER` and ignored for other `logmech` values. The default is the Identity Provider token endpoint URL. Equivalent to the Teradata JDBC Driver `JWS_AUDIENCE` connection parameter.
+`jws_cert` | | string | Specifies the file name of the X.509 certificate PEM file that contains the public key corresponding to the private key from `jws_private_key`. Optional when `logmech` is `BEARER` and ignored for other `logmech` values. When this parameter is specified, the "x5t" header thumbprint is added to the JWT Bearer Token for the Identity Provider to select the public key for JWT signature verification. Some Identity Providers, such as Microsoft Entra ID, require this. When this parameter is omitted, the "x5t" header thumbprint is not added to the JWT Bearer Token. Some Identity Providers do not require the "x5t" header thumbprint. Equivalent to the Teradata JDBC Driver `JWS_CERT` connection parameter.
+`jws_private_key` | | string | Specifies the file name of the PEM or JWK file containing the private key to sign the JWT Bearer Token for client authentication. Required when `logmech` is `BEARER` and ignored for other `logmech` values. PEM and JWK file formats are supported. The private key filename must end with the `.pem` or `.jwk` extension. A PEM file must contain the BEGIN/END PRIVATE KEY header and trailer. If a JWK file contains a "kid" (key identifier) parameter, the "kid" header is added to the JWT Bearer Token for the Identity Provider to select the public key for JWT signature verification. Equivalent to the Teradata JDBC Driver `JWS_PRIVATE_KEY` connection parameter.
+`jws_private_key_password` | | string | Specifies the password to decrypt the encrypted private key PEM file specified by `jws_private_key`. Optional when `logmech` is `BEARER` and ignored for other `logmech` values. Only PEM files can be encrypted. This parameter must be omitted when `jws_private_key` specifies a JWK file. The PEM file must contain a PKCS #8 private key encrypted with AES-256-CBC. Equivalent to the Teradata JDBC Driver `JWS_PRIVATE_KEY_PASSWORD` connection parameter.
An encrypted private key file can be created with the OpenSSL command:
`openssl pkcs8 -topk8 -v2 aes-256-cbc -in` *KeyFile* `-out` *EncryptedKeyFile*
+`keepalive` | `"30"` | quoted integer | Specifies the application layer keep-alive interval in seconds. The default is 30 seconds. Specify `0` (zero) to turn off the application layer keep-alive feature. Equivalent to the Teradata JDBC Driver `KEEPALIVE` connection parameter.
+`lob_support` | `"true"` | quoted boolean | Controls LOB support. Equivalent to the Teradata JDBC Driver `LOB_SUPPORT` connection parameter.
+`local_catalog` | `"false"` | quoted boolean | Controls the catalog name of local objects in result set metadata and parameter metadata. When set to `true` and Virtual System Dictionary (VSD) is available, local objects have the `TD_LOCAL` catalog name. Otherwise, local objects have an empty string for catalog name. This parameter does not affect the catalog name of Open Table Format (OTF) objects, which always have DataLake name as catalog name. Equivalent to the Teradata JDBC Driver `LOCAL_CATALOG` connection parameter.
+`log` | `"0"` | quoted integer | Controls debug logging. Somewhat equivalent to the Teradata JDBC Driver `LOG` connection parameter. This parameter's behavior is subject to change in the future. This parameter's value is currently defined as an integer in which the 1-bit governs function and method tracing, the 2-bit governs debug logging, the 4-bit governs transmit and receive message hex dumps, and the 8-bit governs timing. Compose the value by adding together 1, 2, 4, and/or 8.
+`logdata` | | string | Specifies extra data for the chosen logon authentication method. Equivalent to the Teradata JDBC Driver `LOGDATA` connection parameter.
+`logmech` | `"TD2"` | string | Specifies the [logon authentication method](#LogonMethods). Equivalent to the Teradata JDBC Driver `LOGMECH` connection parameter. The database user must have the "logon with null password" permission for `KRB5` Single Sign On (SSO) or any of the [OpenID Connect (OIDC)](https://en.wikipedia.org/wiki/OpenID#OpenID_Connect_(OIDC)) methods `BEARER`, `BROWSER`, `CODE`, `CRED`, `JWT`, `ROPC`, or `SECRET`. [GSS-API](https://en.wikipedia.org/wiki/Generic_Security_Services_Application_Program_Interface) methods are `KRB5`, `LDAP`, `TD2`, and `TDNEGO`. Values are case-insensitive.
• `BEARER` uses OIDC Client Credentials Grant with JWT Bearer Token for client authentication.
• `BROWSER` uses Browser Authentication, supported for Windows and macOS.
• `CODE` uses OIDC Device Code Flow, also known as OIDC Device Authorization Grant.
• `CRED` uses OIDC Client Credentials Grant with client_secret_post for client authentication.
• `JWT` uses JSON Web Token.
• `KRB5` uses Kerberos V5.
• `LDAP` uses Lightweight Directory Access Protocol.
• `ROPC` uses OIDC Resource Owner Password Credentials (ROPC).
• `SECRET` uses OIDC Client Credentials Grant with client_secret_basic for client authentication.
• `TD2` uses Teradata Method 2.
• `TDNEGO` automatically selects an appropriate GSS-API logon authentication method. OIDC methods are not selected.
+`logon_sequence_number` | | quoted integer | Associates this session with an existing Logon Sequence Number (LSN) when `connect_function` is `2`. The database only permits sessions for the same user to share an LSN. An LSN groups multiple sessions together for workload management. Using an LSN is a three-step process. First, establish a control session with `connect_function` as `1`, which allocates a new LSN. Second, obtain the LSN from the control session using the escape function `{fn teradata_logon_sequence_number}`. Third, establish an associated session with `connect_function` as `2` and the logon sequence number. Equivalent to the Teradata JDBC Driver `LOGON_SEQUENCE_NUMBER` connection parameter.
+`logon_timeout` | `"0"` | quoted integer | Specifies the logon timeout in seconds. Zero means no timeout. Equivalent to the Teradata JDBC Driver `LOGON_TIMEOUT` connection parameter.
+`manage_error_tables` | `"true"` | quoted boolean | Controls whether the driver manages the FastLoad error tables. Equivalent to the Teradata JDBC Driver `MANAGE_ERROR_TABLES` connection parameter.
+`max_message_body` | `"2097000"` | quoted integer | Specifies the maximum Response Message size in bytes. Equivalent to the Teradata JDBC Driver `MAX_MESSAGE_BODY` connection parameter.
+`no_system_proxy` | | string | Controls how the driver uses the operating system proxy settings, supported for Windows. This parameter is ignored unless `use_system_proxy` is `true`. This parameter does not affect the `http_proxy` and `https_proxy` connection parameters, which take precedence over the operating system proxy settings. Values are case-insensitive. Equivalent to the Teradata JDBC Driver `NO_JAVA_PROXY` connection parameter.
• When `use_system_proxy` is `true` and this parameter is omitted, the operating system proxy settings are considered for all types of HTTPS and HTTP connections.
• `db+idp` prevents the driver from considering the operating system proxy settings for database and Identity Provider connections. The operating system proxy settings are still considered for TLS certificate revocation checking.
• `db` prevents the driver from considering the operating system proxy settings for database connections. The operating system proxy settings are still considered for Identity Provider connections and TLS certificate revocation checking.
• `idp` prevents the driver from considering the operating system proxy settings for Identity Provider connections. The operating system proxy settings are still considered for database connections and TLS certificate revocation checking.
+`oauth_level` | `"0"` | quoted integer | Controls Single Sign On (SSO) access to Open Table Format (OTF) catalog and storage instances. Equivalent to the Teradata JDBC Driver `OAUTH_LEVEL` connection parameter. If `redrive` is `1` or higher and the database supports Control Data, this specifies which tokens are transmitted to the database with each request, and the database may use the tokens for SSO access to OTF catalog and storage instances. If `redrive` is `0` or the database does not support Control Data, tokens are not transmitted to the database with each request, and tokens will not be available for SSO access to OTF.
• `0` (the default) disables sending tokens to the database.
• `1` sends the token from OIDC authentication to the database for each SQL request.
• `2` sends the OAuth tokens from `oauth_scopes` to the database for each SQL request.
• `3` sends the token from OIDC authentication and the OAuth tokens to the database for each SQL request.
+`oauth_scopes` | | string | Specifies one or more OAuth scopes for SSO access to OTF catalog and storage instances. Multiple scopes are separated by vertical bar `\|` characters. This parameter may only be used with OIDC logon mechanisms for individual users, not for service accounts. When this parameter is specified, after successful OIDC authentication, the driver obtains an additional access token from the Identity Provider for each specified scope. Each additional access token request uses the same OIDC parameters as the initial OIDC authentication; only the scope is varied. Equivalent to the Teradata JDBC Driver `OAUTH_SCOPES` connection parameter.
+`oidc_cache_size` | `"100"` | quoted integer | Specifies the maximum size of the OpenID Connect (OIDC) token cache for Browser Authentication and other OIDC methods. Equivalent to the Teradata JDBC Driver `OIDC_CACHE_SIZE` connection parameter.
+`oidc_claim` | `"email"` | string | Specifies the OpenID Connect (OIDC) claim to use for Browser Authentication and other OIDC methods. Equivalent to the Teradata JDBC Driver `OIDC_CLAIM` connection parameter.
+`oidc_clientid` | | string | Specifies the OpenID Connect (OIDC) Client ID to use for Browser Authentication and other OIDC methods. When omitted, the default Client ID comes from the database's TdgssUserConfigFile.xml file. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `OIDC_CLIENTID` connection parameter.
+`oidc_metadata` | | string | Specifies the Identity Provider metadata URL for OpenID Connect (OIDC). When this connection parameter is omitted, the default metadata URL is provided by the database. This connection parameter is a troubleshooting tool only, and is not intended for normal production usage. Equivalent to the Teradata JDBC Driver `OIDC_METADATA` connection parameter.
+`oidc_metadata_cache` | `"600"` | quoted integer | Specifies the lifetime in seconds for entries in the OpenID Connect (OIDC) Authorization Server metadata cache. Equivalent to the Teradata JDBC Driver `OIDC_METADATA_CACHE` connection parameter.
+`oidc_prompt` | | string | Specifies the OpenID Connect (OIDC) prompt value to use for Browser Authentication. Optional when `logmech` is `BROWSER` and ignored for other `logmech` values. Ignored unless `user` is specified as an OIDC login hint. Specify `login` for the Identity Provider to prompt the user for credentials. May not be supported by all Identity Providers. The browser tab may not close automatically after Browser Authentication is completed. Equivalent to the Teradata JDBC Driver `OIDC_PROMPT` connection parameter.
+`oidc_redirect_port` | `"0"` | string | Specifies the OIDC redirect port for Browser Authentication (Authorization Code Flow with PKCE). Optional when `logmech` is `BROWSER` and ignored for other `logmech` values. Omitting this parameter is recommended. The default port number `0` (zero) directs the driver to use an ephemeral port. [IETF RFC 8252 - OAuth 2.0 for Native Apps](https://datatracker.ietf.org/doc/html/rfc8252) section 7.3 dictates that an identity provider must allow any port number for the loopback IP redirect URI, to let clients obtain an available ephemeral port from the operating system. Only specify this parameter if your identity provider deviates from IETF RFC 8252 and requires a specific redirect port number. Specify a single port number or specify two port numbers separated by a hyphen as a port range (inclusive). Equivalent to the Teradata JDBC Driver `OIDC_REDIRECT_PORT` connection parameter.
+`oidc_refresh` | `"true"` | quoted boolean | Controls whether the driver uses an available refresh token to obtain a new token when the current token expires. Equivalent to the Teradata JDBC Driver `OIDC_REFRESH` connection parameter.
+`oidc_refresh_percent` | `"15"` | quoted integer | Specifies the OpenID Connect (OIDC) token minimum remaining lifetime percentage for the driver to reuse a token. The driver will replace a token when its remaining lifetime falls below this percentage. Equivalent to the Teradata JDBC Driver `OIDC_REFRESH_PERCENT` connection parameter.
• Default `15` reuses a token for the first 85% of its lifetime and replaces it when its remaining lifetime falls below 15%.
• Specify `0` to turn off preemptive replacement and use the entire token lifetime.
• Specify `100` to never reuse a token and always obtain a new token.
+`oidc_scope` | `"openid"` | string | Specifies the OpenID Connect (OIDC) scope to use for Browser Authentication. Beginning with Teradata Database 17.20.03.11, the default scope can be specified in the database's `TdgssUserConfigFile.xml` file, using the `IdPConfig` element's `Scope` attribute. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `OIDC_SCOPE` connection parameter.
+`oidc_sslmode` | | string | Specifies the mode for HTTPS connections to the Identity Provider. Equivalent to the Teradata JDBC Driver `OIDC_SSLMODE` connection parameter. Values are case-insensitive. When this parameter is omitted, the default is the value of the `sslmode` connection parameter.
• `ALLOW` does not perform certificate verification for HTTPS connections to the Identity Provider.
• `VERIFY-CA` verifies that the server certificate is valid and trusted.
• `VERIFY-FULL` verifies that the server certificate is valid and trusted, and verifies that the server certificate matches the Identity Provider hostname.
+`oidc_token` | `"access_token"` | string | Specifies the kind of OIDC token to use for Browser Authentication. Specify `id_token` to use the id_token instead of the access_token. Browser Authentication is supported for Windows and macOS. Equivalent to the Teradata JDBC Driver `OIDC_TOKEN` connection parameter.
+`partition` | `"DBC/SQL"` | string | Specifies the database partition. Equivalent to the Teradata JDBC Driver `PARTITION` connection parameter.
+`password` | | string | Specifies the database password. Equivalent to the Teradata JDBC Driver `PASSWORD` connection parameter.
+`proxy_bypass_hosts` | | string | Specifies a matching pattern for hostnames and addresses to bypass the proxy server identified by the `http_proxy` and/or `https_proxy` parameter. This parameter may only be specified in conjunction with the `http_proxy` and/or `https_proxy` parameter. Separate multiple hostnames and addresses with a vertical bar `\|` character. Specify an asterisk `*` as a wildcard character. When this parameter is omitted, the default pattern `localhost\|127.*\|[::1]` bypasses the proxy server identified by the `http_proxy` and/or `https_proxy` parameter for common variations of the loopback address. A destination matching this parameter is still subject to the operating system proxy settings when `use_system_proxy` is `true`, because this parameter only bypasses the proxy server identified by the `http_proxy` and/or `https_proxy` parameter. A destination matching the default pattern connects directly and is not subject to the operating system proxy settings. Equivalent to the Teradata JDBC Driver `PROXY_BYPASS_HOSTS` connection parameter.
+`reconnect_count` | | quoted integer | Enables [Session Reconnect](#SessionReconnect) and specifies the maximum number of times that the driver will attempt to reconnect the session. When `reconnect_count` is omitted, but Session Reconnect is otherwise enabled, the default is 11 attempts. Equivalent to the Teradata JDBC Driver `RECONNECT_COUNT` connection parameter.
+`reconnect_interval` | | quoted integer | Enables [Session Reconnect](#SessionReconnect) and specifies the number of seconds that the driver will wait between attempts to reconnect the session. When `reconnect_interval` is omitted, but Session Reconnect is otherwise enabled, the default is 30 seconds. Equivalent to the Teradata JDBC Driver `RECONNECT_INTERVAL` connection parameter.
+`redrive` | `"3"` | quoted integer | Enables [Session Reconnect](#SessionReconnect) and enables automatic redriving of SQL requests interrupted by database restart.
• `0` disables the use of Control Data, disables Recoverable Network Protocol (RNP), and disables automatic Redrive of SQL requests.
• `1` solicits the use of Control Data, but disables RNP, and disables automatic Redrive of SQL requests.
• `2` solicits the use of Control Data, solicits RNP, but disables automatic Redrive of SQL requests.
• `3` (the default) solicits the use of Control Data, solicits RNP, and specifies no preference with respect to automatic Redrive of SQL requests.
• `4` solicits the use of Control Data, solicits RNP, and solicits automatic Redrive of SQL requests.
The application is not guaranteed to receive the functionality that it solicits with the `redrive` connection parameter. The database determines whether the functionality is provided or not, depending on the database `dbscontrol` fields RedriveProtection (67), RedriveDefaultParticipation (68), and DisableRecoverableNetProtocol (77). Equivalent to the Teradata JDBC Driver `REDRIVE` connection parameter.
+`request_timeout` | `"0"` | quoted integer | Specifies the timeout in seconds for executing each SQL request. Zero means no timeout.
+`runstartup` | `"false"` | quoted boolean | Controls whether the user's `STARTUP` SQL request is executed after logon. For more information, refer to [User STARTUP SQL Request](#UserStartup). Equivalent to the Teradata JDBC Driver `RUNSTARTUP` connection parameter.
+`sessions` | | quoted integer | Specifies the number of data transfer connections for FastLoad or FastExport. The default (recommended) lets the database choose the appropriate number of connections. Equivalent to the Teradata JDBC Driver `SESSIONS` connection parameter.
+`sip_support` | `"true"` | quoted boolean | Controls whether StatementInfo parcel is used. Equivalent to the Teradata JDBC Driver `SIP_SUPPORT` connection parameter.
+`sp_spl` | `"true"` | quoted boolean | Controls whether stored procedure source code is saved in the database when a SQL stored procedure is created. Equivalent to the Teradata JDBC Driver `SP_SPL` connection parameter.
+`sslbase64` | | string | Specifies the base64url encoded contents of a PEM file that contains Certificate Authority (CA) certificates for use with `sslmode` or `oidc_sslmode` values `VERIFY-CA` or `VERIFY-FULL`. Equivalent to the Teradata JDBC Driver `SSLBASE64` connection parameter. The base64url encoded value must conform to [IETF RFC 4648 Section 5 - Base 64 Encoding with URL and Filename Safe Alphabet](https://datatracker.ietf.org/doc/html/rfc4648#section-5).
Example Linux command to print the base64url encoded contents of a PEM file:
`base64 -w0 < cert.pem \| tr +/ -_ \| tr -d =`
+`sslca` | | string | Specifies the file name of a PEM file that contains Certificate Authority (CA) certificates for use with `sslmode` or `oidc_sslmode` values `VERIFY-CA` or `VERIFY-FULL`. Equivalent to the Teradata JDBC Driver `SSLCA` connection parameter.
+`sslcapath` | | string | Specifies a directory of PEM files that contain Certificate Authority (CA) certificates for use with `sslmode` or `oidc_sslmode` values `VERIFY-CA` or `VERIFY-FULL`. Only files with an extension of `.pem` are used. Other files in the specified directory are not used. Equivalent to the Teradata JDBC Driver `SSLCAPATH` connection parameter.
+`sslcipher` | | string | Specifies the TLS cipher for HTTPS/TLS connections. Default lets database and driver choose the most appropriate TLS cipher. Omitting this parameter is recommended. Use this parameter only for troubleshooting TLS handshake issues. Equivalent to the Teradata JDBC Driver `SSLCIPHER` connection parameter.
+`sslcrc` | `"ALLOW"` | string | Controls TLS certificate revocation checking (CRC) for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver `SSLCRC` connection parameter. Values are case-insensitive.
• `DISABLE` never performs CRC, regardless of the `sslmode` or `oidc_sslmode` setting, including `VERIFY-CA` and `VERIFY-FULL`.
• `ALLOW` performs CRC for `sslmode` or `oidc_sslmode` `VERIFY-CA` and `VERIFY-FULL`, and provides soft fail CRC for `VERIFY-CA` and `VERIFY-FULL` to ignore CRC communication failures.
• `PREFER` performs CRC for all HTTPS connections, and provides soft fail CRC for `VERIFY-CA` and `VERIFY-FULL` to ignore CRC communication failures.
• `REQUIRE` performs CRC for all HTTPS connections, and requires CRC for `VERIFY-CA` and `VERIFY-FULL`.
+`sslcrl` | `"true"` | quoted boolean | Controls the use of Certificate Revocation List (CRL) for TLS certificate revocation checking for HTTPS/TLS connections. Online Certificate Status Protocol (OCSP) is preferred over CRL, so CRL is used when OSCP is unavailable. Equivalent to the Teradata JDBC Driver `SSLCRL` connection parameter.
+`sslmode` | `"PREFER"` | string | Specifies the mode for connections to the database. Equivalent to the Teradata JDBC Driver `SSLMODE` connection parameter. Values are case-insensitive.
• `DISABLE` disables HTTPS/TLS connections and uses only non-TLS connections.
• `ALLOW` uses non-TLS connections unless the database requires HTTPS/TLS connections.
• `PREFER` uses HTTPS/TLS connections unless the database does not offer HTTPS/TLS connections.
• `REQUIRE` uses only HTTPS/TLS connections.
• `VERIFY-CA` uses only HTTPS/TLS connections and verifies that the server certificate is valid and trusted.
• `VERIFY-FULL` uses only HTTPS/TLS connections, verifies that the server certificate is valid and trusted, and verifies that the server certificate matches the database hostname.
+`sslnamedgroups` | | string | Specifies the TLS key exchange named groups for HTTPS/TLS connections. Multiple named groups are separated by commas. Default lets database and driver choose the most appropriate named group. Omitting this parameter is recommended. Use this parameter only for troubleshooting TLS handshake issues. Equivalent to the Teradata JDBC Driver `SSLNAMEDGROUPS` connection parameter.
+`sslocsp` | `"true"` | quoted boolean | Controls the use of Online Certificate Status Protocol (OCSP) for TLS certificate revocation checking for HTTPS/TLS connections. Equivalent to the Teradata JDBC Driver `SSLOCSP` connection parameter.
+`sslprotocol` | `"TLSv1.2"` | string | Specifies the TLS protocol for HTTPS/TLS connections. Omitting this parameter is recommended. Use this parameter only for troubleshooting TLS handshake issues. Equivalent to the Teradata JDBC Driver `SSLPROTOCOL` connection parameter.
+`teradata_values` | `"true"` | quoted boolean | Controls whether `str` or a more specific Python data type is used for certain result set column value types. Refer to the [Data Types](#DataTypes) table below for details.
+`tmode` | `"DEFAULT"` | string | Specifies the [transaction mode](#TransactionMode). Equivalent to the Teradata JDBC Driver `TMODE` connection parameter. Possible values are `DEFAULT` (the default), `ANSI`, or `TERA`.
+`trusted_sql` | `"false"` | quoted boolean | Controls whether the driver distinguishes between trusted and untrusted SQL requests.
• `false` (the default) directs the database to reject any attempt to use the `SET QUERY_BAND` command to set or remove the current proxy user if the database user making the request was given `GRANT CONNECT THROUGH` rights `WITH TRUST_ONLY`.
• `true` directs the database to allow the `SET QUERY_BAND` command to set or remove the current proxy user. This capability can be disabled on a per-request basis by specifying the `{fn teradata_untrusted}` escape function in the SQL request.
This parameter is only effective for a database user having the `GRANT CONNECT THROUGH` privilege `WITH TRUST_ONLY`. Refer to [Trusted SQL and Query Band Impersonation](#TrustedSQL) for details. Equivalent to the Teradata JDBC Driver `TRUSTED_SQL` connection parameter.
+`type` | `"DEFAULT"` | string | Specifies whether the driver automatically tries FastLoad or FastExport for SQL requests executed by the application. Values are case-insensitive. Equivalent to the Teradata JDBC Driver `TYPE` connection parameter.
• `DEFAULT` does not automatically try FastLoad or FastExport for SQL requests. This is the default.
• `FASTLOAD` automatically tries FastLoad for SQL requests and falls back to SQL execution if the request is not eligible for FastLoad.
• `FASTEXPORT` automatically tries FastExport for SQL requests and falls back to SQL execution if the request is not eligible for FastExport.
This connection parameter is ignored for:
• Requests that specify a FastLoad or FastExport try/require escape function.
• Requests that specify the `teradata_agkr` escape function.
• Prepare-only requests.
• Requests executed by the driver itself.
+`use_system_proxy` | `"false"` | quoted boolean | Controls whether the driver uses the operating system proxy settings, supported for Windows. Somewhat equivalent to the Java system property `java.net.useSystemProxies`.
• `false` (the default) does not use the operating system proxy settings.
• `true` directs the driver to use the operating system proxy settings for HTTPS and HTTP connections, subject to the `no_system_proxy` connection parameter. The `http_proxy` and `https_proxy` connection parameters take precedence over the operating system proxy settings.
+`user` | | string | Specifies the database username. Equivalent to the Teradata JDBC Driver `USER` connection parameter.
+
+
+
+### FIPS Mode
+
+Platform | FIPS Mode | Description
+---------------------|-----------|---
+Windows | Automatic | Always uses [Microsoft Go](https://github.com/microsoft/go). Always uses [Windows Cryptography API: Next Generation (CNG)](https://learn.microsoft.com/en-us/windows/win32/seccng/cng-portal). Automatic FIPS mode based on Windows FIPS policy.
+macOS | Manual | Always uses [Microsoft Go](https://github.com/microsoft/go). Always uses macOS [CryptoKit](https://developer.apple.com/documentation/cryptokit). Enable FIPS mode with environment variable `GODEBUG=fips140=on`
+Linux x64 and ARM64 | Automatic | Uses [Microsoft Go](https://github.com/microsoft/go) and Linux `libcrypto.so` if Linux FIPS mode is enabled. Uses [standard Go](https://go.dev/dl/) if FIPS mode is disabled.
+Linux ppc64le | Manual | Always uses [standard Go](https://go.dev/dl/). Enable FIPS mode with environment variable `GODEBUG=fips140=on`
@@ -323,6 +391,53 @@ The driver masks connection failures to down COPs, thereby hiding most connectio
If COP Discovery is turned off, or no COP hostnames are defined in DNS, the driver connects directly to the hostname specified in the `host` connection parameter. This permits load distribution schemes other than the COP Discovery approach. For example, round-robin DNS or a TCP/IP load distribution product can be used. COP Discovery takes precedence over simple database hostname lookup. To use an alternative load distribution scheme, either ensure that no COP hostnames are defined in DNS, or turn off COP Discovery with `cop` as `false`.
+
+
+### Proxy Server Support
+
+The driver offers support for HTTP proxy servers.
+
+HTTP proxy servers can only handle HTTP or HTTPS connections and cannot handle non-HTTP connections, such as Teradata port 1025 connections.
+
+The following table lists each kind of network connection made by the driver, and indicates the available options for specifying a proxy server.
+
+Connection type | Proxy server support | Connection parameter
+------------------------------------------------------------------|----------------------|---
+HTTPS connections to database | Available | `https_proxy`
+Non-HTTPS connections to database | Not available |
+HTTPS connections to Identity Provider endpoints | Available | `https_proxy`
+HTTP connections for CRL and OCSP certificate revocation checking | Available | `http_proxy`
+
+On Windows, the driver can use the operating system proxy settings, including both automatic proxy setup and manual proxy setup.
+* When the `use_system_proxy` connection parameter is `true` and neither `http_proxy` nor `https_proxy` applies to a destination, the driver also considers the operating system proxy settings.
+* The `use_system_proxy` connection parameter is `false` by default, so the operating system proxy settings are not used unless `use_system_proxy` is `true`.
+* The `no_system_proxy` connection parameter prevents the driver from considering the operating system proxy settings for database and/or Identity Provider connections.
+
+The following table lists the expected behavior for every combination of the `use_system_proxy`, `no_system_proxy`, `http_proxy`, and `https_proxy` connection parameters.
+
+use_system_proxy | no_system_proxy | http_proxy | https_proxy | Behavior
+---------------- | --------------- | ---------- | ----------- | ---
+omitted or false | (ignored) | omitted | omitted | • No proxy used for any connection.
+omitted or false | (ignored) | specified | omitted | • Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`.
• No proxy used for HTTPS connections.
+omitted or false | (ignored) | omitted | specified | • No proxy used for HTTP connections.
• Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`.
+omitted or false | (ignored) | specified | specified | • Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`.
• Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`.
+true | omitted | omitted | omitted | • System proxy used for all HTTP and HTTPS connections.
+true | omitted | specified | omitted | • Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTP connections.
• System proxy used for HTTPS connections.
+true | omitted | omitted | specified | • System proxy used for HTTP connections.
• Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTPS connections.
+true | omitted | specified | specified | • Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTP connections.
• Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTPS connections.
+true | `db+idp` | omitted | omitted | • No proxy used for database and identity provider HTTPS connections.
• System proxy used for HTTP connections.
+true | `db+idp` | specified | omitted | • No proxy used for database and identity provider HTTPS connections.
• Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTP connections.
+true | `db+idp` | omitted | specified | • Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`, in which case no proxy used for database and identity provider HTTPS connections.
• System proxy used for HTTP connections.
+true | `db+idp` | specified | specified | • Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTP connections.
• Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`, in which case no proxy used for database and identity provider HTTPS connections.
+true | `db` | omitted | omitted | • No proxy used for database HTTPS connections.
• System proxy used for identity provider HTTPS connections.
• System proxy used for HTTP connections.
+true | `db` | specified | omitted | • No proxy used for database HTTPS connections.
• System proxy used for identity provider HTTPS connections.
• Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTP connections.
+true | `db` | omitted | specified | • Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`, in which case no proxy used for database HTTPS connections and system proxy used for identity provider HTTPS connections.
• System proxy used for HTTP connections.
+true | `db` | specified | specified | • Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTP connections.
• Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`, in which case no proxy used for database HTTPS connections and system proxy used for identity provider HTTPS connections.
+true | `idp` | omitted | omitted | • No proxy used for identity provider HTTPS connections.
• System proxy used for database HTTPS connections.
• System proxy used for HTTP connections.
+true | `idp` | specified | omitted | • No proxy used for identity provider HTTPS connections.
• System proxy used for database HTTPS connections.
• Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTP connections.
+true | `idp` | omitted | specified | • Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`, in which case no proxy used for identity provider HTTPS connections and system proxy used for database HTTPS connections.
• System proxy used for HTTP connections.
+true | `idp` | specified | specified | • Specified proxy used for HTTP connections unless excluded by `proxy_bypass_hosts`, in which case system proxy used for HTTP connections.
• Specified proxy used for HTTPS connections unless excluded by `proxy_bypass_hosts`, in which case no proxy used for identity provider HTTPS connections and system proxy used for database HTTPS connections.
+
### Stored Password Protection
@@ -334,6 +449,7 @@ Stored Password Protection enables an application to provide a connection passwo
An encrypted password may be specified in the following contexts:
* A login password specified as the `password` connection parameter.
* A login password specified within the `logdata` connection parameter.
+* A private key password specified as the `jws_private_key_password` connection parameter.
If the password, however specified, begins with the prefix `ENCRYPTED_PASSWORD(` then the specified password must follow this format:
@@ -511,15 +627,15 @@ The following table describes the logon authentication methods selected by the `
`logmech` | Description | Usage and Requirements
----------|-------------|---
-`BEARER` | OIDC Client Credentials Grant with JWT Bearer Token for client authentication | `user`, `password`, and `logdata` must all be omitted when using this method.
`jws_private_key` is required when using this method. `jws_cert` is also needed for Identity Providers that require an "x5t" header thumbprint.
`oidc_clientid` is commonly used to override the default Client ID when using this method.
`oidc_scope`, `oidc_token`, and `jws_algorithm` are optional parameters when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
-`BROWSER` | Browser Authentication, also known as OIDC Authorization Code Flow with Proof Key for Code Exchange (PKCE) | `user`, `password`, and `logdata` must all be omitted when using Browser Authentication.
`browser`, `browser_tab_timeout`, `browser_timeout`, `oidc_clientid`, `oidc_scope`, and `oidc_token` are optional parameters when using this method.
Browser Authentication is supported for Windows and macOS. Browser Authentication is not supported for other operating systems.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
-`CODE` | OIDC Device Code Flow, also known as OIDC Device Authorization Grant | `user`, `password`, and `logdata` must all be omitted when using this method.
`code_append_file`, `oidc_clientid`, `oidc_scope`, and `oidc_token` are optional parameters when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
-`CRED` | OIDC Client Credentials Grant with client_secret_post for client authentication | `user`, `password`, `oidc_clientid`, and `oidc_scope` must all be omitted when using this method.
`logdata` must contain the Client Credentials Grant request HTTP POST Form Data encoded as Content-Type application/x-www-form-urlencoded.
`oidc_token` is an optional parameter when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
-`JWT` | JSON Web Token (JWT) | `logdata` must contain `token=` followed by the JSON Web Token.
The database user must have the "logon with null password" permission.
Your application must obtain a valid JWT from a User Service that is accessible to your application. The database must be configured to trust JWTs issued by your User Service. These tasks are covered in the reference Teradata Vantage™ Security Administration.
+`BEARER` | OIDC Client Credentials Grant with JWT Bearer Token for client authentication | This method is intended for automated logon by service accounts.
`user`, `password`, `logdata`, and `oauth_scopes` must all be omitted when using this method.
`jws_private_key` is required when using this method. `jws_cert` is also needed for Identity Providers that require an "x5t" header thumbprint.
`oidc_clientid` is commonly used to override the default Client ID when using this method.
`oidc_claim`, `oidc_scope`, `oidc_token`, `jws_algorithm`, and `jws_audience` are optional parameters when using this method.
`jws_private_key_password` is required when the private key PEM file specified by `jws_private_key` is encrypted.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
+`BROWSER` | Browser Authentication, also known as OIDC Authorization Code Flow with Proof Key for Code Exchange (PKCE) | This method is intended for interactive logon by individual users.
`password` and `logdata` must be omitted when using this method.
`user` is optional when using this method. When `user` is specified, it is used as the OIDC login hint and it is included in the OIDC token cache key for token retrieval.
`browser`, `browser_tab_timeout`, `browser_timeout`, `oauth_scopes`, `oidc_claim`, `oidc_clientid`, `oidc_prompt`, `oidc_scope`, and `oidc_token` are optional parameters when using this method.
Browser Authentication is supported for Windows and macOS. Browser Authentication is not supported for other operating systems.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
+`CODE` | OIDC Device Code Flow, also known as OIDC Device Authorization Grant | This method is intended for interactive logon by individual users.
`password` and `logdata` must be omitted when using this method.
`user` is optional when using this method. When `user` is specified, it is used as the OIDC login hint and it is included in the OIDC token cache key for token retrieval.
`code_append_file`, `oauth_scopes`, `oidc_claim`, `oidc_clientid`, `oidc_scope`, and `oidc_token` are optional parameters when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
+`CRED` | OIDC Client Credentials Grant with client_secret_post for client authentication | This method is intended for automated logon by service accounts.
`user`, `password`, `oauth_scopes`, `oidc_clientid`, and `oidc_scope` must all be omitted when using this method.
`logdata` must contain the Client Credentials Grant request HTTP POST Form Data encoded as Content-Type application/x-www-form-urlencoded.
`oidc_claim` and `oidc_token` are optional parameters when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
+`JWT` | JSON Web Token (JWT) | `logdata` must contain `token=` followed by the JSON Web Token.
The database user must have the "logon with null password" permission.
Your application must obtain a valid JWT from an Identity Provider. The database must be configured to trust JWTs issued by your Identity Provider. These tasks are covered in the reference Teradata Vantage™ Security Administration.
`KRB5` | GSS-API Kerberos V5 | Requires a significant number of administration tasks on the machine that is running the driver.
For Kerberos Single Sign On (SSO), the database user must have the "logon with null password" permission.
`LDAP` | GSS-API Lightweight Directory Access Protocol (LDAP) | Requires a significant administration effort to set up the LDAP environment. These tasks are covered in the reference Teradata Vantage™ Security Administration.
Once they are complete, LDAP can be used without any additional work required on the machine that is running the driver.
-`ROPC` | OIDC Resource Owner Password Credentials (ROPC) | `logdata` must be omitted when using this method.
`user` and `password` are required when using this method.
`oidc_clientid`, `oidc_scope`, and `oidc_token` are optional parameters when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
-`SECRET` | OIDC Client Credentials Grant with client_secret_basic for client authentication | `user` and `password` must be omitted when using this method.
`logdata` must contain the client secret.
`oidc_clientid` is commonly used to override the default Client ID when using this method.
`oidc_scope` and `oidc_token` are optional parameters when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
+`ROPC` | OIDC Resource Owner Password Credentials (ROPC) | This method is intended for interactive logon by individual users.
`logdata` must be omitted when using this method.
`user` and `password` are required when using this method.
`oauth_scopes`, `oidc_claim`, `oidc_clientid`, `oidc_scope`, and `oidc_token` are optional parameters when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
+`SECRET` | OIDC Client Credentials Grant with client_secret_basic for client authentication | This method is intended for automated logon by service accounts.
`user`, `password`, and `oauth_scopes` must all be omitted when using this method.
`logdata` must contain the client secret.
`oidc_clientid` is commonly used to override the default Client ID when using this method.
`oidc_claim`, `oidc_scope`, and `oidc_token` are optional parameters when using this method.
The database user must have the "logon with null password" permission.
The database must be configured with Identity Provider information for Federated Authentication. These tasks are covered in the reference Teradata Vantage™ Security Administration.
`TD2` | GSS-API Teradata Method 2 | Does not require any special setup, and can be used immediately.
`TDNEGO` | GSS-API Teradata Negotiating Mechanism | Automatically selects an appropriate GSS-API logon authentication method. OIDC methods are not selected.
@@ -549,15 +665,125 @@ Client Attribute | Source | Description
`ClientOsName` | driver | The client operating system name
`ClientProcThreadId` | driver | The client process ID
`ClientVmName` | driver | Python runtime information
+`ClientSecProdGrp` | driver | Go crypto library version and native crypto API/library if in use
+`ClientCoordName` | driver | The proxy server hostname and port number when a proxy server is used for a database connection
+`ClientTerminalId` | driver | The proxy server hostname and port number when a proxy server is used for an Identity Provider
+`ClientSessionDesc` | driver | TLS cipher information is available in this column as a list of name=value pairs, each terminated by a semicolon. Individual values can be accessed using the `NVP` system function.
+ | `C` | Y/N indicates whether the `sslcipher` connection parameter was specified
+ | `D` | the database TLS cipher
+ | `I` | the Identity Provider TLS cipher
+`ClientSecProdUserId` | driver | TLS named group information is available in this column as a list of name=value pairs, each terminated by a semicolon. Individual values can be accessed using the `NVP` system function.
+ | `C` | Y/N indicates whether the `sslnamedgroup` connection parameter was specified
+ | `D` | the database TLS named group
+ | `I` | the Identity Provider TLS named group
`ClientTdHostName` | driver | The database hostname as specified by the application, without any COP suffix
`ClientCOPSuffixedHostName` | driver | The COP-suffixed database hostname chosen by the driver
`ServerIPAddrByClient` | driver | The database node's IP address, as determined by the driver
`ServerPortByClient` | driver | The destination port number of the TCP connection to the database node, as determined by the driver
-`ClientConfType` | driver | The confidentiality type, as determined by the driver
`V` - TLS used for encryption, with full certificate verification
`C` - TLS used for encryption, with Certificate Authority (CA) verification
`R` - TLS used for encryption, with no certificate verification
`E` - TLS was not attempted, and TDGSS used for encryption
`U` - TLS was not attempted, and TDGSS encryption depends on central administration
`F` - TLS was attempted, but the TLS handshake failed, so this is a fallback to using TDGSS for encryption
`H` - SSLMODE was set to PREFER, but a non-TLS connection was made, and TDGSS encryption depends on central administration
-`ServerConfType` | database | The confidentiality type, as determined by the database
`T` - TLS used for encryption
`E` - TDGSS used for encryption
`U` - Data transfer is unencrypted
+`ClientConfType` | driver | The confidentiality type, as determined by the driver
+ | `V` | TLS used for encryption, with full certificate verification
+ | `C` | TLS used for encryption, with Certificate Authority (CA) verification
+ | `R` | TLS used for encryption, with no certificate verification
+ | `E` | TLS was not attempted, and TDGSS used for encryption
+ | `U` | TLS was not attempted, and TDGSS encryption depends on central administration
+ | `F` | TLS was attempted, but the TLS handshake failed, so this is a fallback to using TDGSS for encryption
+ | `H` | SSLMODE was set to PREFER, but a non-TLS connection was made, and TDGSS encryption depends on central administration
+`ServerConfType` | database | The confidentiality type, as determined by the database
+ | `T` | TLS used for encryption
+ | `E` | TDGSS used for encryption
+ | `U` | Data transfer is unencrypted
`ClientConfVersion` | database | The TLS version as determined by the database, if this is an HTTPS/TLS connection
`ClientConfCipherSuite` | database | The TLS cipher as determined by the database, if this is an HTTPS/TLS connection
-`ClientAttributesEx` | driver | Additional Client Attributes are available in this column as a list of name=value pairs, each terminated by a semicolon. Individual values can be accessed using the `NVP` system function.
`PYTHON` - The Python version
`TZ` - The Python current time zone
`GO` - The Go version
`SCS` - The session character set
`CCS` - The client character set
`LOB` - Y/N indicator for LOB support
`SIP` - Y/N indicator for StatementInfo parcel support
`TM` - The transaction mode indicator A (ANSI) or T (TERA)
`ENC` - Y/N indicator for `encryptdata` connection parameter
`DP` - The `dbs_port` connection parameter
`HP` - The `https_port` connection parameter
`OSL` - Numeric level corresponding to `oidc_sslmode`
`OSM` - The `oidc_sslmode` connection parameter
`SSL` - Numeric level corresponding to `sslmode`
`SSLM` - The `sslmode` connection parameter
`CRC` - The `sslcrc` connection parameter
`OCSP` - Y/N indicator for `sslocsp` connection parameter
`CRL` - Y/N indicator for `sslcrl` connection parameter
`CERT` - The database TLS certificate status
`BA` - Y/N indicator for Browser Authentication
`LM` - The logon authentication method
`JWS` - The JSON Web Signature (JWS) algorithm
`JH` - JWT header parameters to identify signature key
`IDPC` - The Identity Provider TLS certificate status
The `CERT` and `IDPC` attributes indicate the TLS certificate status of an HTTPS/TLS connection. When the attribute indicates the TLS certificate is valid (`V`) or invalid (`I`), then additional TLS certificate status details are provided as a series of comma-separated two-letter codes.
`U` - the TLS certificate status is unavailable
`V` - the TLS certificate status is valid
`I` - the TLS certificate status is invalid
`PU` - sslca PEM file is unavailable for server certificate verification
`PA` - server certificate was verified using sslca PEM file
`PR` - server certificate was rejected using sslca PEM file
`DU` - sslcapath PEM directory is unavailable for server certificate verification
`DA` - server certificate was verified using sslcapath PEM directory
`DR` - server certificate was rejected using sslcapath PEM directory
`TA` - server certificate was verified by the system
`TR` - server certificate was rejected by the system
`CY` - server certificate passed VERIFY-CA check
`CN` - server certificate failed VERIFY-CA check
`HU` - server hostname is unavailable for server certificate matching, because database IP address was specified
`HY` - server hostname matches server certificate
`HN` - server hostname does not match server certificate
`RU` - resolved server hostname is unavailable for server certificate matching, because database IP address was specified
`RY` - resolved server hostname matches server certificate
`RN` - resolved server hostname does not match server certificate
`IY` - IP address matches server certificate
`IN` - IP address does not match server certificate
`FY` - server certificate passed VERIFY-FULL check
`FN` - server certificate failed VERIFY-FULL check
`SU` - certificate revocation check status is unavailable
`SG` - certificate revocation check status is good
`SR` - certificate revocation check status is revoked
+`ClientEnvName` | driver | The OIDC metadata URL for a connection using an OIDC logon authentication mechanism
+`ClientJobId` | driver | The OIDC client ID for a connection using an OIDC logon authentication mechanism
+`ClientJobName` | driver | The OIDC scope for a connection using an OIDC logon authentication mechanism
+`ClientJobData` | driver | The OIDC login hint for a connection using an OIDC logon authentication mechanism
+`ClientUserOperId` | driver | The OIDC token kind, OIDC claim name, and claim value for a connection using an OIDC logon authentication mechanism
+`ClientWorkload` | driver | The scopes for acquired OAuth tokens, separated by vertical bar `\|` characters
+`ClientAttributesEx` | driver | Additional Client Attributes are available in the `ClientAttributesEx` column as a list of name=value pairs, each terminated by a semicolon. Individual values can be accessed using the `NVP` system function.
+ | `AS` | the application connection's endpoint session number
+ | `BA` | Y/N indicator for Browser Authentication
+ | `CCS` | the client character set
+ | `CERT` | the database TLS certificate status (see [table below](#CertStatus))
+ | `CF` | the `connect_function` connection parameter
+ | `CRC` | the `sslcrc` connection parameter
+ | `CRL` | Y/N indicator for `sslcrl` connection parameter
+ | `CS` | the control session's endpoint session number
+ | `DL` | this connection's database logon sequence number
+ | `DP` | the `dbs_port` connection parameter
+ | `EL` | this connection's endpoint logon sequence number
+ | `ENC` | Y/N indicator for `encryptdata` connection parameter
+ | `ES` | endpoint session number if connected to an endpoint such as Unity, Session Manager, or Business Continuity Manager; database session number otherwise
+ | `FIPS` | Y/N indicator for FIPS mode
+ | `GD` | the Go distribution M ([Microsoft Go](https://github.com/microsoft/go)) or S ([standard Go](https://go.dev/dl/))
+ | `GO` | the Go version
+ | `GOV` | the `govern` connection parameter
+ | `HP` | the `https_port` connection parameter
+ | `HR` | the `https_retry` connection parameter and number of HTTPS retries
+ | `IDPC` | the Identity Provider TLS certificate status (see [table below](#CertStatus))
+ | `JH` | JWT header parameters to identify signature key
+ | `JWS` | the JSON Web Signature (JWS) algorithm
+ | `LM` | the logon authentication method
+ | `LOB` | Y/N indicator for LOB support
+ | `OA` | the `oauth_level` connection parameter
+ | `OAC` | sequence of comma-separated OAuth token reuse counts
+ | `OAR` | sequence of Y/N values to indicate OAuth refresh token availability
+ | `OC` | OIDC token cache status O (off) M (miss) H (hit) X (expired)
+ | `OCSP` | Y/N indicator for `sslocsp` connection parameter
+ | `OSL` | Numeric level corresponding to `oidc_sslmode`
+ | `OSM` | the `oidc_sslmode` connection parameter
+ | `PART` | the `partition` connection parameter
+ | `PYTHON` | the Python version
+ | `RP` | the OIDC redirect port number for Browser Authentication, prefix E indicates ephemeral port
+ | `RT` | Y/N indicator for OIDC refresh token available
+ | `SC` | socket connect attempts and failures
+ | `SCS` | the session character set
+ | `SIP` | Y/N indicator for StatementInfo parcel support
+ | `SSL` | Numeric level corresponding to `sslmode`
+ | `SSLM` | the `sslmode` connection parameter
+ | `SSLP` | the `sslprotocol` connection parameter
+ | `TC` | OIDC token reuse count
+ | `TM` | the transaction mode indicator A (ANSI) or T (TERA)
+ | `TT` | OIDC token time-to-live in seconds
+ | `TVD` | the database TLS protocol version
+ | `TVI` | the Identity Provider TLS protocol version
+ | `TZ` | the current time zone
+
+
+
+The `CERT` and `IDPC` attributes indicate the TLS certificate status of an HTTPS/TLS connection. When the attribute indicates the TLS certificate is valid (`V`) or invalid (`I`), then additional TLS certificate status details are provided as a series of comma-separated two-letter codes.
+
+Code | Description
+-----|---
+`U` | the TLS certificate status is unavailable
+`V` | the TLS certificate status is valid
+`I` | the TLS certificate status is invalid
+`BU` | sslbase64 is unavailable for server certificate verification
+`BA` | server certificate was accepted by sslbase64
+`BR` | server certificate was rejected by sslbase64
+`PU` | sslca PEM file is unavailable for server certificate verification
+`PA` | server certificate was verified using sslca PEM file
+`PR` | server certificate was rejected using sslca PEM file
+`DU` | sslcapath PEM directory is unavailable for server certificate verification
+`DA` | server certificate was verified using sslcapath PEM directory
+`DR` | server certificate was rejected using sslcapath PEM directory
+`TA` | server certificate was verified by the system
+`TR` | server certificate was rejected by the system
+`CY` | server certificate passed VERIFY-CA check
+`CN` | server certificate failed VERIFY-CA check
+`HU` | server hostname is unavailable for server certificate matching, because database IP address was specified
+`HY` | server hostname matches server certificate
+`HN` | server hostname does not match server certificate
+`RU` | resolved server hostname is unavailable for server certificate matching, because database IP address was specified
+`RY` | resolved server hostname matches server certificate
+`RN` | resolved server hostname does not match server certificate
+`IY` | IP address matches server certificate
+`IN` | IP address does not match server certificate
+`FY` | server certificate passed VERIFY-FULL check
+`FN` | server certificate failed VERIFY-FULL check
+`SU` | certificate revocation check status is unavailable
+`SG` | certificate revocation check status is good
+`SR` | certificate revocation check status is revoked
#### LogonSource Column
@@ -602,14 +828,53 @@ For example, the following command sets a `STARTUP` SQL request for user `susan`
The driver's `runstartup` connection parameter must be `true` to execute the user's `STARTUP` SQL request after logon. The default for `runstartup` is `false`. If the `runstartup` connection parameter is omitted or `false`, then the user's `STARTUP` SQL request will not be executed.
+
+
+### Session Reconnect
+
+Your application's connection can be disconnected from the database session in various ways outside the control of the driver, such as
+* a network cable being unplugged
+* a network communication failure
+* an administrator terminating the session with the Monitor partition command `Abort Session`
+* an administrator terminating the session with the Gateway command `Kill Session`
+* a database restart
+
+When Session Reconnect is enabled, the driver will attempt to reconnect the connection to the database session after a communication failure.
+
+Session Reconnect is enabled when one or more of the following conditions are satisfied:
+* Recoverable Network Protocol is in effect
+* and/or connection parameter `reconnect_count` is specified (if omitted, the default is 11 attempts)
+* and/or connection parameter `reconnect_interval` is specified (if omitted, the default is 30 seconds)
+
+| Maximum possible elapsed time for reconnect attempts
+| ---
+| (*ReconnectCount* - 1) × *ReconnectInterval*
+
+Recoverable Network Protocol (RNP) and Redrive are enabled through a combination of database and driver connection parameters; specifically, the database `dbscontrol` fields `RedriveProtection` (67), `RedriveDefaultParticipation` (68), and `DisableRecoverableNetProtocol` (77), and the driver connection parameter `redrive` with level 2 or higher.
+* When RNP and Redrive are enabled, then Session Reconnect works for a variety of failure events, including transient network failures.
+* Without Recoverable Network Protocol, Session Reconnect only supports reconnection after a database restart; it does not support reconnection after other events, such as transient network failures.
+
+Session Reconnect | RNP and Redrive | Communication failure handling
+----------------- | --------------- | ---
+Disabled | Disabled | The operation in progress fails, the driver closes the connection and returns an error to the application.
+Enabled | Disabled | The operation in progress fails, the driver attempts to reconnect and returns an error to the application.
If the reconnect is unsuccessful, the driver closes the connection.
If the reconnect is successful, the database discards a significant part of the session state:
• The current transaction is rolled back.
• All open result sets are discarded.
• All volatile tables are discarded.
• All materialized global temp tables are discarded.
The application must be prepared to accommodate the possible loss of session state at any point in time.
+Enabled | Enabled | The operation in progress fails and the driver attempts to reconnect.
If the reconnect is unsuccessful, the driver closes the connection.
If the reconnect is successful, the operation is redriven automatically, the session's state is preserved, and no error is returned to the application.
+
+Reconnect is never attempted if a communication failure occurs while the application is closing the connection.
+
+The database enforces a limited time period for reconnecting to a session after a database restart. The amount of time is set using the database administrator program `gtwcontrol`. The standard value is 20 minutes. The database will reject all reconnect attempts after the time period expires.
+
### Transaction Mode
The `tmode` connection parameter enables an application to specify the transaction mode for the connection.
-* `"tmode":"ANSI"` provides American National Standards Institute (ANSI) transaction semantics. This mode is recommended.
-* `"tmode":"TERA"` provides legacy Teradata transaction semantics. This mode is only recommended for legacy applications that require Teradata transaction semantics.
-* `"tmode":"DEFAULT"` provides the default transaction mode configured for the database, which may be either ANSI or TERA mode. `"tmode":"DEFAULT"` is the default when the `tmode` connection parameter is omitted.
+
+`tmode` | Description
+--------- | ---
+`ANSI` | Provides American National Standards Institute (ANSI) transaction semantics. This mode is recommended.
+`TERA` | Provides legacy Teradata transaction semantics. This mode is only recommended for legacy applications that require Teradata transaction semantics.
+`DEFAULT` | Provides the default transaction mode configured for the database, which may be either ANSI or TERA mode. This is the default when the `tmode` connection parameter is omitted.
While ANSI mode is generally recommended, please note that every application is different, and some applications may need to use TERA mode. The following differences between ANSI and TERA mode might affect a typical user or application:
1. Silent truncation of inserted data occurs in TERA mode, but not ANSI mode. In ANSI mode, the database returns an error instead of truncating data.
@@ -679,6 +944,41 @@ Please note that neither previous example shows best practices. Best practices r
cur.execute("insert into mytable2 values(3, 4)")
con.commit()
+
+
+### Trusted SQL and Query Band Impersonation
+
+Trusted Sessions Enhanced Security prevents using `SET QUERY_BAND` to set or remove the current proxy user. This is accomplished by categorizing all SQL requests as trusted or untrusted.
+* An untrusted SQL request is a SQL request from a user that might contain a [SQL injection](https://en.wikipedia.org/wiki/SQL_injection) attempt.
+* A trusted SQL request is a SQL request composed by the application itself and known to be free of any SQL injection.
+
+This feature is intended for use by applications working with both trusted and untrusted SQL requests. This feature is not intended for applications that compose and trust all their own SQL requests.
+
+Consider an application server, such as a Model Context Protocol (MCP) server, that logs on with a service account that represents the application. Because every connection specifies the same service account, the connections benefit from connection pooling.
+
+The application server executes SQL requests on behalf of end users, and those SQL requests must be restricted to the access rights of the end user, not the access rights of the service account. Before executing a SQL request on behalf of a user, the application server executes `SET QUERY_BAND='PROXYUSER=enduser;' FOR SESSION`. This limits the access rights of the SQL requests that follow to the access rights of the end user.
+
+An end user's SQL request must not change the proxy user. To ensure this:
+1. All `GRANT CONNECT THROUGH` grants for the application use the `WITH TRUST_ONLY` option.
+2. The application specifies the `trusted_sql=true` connection parameter and logs on to the database with a service account.
+3. Before executing SQL requests on behalf of a user, the application impersonates the user by executing `SET QUERY_BAND` to set a proxy user. The application does not execute the SQL request if the impersonation fails.
+4. The application prepends the `{fn teradata_untrusted}` escape function to all user input SQL text before the application passes the SQL request to the driver.
+5. After executing SQL requests on behalf of a user, the application stops impersonating the user by executing `SET QUERY_BAND` to remove the proxy user.
+
+This `{fn teradata_untrusted}` escape function downgrades a SQL request from trusted to untrusted. No mechanism is provided to upgrade a SQL request from untrusted to trusted because it might be exploited by a SQL injection attack.
+
+If the service account has `GRANT CONNECT THROUGH` privilege `WITH TRUST_ONLY`, the database allows a `SET QUERY_BAND` request to set or remove a proxy user only if the request is trusted. The application composes `SET QUERY_BAND` requests to impersonate and stop impersonating users, and does not specify `{fn teradata_untrusted}` for those SQL requests.
+* A SQL request is trusted when the `trusted_sql` connection parameter is `true` and the request does not include the `{fn teradata_untrusted}` escape function.
+* Otherwise, the database rejects the request with Error 9264 "SET QUERY_BAND not permitted".
+
+For example:
+
+ con = teradatasql.connect(host="whomooz", user="mcpservice", password="please", trusted_sql="true")
+ cur = con.cursor()
+ cur.execute("SET QUERY_BAND='PROXYUSER=susan;' FOR SESSION") # trusted request begins impersonating the proxy user
+ cur.execute("{fn teradata_untrusted}SELECT * FROM mytable") # untrusted request runs as the proxy user
+ cur.execute("SET QUERY_BAND=NONE FOR SESSION") # trusted request stops impersonating the proxy user
+
### Data Types
@@ -739,6 +1039,7 @@ Bind-value Python data type | Database data type
`decimal.Decimal` | `NUMBER`
`float` | `FLOAT`
`int` | `BIGINT`
+`numpy.ndarray` (one-dimensional) | `VARCHAR` format compatible with `VECTOR`
`str` | `VARCHAR`
Transforms are used for SQL `ARRAY` data values, and they can be transferred to and from the database as `VARCHAR` values.
@@ -769,7 +1070,7 @@ To avoid database error 3532 in this situation, your application must use the th
### Character Export Width
-The driver always uses the UTF8 session character set, and the `charset` connection parameter is not supported. Be aware of the database's *Character Export Width* behavior that adds trailing space padding to fixed-width `CHAR` data type result set column values when using the UTF8 session character set.
+Be aware of the database's *Character Export Width* behavior that adds trailing space padding to fixed-width `CHAR` data type result set column values when using the UTF8 session character set.
The database `CHAR(`_n_`)` data type is a fixed-width data type (holding _n_ characters), and the database reserves a fixed number of bytes for the `CHAR(`_n_`)` data type in response spools and in network message traffic.
@@ -777,11 +1078,13 @@ UTF8 is a variable-width character encoding scheme that requires a varying numbe
Work around this drawback by using `CAST` or `TRIM` in SQL `SELECT` statements, or in views, to convert fixed-width `CHAR` data types to `VARCHAR`.
+Alternatively, the UTF16 session character set can be used by applications that require fixed-width CHAR data values without trailing space padding.
+
Given a table with fixed-width `CHAR` columns:
`CREATE TABLE MyTable (c1 CHAR(10), c2 CHAR(10))`
-Original query that produces trailing space padding:
+Original query that produces trailing space padding with the UTF8 session character set:
`SELECT c1, c2 FROM MyTable`
@@ -811,6 +1114,16 @@ When a combination of parameters are specified, connection parameters specified
---
+`teradatasql.factory(` *JSONConnectionString* `,` *Parameters...* `)`
+
+Creates and returns a connection factory function. Subsequently call the connection factory function with no arguments to obtain a Connection object.
+
+The first parameter is an optional JSON string that defaults to `None`. The second and subsequent arguments are optional `kwargs`. Specify connection parameters as a JSON string, as `kwargs`, or a combination of the two.
+
+When a combination of parameters are specified, connection parameters specified as `kwargs` take precedence over same-named connection parameters specified in the JSON string.
+
+---
+
`teradatasql.Date(` *Year* `,` *Month* `,` *Day* `)`
Creates and returns a `datetime.date` value.
@@ -929,6 +1242,14 @@ Creates and returns a new Cursor object for the Connection.
---
+`.nativeSQL(` *SQLRequest* `)`
+
+Returns the specified SQL request text after conversion to native Teradata SQL. Equivalent to the JDBC API `Connection.nativeSQL` method.
+
+The `{fn teradata_nativesql}` escape clause is automatically prepended to the SQL request before processing.
+
+---
+
`.rollback()`
Rolls back the current transaction.
@@ -1012,7 +1333,9 @@ Closes the Cursor.
`.execute(` *SQLRequest* `,` *OptionalSequenceOfParameterValues* `, ignoreErrors=` *OptionalSequenceOfIgnoredErrorCodes* `)`
Executes the SQL request.
-If a sequence of parameter values is provided as the second argument, the values will be bound to question-mark parameter markers in the SQL request. Specifying parameter values as a mapping is not supported.
+If a sequence of parameter values is provided as the second argument, the values will be bound to question-mark parameter markers in the SQL request.
+Parameter values may also be specified as a pandas DataFrame.
+Specifying parameter values as a mapping is not supported.
The `ignoreErrors` parameter is optional. The ignored error codes must be specified as a sequence of integers.
@@ -1021,7 +1344,9 @@ The `ignoreErrors` parameter is optional. The ignored error codes must be specif
`.executemany(` *SQLRequest* `,` *SequenceOfSequencesOfParameterValues* `, ignoreErrors=` *OptionalSequenceOfIgnoredErrorCodes* `)`
Executes the SQL request as an iterated SQL request for the batch of parameter values.
-The batch of parameter values must be specified as a sequence of sequences. Specifying parameter values as a mapping is not supported.
+The batch of parameter values must be specified as a sequence of sequences.
+Parameter values may also be specified as a pandas DataFrame.
+Specifying parameter values as a mapping is not supported.
The `ignoreErrors` parameter is optional. The ignored error codes must be specified as a sequence of integers.
@@ -1123,6 +1448,8 @@ For timestamp literal escape clauses, the decimal point and fractional digits ma
Scalar function escape clauses are replaced by the corresponding SQL expression before the SQL request text is transmitted to the database.
+
+
Numeric Function | Returns
-------------------------------------- | ---
`{fn ABS(`*number*`)}` | Absolute value of *number*
@@ -1150,6 +1477,8 @@ Numeric Function | Returns
`{fn TAN(`*float*`)}` | Tangent of *float* radians
`{fn TRUNCATE(`*number*`,`*places*`)}` | *number* truncated to *places*
+
+
String Function | Returns
-------------------------------------------------------------- | ---
`{fn ASCII(`*string*`)}` | ASCII code of the first character in *string*
@@ -1175,12 +1504,16 @@ String Function | Returns
`{fn SUBSTRING(`*string*`,`*position*`,`*length*`)}` | The *length*-character segment of *string* at *position*
`{fn UCASE(`*string*`)}` | String formed by replacing all lowercase characters in *string* with their uppercase equivalents
+
+
System Function | Returns
--------------------------------------- | ---
`{fn DATABASE()}` | Current default database name
`{fn IFNULL(`*expression*`,`*value*`)}` | *expression* if *expression* is not NULL, or *value* if *expression* is NULL
`{fn USER()}` | Logon user name, which may differ from the current authorized user name after `SET QUERY_BAND` sets a proxy user
+
+
Time/Date Function | Returns
------------------------------------------------------------------ | ---
`{fn CURDATE()}` | Current date
@@ -1214,6 +1547,8 @@ Time/Date Function | Returns
`{fn TIMESTAMPDIFF(SQL_TSI_SECOND,`*timestamp1*`,`*timestamp2*`)}` | Number of seconds by which *timestamp2* exceeds *timestamp1*
`{fn YEAR(`*date*`)}` | The year of *date*
+
+
#### Conversion Functions
Conversion function escape clauses are replaced by the corresponding SQL expression before the SQL request text is transmitted to the database.
@@ -1228,8 +1563,8 @@ Conversion Function | Returns
`{fn CONVERT(`*value*`, SQL_DOUBLE)}` | *value* converted to SQL `DOUBLE PRECISION`, a synonym for `FLOAT`
`{fn CONVERT(`*value*`, SQL_FLOAT)}` | *value* converted to SQL `FLOAT`
`{fn CONVERT(`*value*`, SQL_INTEGER)}` | *value* converted to SQL `INTEGER`
-`{fn CONVERT(`*value*`, SQL_LONGVARBINARY)}` | *value* converted to SQL `VARBYTE(64000)`
-`{fn CONVERT(`*value*`, SQL_LONGVARCHAR)}` | *value* converted to SQL `LONG VARCHAR`
+`{fn CONVERT(`*value*`, SQL_LONGVARBINARY)}` | *value* converted to SQL `BLOB`
+`{fn CONVERT(`*value*`, SQL_LONGVARCHAR)}` | *value* converted to SQL `CLOB`
`{fn CONVERT(`*value*`, SQL_NUMERIC)}` | *value* converted to SQL `NUMBER`
`{fn CONVERT(`*value*`, SQL_SMALLINT)}` | *value* converted to SQL `SMALLINT`
`{fn CONVERT(`*value*`, SQL_TIME(`*scale*`))}` | *value* converted to SQL `TIME(`*scale*`)`
@@ -1238,6 +1573,8 @@ Conversion Function | Returns
`{fn CONVERT(`*value*`, SQL_VARBINARY(`*size*`))}` | *value* converted to SQL `VARBYTE(`*size*`)`
`{fn CONVERT(`*value*`, SQL_VARCHAR(`*size*`))}` | *value* converted to SQL `VARCHAR(`*size*`)`
+
+
#### LIKE Predicate Escape Character
Within a `LIKE` predicate's *pattern* argument, the characters `%` (percent) and `_` (underscore) serve as wildcards.
@@ -1249,6 +1586,8 @@ To interpret a particular wildcard character literally in a `LIKE` predicate's *
The escape clause must be specified immediately after the `LIKE` predicate that it applies to.
+
+
#### Outer Joins
Outer join escape clauses are replaced by the corresponding SQL clause before the SQL request text is transmitted to the database.
@@ -1259,6 +1598,8 @@ Outer join escape clauses are replaced by the corresponding SQL clause before th
`{oj `*TableName* *OptionalCorrelationName* `FULL OUTER JOIN `*TableName* *OptionalCorrelationName* `ON `*JoinCondition*`}`
+
+
#### Stored Procedure Calls
Stored procedure call escape clauses are replaced by the corresponding SQL clause before the SQL request text is transmitted to the database.
@@ -1267,15 +1608,21 @@ Stored procedure call escape clauses are replaced by the corresponding SQL claus
`{call `*ProcedureName*`(`*CommaSeparatedParameterValues...*`)}`
+
+
#### Native SQL
When a SQL request contains the native SQL escape clause, all escape clauses are replaced in the SQL request text, and the modified SQL request text is returned to the application as a result set containing a single row and a single VARCHAR column. The SQL request text is not transmitted to the database, and the SQL request is not executed. The native SQL escape clause mimics the functionality of the JDBC API `Connection.nativeSQL` method.
`{fn teradata_nativesql}`
+This escape clause is automatically prepended to the SQL request when the connection `.nativeSQL` method is called.
+
+
+
#### Connection Functions
-The following table lists connection function escape clauses that are intended for use with the native SQL escape clause `{fn teradata_nativesql}`.
+The following table lists connection function escape clauses that are intended for use with the native SQL escape clause `{fn teradata_nativesql}` or the connection `.nativeSQL` method.
These functions provide information about the connection, or control the behavior of the connection.
Functions that provide information return locally-cached information and avoid a round-trip to the database.
@@ -1290,7 +1637,9 @@ Connection Function | Returns
`{fn teradata_get_errors}` | Errors from the most recent batch operation
`{fn teradata_get_warnings}` | Warnings from an operation that completed with warnings
`{fn teradata_getloglevel}` | Current log level
+`{fn teradata_go_distribution}` | Go distribution `M` ([Microsoft Go](https://github.com/microsoft/go)) or `S` ([standard Go](https://go.dev/dl/)) for the Teradata GoSQL Driver
`{fn teradata_go_runtime}` | Go runtime version for the Teradata GoSQL Driver
+`{fn teradata_go_runtime_stats}` | Go runtime statistics in JSON format
`{fn teradata_logon_sequence_number}` | Session's Logon Sequence Number, if available
`{fn teradata_program_name}` | Executable program name
`{fn teradata_provide(config_response)}` | Config Response parcel contents in JSON format
@@ -1300,7 +1649,7 @@ Connection Function | Returns
`{fn teradata_provide(gateway_config)}` | Gateway Config parcel contents in JSON format
`{fn teradata_provide(governed)}` | `true` or `false` indicating the `govern` connection parameter setting
`{fn teradata_provide(host_id)}` | Session's host ID
-`{fn teradata_provide(java_charset_name)}` | `UTF8`
+`{fn teradata_provide(java_charset_name)}` | Client character set
`{fn teradata_provide(lob_support)}` | `true` or `false` indicating this connection's LOB support
`{fn teradata_provide(local_address)}` | Local address of the connection's TCP socket
`{fn teradata_provide(local_port)}` | Local port of the connection's TCP socket
@@ -1309,12 +1658,15 @@ Connection Function | Returns
`{fn teradata_provide(remote_address)}` | Hostname (if available) and IP address of the connected database node
`{fn teradata_provide(remote_port)}` | TCP port number of the database
`{fn teradata_provide(rnp_active)}` | `true` or `false` indicating whether this connection has Recoverable Network Protocol active
-`{fn teradata_provide(session_charset_code)}` | Session character set code `191`
-`{fn teradata_provide(session_charset_name)}` | Session character set name `UTF8`
+`{fn teradata_provide(session_charset_code)}` | Session character set code
+`{fn teradata_provide(session_charset_name)}` | Session character set name
`{fn teradata_provide(sip_support)}` | `true` or `false` indicating this connection's StatementInfo parcel support
`{fn teradata_provide(transaction_mode)}` | Session's transaction mode, `ANSI` or `TERA`
`{fn teradata_provide(uses_check_workload)}` | `true` or `false` indicating whether this connection uses `CHECK WORKLOAD`
-`{fn teradata_session_number}` | Session number
+`{fn teradata_session_number}` | Database session number if connected to a database Gateway or endpoint session number if connected to an endpoint such as Unity, Session Manager, or Business Continuity Manager
+`{fn teradata_socket_info}` | Information about the TCP socket connection to the database. Format is subject to change. Do not rely on the specific format of the information.
+
+
#### Request-Scope Functions
@@ -1326,7 +1678,11 @@ Request-scope function escape clauses are removed before the SQL request text is
Request-Scope Function | Effect
------------------------------------------------------ | ---
`{fn teradata_agkr(`*Option*`)}` | Executes the SQL request with Auto-Generated Key Retrieval (AGKR) *Option* `C` (identity column value) or `R` (entire row)
+`{fn teradata_array_transform_off}` | Turns off the From-SQL transform for SQL Array values for this SQL request with Request Processing Option `S` (prepare)
+`{fn teradata_array_transform_on}` | Turns on the From-SQL transform for SQL Array values for this SQL request (the default)
+`{fn teradata_auto_rename_columns}` | Renames duplicate result set column names when exporting to a Parquet, JSON, or JSONL file with `teradata_write_parquet`, `teradata_write_json`, or `teradata_write_jsonl`, instead of returning an error. Refer to [Parquet Export Results](#ParquetExportResults).
`{fn teradata_clobtranslate(`*Option*`)}` | Executes the SQL request with CLOB translate *Option* `U` (unlocked) or the default `L` (locked)
+`{fn teradata_create_procedure}` | Specifies that this SQL request should use `CREATE PROCEDURE` / `REPLACE PROCEDURE` request handling
`{fn teradata_error_query_count(`*Number*`)}` | Specifies how many times the driver will attempt to query FastLoad Error Table 1 after a FastLoad operation. Takes precedence over the `error_query_count` connection parameter.
`{fn teradata_error_query_interval(`*Milliseconds*`)}` | Specifies how many milliseconds the driver will wait between attempts to query FastLoad Error Table 1. Takes precedence over the `error_query_interval` connection parameter.
`{fn teradata_error_table_1_suffix(`*Suffix*`)}` | Specifies the suffix to append to the name of FastLoad error table 1. Takes precedence over the `error_table_1_suffix` connection parameter.
@@ -1344,21 +1700,31 @@ Request-Scope Function | Effect
`{fn teradata_manage_error_tables_on}` | Turns on FastLoad error table management for this request. Takes precedence over the `manage_error_tables` connection parameter.
`{fn teradata_parameter(`*Index*`,`*DataType*`)` | Transmits parameter *Index* bind values as *DataType*
`{fn teradata_provide(request_scope_column_name_off)}` | Provides the default column name behavior for this SQL request. Takes precedence over the `column_name` connection parameter.
+`{fn teradata_provide(request_scope_column_type_off)}` | Provides the default column type suffix behavior for this SQL request. Takes precedence over the `column_type` connection parameter.
`{fn teradata_provide(request_scope_lob_support_off)}` | Turns off LOB support for this SQL request. Takes precedence over the `lob_support` connection parameter.
`{fn teradata_provide(request_scope_refresh_rsmd)}` | Executes the SQL request with the default request processing option `B` (both)
`{fn teradata_provide(request_scope_sip_support_off)}` | Turns off StatementInfo parcel support for this SQL request. Takes precedence over the `sip_support` connection parameter.
`{fn teradata_read_csv(`*CSVFileName*`)}` | Executes a batch insert using the bind parameter values read from the specified CSV file for either a SQL batch insert or a FastLoad
+`{fn teradata_read_json(`*JSONFileName*`)}` | Executes a batch insert using the bind parameter values read from the specified JSON file for either a SQL batch insert or a FastLoad
+`{fn teradata_read_jsonl(`*JSONLFileName*`)}` | Executes a batch insert using the bind parameter values read from the specified JSONL file for either a SQL batch insert or a FastLoad
+`{fn teradata_read_parquet(`*ParquetFileName*`)}` | Executes a batch insert using the bind parameter values read from the specified Parquet file for either a SQL batch insert or a FastLoad
`{fn teradata_request_timeout(`*Seconds*`)}` | Specifies the timeout for executing the SQL request. Zero means no timeout. Takes precedence over the `request_timeout` connection parameter.
`{fn teradata_require_fastexport}` | Specifies that FastExport is required for the SQL request
`{fn teradata_require_fastload}` | Specifies that FastLoad is required for the SQL request
+`{fn teradata_require_sql}` | Executes the SQL request as SQL. Takes precedence over the `type` connection parameter.
`{fn teradata_rpo(`*RequestProcessingOption*`)}` | Executes the SQL request with *RequestProcessingOption* `S` (prepare), `E` (execute), or the default `B` (both)
`{fn teradata_sessions(`*Number*`)}` | Specifies the *Number* of data transfer connections for FastLoad or FastExport. Takes precedence over the `sessions` connection parameter.
`{fn teradata_try_fastexport}` | Tries to use FastExport for the SQL request
`{fn teradata_try_fastload}` | Tries to use FastLoad for the SQL request
-`{fn teradata_untrusted}` | Marks the SQL request as untrusted; not implemented yet
+`{fn teradata_udt_transforms_off}` | Turns off From-SQL transforms for User Defined Type (UDT) values for this SQL request with Request Processing Option `S` (prepare)
+`{fn teradata_udt_transforms_on}` | Turns on From-SQL transforms for User Defined Type (UDT) values for this SQL request (the default)
+`{fn teradata_untrusted}` | Marks the SQL request as untrusted. Effective only when the `trusted_sql` connection parameter is `true`. Refer to [Trusted SQL and Query Band Impersonation](#TrustedSQL) for details.
`{fn teradata_values_off}` | Turns off `teradata_values` for this SQL request. Takes precedence over the `teradata_values` connection parameter. Refer to the [Data Types](#DataTypes) table for details.
`{fn teradata_values_on}` | Turns on `teradata_values` for this SQL request. Takes precedence over the `teradata_values` connection parameter. Refer to the [Data Types](#DataTypes) table for details.
`{fn teradata_write_csv(`*CSVFileName*`)}` | Exports one or more result sets from a SQL request or a FastExport to the specified CSV file or files
+`{fn teradata_write_json(`*JSONFileName*`)}` | Exports one or more result sets from a SQL request or a FastExport to the specified JSON file or files
+`{fn teradata_write_jsonl(`*JSONLFileName*`)}` | Exports one or more result sets from a SQL request or a FastExport to the specified JSONL file or files
+`{fn teradata_write_parquet(`*ParquetFileName*`[,`*Compression*`])}` | Exports one or more result sets from a SQL request or a FastExport to the specified Parquet file or files. Optional compression values are `snappy`, `gzip`, `zstd`, `uncompressed`, or `none`.
The `teradata_field_sep` and `teradata_field_quote` escape functions have a single-character string argument. The string argument must follow SQL literal syntax. The string argument may be enclosed in single-quote (`'`) characters or double-quote (`"`) characters.
@@ -1387,6 +1753,7 @@ FastLoad has limitations and cannot be used in all cases as a substitute for SQL
* Only use FastLoad to load many rows (at least 100,000 rows) so that the row-loading performance gain exceeds the overhead of opening additional connections.
* FastLoad does not support all database data types. For example, `BLOB` and `CLOB` are not supported.
* FastLoad requires StatementInfo parcel support to be enabled.
+* FastLoad requires read access to the DBC.SessionInfoV view to obtain the database Logon Sequence Number of the FastLoad job.
* FastLoad locks the destination table.
* If Online Archive encounters a table being loaded with FastLoad, online archiving of that table will be bypassed.
@@ -1425,6 +1792,12 @@ Your application ends FastLoad by committing or rolling back the current transac
Warning and error information remains available until the next batch is inserted or until the commit or rollback. Each batch execution clears the prior warnings and errors. Each commit or rollback clears the prior warnings and errors.
+#### FastLoad and Vector Columns
+
+The database can use both the `Vector_IO` and `Vector_IO_VARCHAR` transforms for the same SQL `INSERT` request. In contrast, the database has a limitation such that FastLoad can only use a single transform at a time. FastLoad can use either the `Vector_IO` or the `Vector_IO_VARCHAR` transform but cannot use both transforms for the same FastLoad job.
+* With `{fn teradata_try_fastload}` the driver will use FastLoad when your application binds either `VARBYTE` or `VARCHAR` values to Vector columns, but not both. The driver will fall back to SQL `INSERT` if your application binds both `VARBYTE` and `VARCHAR` values to Vector columns in the same request.
+* With `{fn teradata_require_fastload}` the driver returns an error when your application binds both `VARBYTE` and `VARCHAR` values to Vector columns in the same request.
+
### FastExport
@@ -1442,6 +1815,7 @@ FastExport has limitations and cannot be used in all cases as a substitute for S
* FastExport does not support all database data types. For example, `BLOB` and `CLOB` are not supported.
* For best efficiency, do not use `GROUP BY` and `ORDER BY` clauses with FastExport.
* FastExport's result set ordering behavior may differ from a regular SQL query. In particular, a query containing an ordered analytic function may not produce an ordered result set. Use an `ORDER BY` clause to guarantee result set order.
+* FastExport requires read access to the DBC.SessionInfoV view to obtain the database Logon Sequence Number of the FastExport job.
FastExport opens multiple data transfer connections to the database. FastExport uses overlapped I/O to send and receive messages in parallel.
@@ -1479,6 +1853,9 @@ Considerations when using a CSV file:
* A zero-length quoted string specifies a zero-length non-`NULL` string, not a `NULL` value (e.g. `1,"",456`).
* Not all data types are supported. For example, `BLOB`, `BYTE`, and `VARBYTE` are not supported.
* A field length greater than 64KB is transmitted to the database as a `DEFERRED CLOB` for a SQL batch insert. A field length greater than 64KB is not supported with FastLoad.
+* CSV file header line column names are ignored. No mapping is done from CSV file column names to destination table column names.
+* The driver reads CSV file columns left-to-right and binds them to SQL request parameter markers in order.
+* The number of CSV file columns must exactly match the number of parameter markers.
Limitations when using CSV batch inserts:
* Bound parameter values cannot be specified in the execute method when using the escape function `{fn teradata_read_csv(`*CSVFileName*`)}`.
@@ -1487,6 +1864,96 @@ Limitations when using CSV batch inserts:
* For SQL batch insert, some records may be inserted before a parsing error occurs. A list of the parser errors will be returned. Each parser error will include the line number (starting at line 1) and the column number (starting at zero).
* Using a CSV file with FastLoad has the same limitations and is used the same way as described in the [FastLoad](#FastLoad) section.
+
+
+### Parquet Batch Inserts
+
+The driver can read batch insert bind values from a Parquet file. This feature can be used with SQL batch inserts and with FastLoad.
+
+To specify batch insert bind values in a Parquet file, the application prepends the escape function `{fn teradata_read_parquet(`*ParquetFileName*`)}` to the `INSERT` statement.
+
+The application can specify batch insert bind values in a Parquet file, or specify bind parameter values, but not both together. The driver returns an error if both are specified together.
+
+Considerations when using a Parquet file:
+* The Parquet file must conform to the Apache Parquet specification.
+* The driver reads all row groups sequentially from the Parquet file.
+* Parquet files can be compressed (SNAPPY, GZIP, ZSTD, etc.) and the driver handles decompression automatically.
+* A field value of NULL in the Parquet file is treated as a SQL NULL value.
+* A string field length greater than 64KB is transmitted to the database as a `DEFERRED CLOB` for a SQL batch insert.
+* A binary field length greater than 64KB is transmitted to the database as a `DEFERRED BLOB` for a SQL batch insert.
+* A field length greater than 64KB is not supported with FastLoad.
+* The driver treats a Parquet input file similarly to a CSV input file. Parquet file column names are ignored. No mapping is done from Parquet file column names to destination table column names.
+* The driver reads Parquet file columns left-to-right by index and binds them to SQL request parameter markers in order.
+* The number of Parquet file columns must exactly match the number of parameter markers.
+
+Limitations when using Parquet batch inserts:
+* Bound parameter values cannot be specified in the execute method when using the escape function `{fn teradata_read_parquet(`*ParquetFileName*`)}`.
+* The Parquet file must contain at least one valid record.
+* For FastLoad, the insert operation will fail if the Parquet file is improperly formatted and a parser error occurs.
+* Using a Parquet file with FastLoad has the same limitations and is used the same way as described in the [FastLoad](#FastLoad) section.
+
+
+
+### JSON Batch Inserts
+
+The driver can read batch insert bind values from a JSON file. This feature can be used with SQL batch inserts and with FastLoad.
+
+To specify batch insert bind values in a JSON file, the application prepends the escape function `{fn teradata_read_json(`*JSONFileName*`)}` to the `INSERT` statement.
+
+The application can specify batch insert bind values in a JSON file, or specify bind parameter values, but not both together. The driver returns an error if both are specified together.
+
+Considerations when using a JSON file:
+* The JSON file must contain a JSON array of objects at the top level.
+* Each element of the array is a JSON object representing one row to be inserted.
+* For each parameter marker in the `INSERT` statement, the driver looks up the corresponding value in the JSON object by the destination column name. Every parameter marker must have a matching key in the JSON object.
+* JSON object keys may appear in any order. The driver uses the column name from the `INSERT` statement to locate the corresponding value in each JSON object. Key name matching is case-sensitive.
+* Extra keys in a JSON object that do not correspond to any parameter marker are silently ignored.
+* A JSON `null` value is treated as a SQL `NULL` value.
+* The driver recursively flattens nested JSON objects, promoting each nested key to the top level so it can be matched to a parameter marker by name. A nested object or array is also available as the string representation of its enclosing parent object. This allows the same data to be inserted into multiple columns at different levels of granularity. For example, given `{"c1": {"c2": 1}}`, the `c1` parameter marker receives the JSON string `{"c2": 1}` and the `c2` parameter marker receives the scalar value `1`.
+* A JSON array of floats, such as a vector embedding `[0.123, 0.456, ...]`, is transmitted to the database as its `VARCHAR` string representation, which the database can automatically convert to a `VECTOR` column value using its built-in To-SQL transform.
+* The driver reads all rows from the JSON file in a single batch.
+* A string field length greater than 32KB is transmitted to the database as a `DEFERRED CLOB` for a SQL batch insert. A field length greater than 32KB is not supported with FastLoad.
+
+Limitations when using JSON batch inserts:
+* Not all data types are supported. For example, `BLOB` and `BYTE` are not supported.
+* Bound parameter values cannot be specified in the execute method when using the escape function `{fn teradata_read_json(`*JSONFileName*`)}`.
+* Duplicate JSON keys, including keys from different nesting levels that collide after flattening, cause the driver to return an error.
+* The JSON file must contain at least one valid record in the top-level array.
+* For FastLoad, the insert operation will fail if the JSON file is improperly formatted and a parser error occurs.
+* For SQL batch insert, some records may be inserted before a parsing error occurs. A list of the parser errors will be returned.
+* Using a JSON file with FastLoad has the same limitations and is used the same way as described in the [FastLoad](#FastLoad) section.
+
+
+
+### JSONL Batch Inserts
+
+The driver can read batch insert bind values from a JSONL (JSON Lines) file. This feature can be used with SQL batch inserts and with FastLoad.
+
+To specify batch insert bind values in a JSONL file, the application prepends the escape function `{fn teradata_read_jsonl(`*JSONLFileName*`)}` to the `INSERT` statement.
+
+Each line of a JSONL file is a self-contained JSON object `{...}`. Lines that are empty or contain only whitespace are skipped. The file does not have a header line.
+
+The application can specify batch insert bind values in a JSONL file, or specify bind parameter values, but not both together. The driver returns an error if both are specified together.
+
+Considerations when using a JSONL file:
+* Each non-empty line of the JSONL file must be a valid JSON object `{...}`.
+* For each parameter marker in the `INSERT` statement, the driver looks up the corresponding value in the JSON object by the destination column name. Every parameter marker must have a matching key in the JSON object.
+* JSON object keys may appear in any order within each record. Key name matching is case-sensitive.
+* Extra keys in a JSON object that do not correspond to any parameter marker are silently ignored.
+* A JSON `null` value is treated as a SQL `NULL` value.
+* The driver recursively flattens nested JSON objects, promoting each nested key to the top level so it can be matched to a parameter marker by name. A nested object or array is also available as the string representation of its enclosing parent object. This allows the same data to be inserted into multiple columns at different levels of granularity. For example, given `{"address": {"city": "Dallas"}}`, the `address` parameter marker receives the JSON string `{"city": "Dallas"}` and the `city` parameter marker receives the scalar value `"Dallas"`.
+* A JSON array of floats, such as a vector embedding `[0.123, 0.456, ...]`, is transmitted to the database as its `VARCHAR` string representation, which the database can automatically convert to a `VECTOR` column value using its built-in To-SQL transform.
+* A string field length greater than 32KB is transmitted to the database as a `DEFERRED CLOB` for a SQL batch insert. A field length greater than 32KB is not supported with FastLoad.
+
+Limitations when using JSONL batch inserts:
+* Not all data types are supported. For example, `BLOB` and `BYTE` are not supported.
+* Bound parameter values cannot be specified in the execute method when using the escape function `{fn teradata_read_jsonl(`*JSONLFileName*`)}`.
+* Duplicate JSON keys, including keys from different nesting levels that collide after flattening, cause the driver to return an error.
+* The JSONL file must contain at least one valid record.
+* For FastLoad, the insert operation will fail if a record is improperly formatted and a parser error occurs.
+* For SQL batch insert, some records may be inserted before a parsing error occurs. A list of the parser errors will be returned.
+* Using a JSONL file with FastLoad has the same limitations and is used the same way as described in the [FastLoad](#FastLoad) section.
+
### CSV Export Results
@@ -1539,6 +2006,170 @@ Limitations when exporting to CSV files:
* Not all data types are supported. For example, `BLOB`, `BYTE`, and `VARBYTE` are not supported and if one of these column types are present in the result set, an error will be returned.
* `CLOB`, `XML`, `JSON`, and `DATASET STORAGE FORMAT CSV` data types are supported for SQL query results and are exported as string values, but these data types are not supported by FastExport.
+
+
+### Parquet Export Results
+
+The driver can export query results to Parquet files. This feature can be used with SQL query results, with calls to stored procedures, and with FastExport.
+
+To export a result set to a Parquet file, the application prepends one of the following escape functions to the SQL request text.
+
+* `{fn teradata_write_parquet(`*ParquetFileName*`)}`
+* `{fn teradata_write_parquet(`*ParquetFileName*`,`*Compression*`)}`
+
+The optional *Compression* argument is case-insensitive. Valid values are `snappy`, `gzip`, `zstd`, `uncompressed`, and `none`. When the compression argument is omitted, the default is `snappy`. The values `uncompressed` and `none` both produce an uncompressed Parquet file.
+
+If the query returns multiple result sets, each result set will be written to a separate file. The file name is varied by inserting the string "_N" between the specified file name and file type extension (e.g. `fileName.parquet`, `fileName_1.parquet`, `fileName_2.parquet`). If no file type extension is specified, then the suffix "_N" is appended to the end of the file name (e.g. `fileName`, `fileName_1`, `fileName_2`).
+
+A stored procedure call that produces multiple dynamic result sets behaves like other SQL requests that return multiple result sets. The stored procedure's output parameter values are exported as the first Parquet file.
+
+Example of a SQL request that returns multiple results:
+
+`{fn teradata_write_parquet(myFile.parquet)}select 'abc' ; select 123`
+
+Parquet File Name | Content
+----------------- | ---
+myFile.parquet | First result set
+myFile_1.parquet | Second result set
+
+To obtain the metadata for each result set, use the escape function `{fn teradata_fake_result_sets}`. A fake result set containing the metadata will be written to a file preceding each real result set.
+
+Example of a query that returns multiple result sets with metadata:
+
+`{fn teradata_fake_result_sets}{fn teradata_write_parquet(myFile.parquet)}select 'abc' ; select 123`
+
+Parquet File Name | Content
+----------------- | ---
+myFile.parquet | Fake result set containing the metadata for the first result set
+myFile_1.parquet | First result set
+myFile_2.parquet | Fake result set containing the metadata for the second result set
+myFile_3.parquet | Second result set
+
+Exported Parquet files have the following characteristics:
+* Each file conforms to the Apache Parquet specification.
+* The result set column order is preserved in the Parquet schema.
+* Result set column names are used for the Parquet schema. If an AS-clause alias is available, then the alias is used. Otherwise the column name is used, or the column title if no column name is available.
+* Each result set column name must be unique. By default, the driver returns an error if names are duplicated; use column aliases to make them unique. Alternatively, specify `{fn teradata_auto_rename_columns}` to have the driver rename duplicates automatically. The first occurrence keeps its original name. Each subsequent occurrence receives the lowest available suffix (`_1`, `_2`, and so on) that does not conflict with another column name.
+* A `NULL` value is exported as a Parquet `NULL` value.
+* Binary data types such as `BYTE`, `VARBYTE`, and `BLOB` are exported as Parquet binary values.
+* Character data types such as `CHAR`, `VARCHAR`, `CLOB`, `XML`, and `JSON` are exported as Parquet UTF-8 string values.
+* Date, time, timestamp, and decimal data are exported using appropriate Parquet logical types.
+* The `TIME WITH TIME ZONE` and `TIMESTAMP WITH TIME ZONE` data types are exported as Parquet UTF-8 string values, in the same format returned by an in-memory fetch, such as `09:15:00-08:00`. The Parquet time and timestamp logical types cannot represent a per-value time zone offset.
+* The `NUMBER` data type is exported as Parquet UTF-8 string values containing the exact decimal text, because a `NUMBER` value can have greater precision and a more variable scale than any Parquet numeric type can represent.
+
+Limitations when exporting to Parquet files:
+* When the application chooses to export results to a Parquet file, the results are not available for the application to fetch in memory.
+* If `{fn teradata_fake_result_sets}` is specified and a SQL statement does not produce a result set, a warning is returned that no result set can be exported for that statement.
+* Exporting a Parquet file with FastExport has the same limitations and is used the same way as described in the [FastExport](#FastExport) section.
+* Not all database data types are supported by FastExport to Parquet. With `{fn teradata_try_fastexport}`, unsupported types cause fallback to a regular SQL query. With `{fn teradata_require_fastexport}`, unsupported types cause an error.
+
+
+
+### JSON Export Results
+
+The driver can export query results to JSON files. This feature can be used with SQL query results, with calls to stored procedures, and with FastExport.
+
+To export a result set to a JSON file, the application prepends the escape function `{fn teradata_write_json(`*JSONFileName*`)}` to the SQL request text.
+
+If the query returns multiple result sets, each result set will be written to a separate file. The file name is varied by inserting the string "_N" between the specified file name and file type extension (e.g. `fileName.json`, `fileName_1.json`, `fileName_2.json`). If no file type extension is specified, then the suffix "_N" is appended to the end of the file name (e.g. `fileName`, `fileName_1`, `fileName_2`).
+
+A stored procedure call that produces multiple dynamic result sets behaves like other SQL requests that return multiple result sets. The stored procedure's output parameter values are exported as the first JSON file.
+
+Example of a SQL request that returns multiple results:
+
+`{fn teradata_write_json(myFile.json)}select 'abc' ; select 123`
+
+JSON File Name | Content
+-------------- | ---
+myFile.json | First result set
+myFile_1.json | Second result set
+
+To obtain the metadata for each result set, use the escape function `{fn teradata_fake_result_sets}`. A fake result set containing the metadata will be written to a file preceding each real result set.
+
+Example of a query that returns multiple result sets with metadata:
+
+`{fn teradata_fake_result_sets}{fn teradata_write_json(myFile.json)}select 'abc' ; select 123`
+
+JSON File Name | Content
+-------------- | ---
+myFile.json | Fake result set containing the metadata for the first result set
+myFile_1.json | First result set
+myFile_2.json | Fake result set containing the metadata for the second result set
+myFile_3.json | Second result set
+
+Exported JSON files have the following characteristics:
+* Each file is a JSON array of objects, with one object per result set row (e.g. `[{"col1":1,"col2":"abc"},{"col1":2,"col2":"def"}]`).
+* Each object's keys are the result set column names. If an AS-clause alias is available, then the alias is used. Otherwise the column name is used, or the column title if no column name is available.
+* Each result set column name must be unique. By default, the driver returns an error if names are duplicated; use column aliases to make them unique. Alternatively, specify `{fn teradata_auto_rename_columns}` to have the driver rename duplicates automatically. The first occurrence keeps its original name. Each subsequent occurrence receives the lowest available suffix (`_1`, `_2`, and so on) that does not conflict with another column name.
+* A `NULL` value is exported as a JSON `null` value.
+* `BIGINT`, `BYTEINT`, `INTEGER`, and `SMALLINT` values are exported as JSON number values.
+* `FLOAT` values are exported as JSON number values. A `FLOAT` value of `NaN` or `Infinity` cannot be represented in JSON, and causes the driver to return an error rather than writing an invalid value.
+* `DECIMAL` and `NUMBER` values are exported as unquoted JSON number tokens containing the exact decimal text returned by the database, rather than as quoted strings. Because Python's `json` module parses JSON numbers containing a decimal point as `float` by default, an application that requires exact precision should use a precision-preserving parser option such as `json.load(`*File*`, parse_float=decimal.Decimal)`.
+* `BYTE` and `VARBYTE` values, and `BLOB` values for non-FastExport exports, are exported as lowercase hexadecimal JSON string values.
+* `VECTOR` values are exported as JSON arrays of numbers (e.g. `[0.123,0.456,0.789]`).
+* `CHAR`, `VARCHAR`, `CLOB`, `XML`, and the database `JSON` data type are exported as JSON string values.
+* Date, time, timestamp, `INTERVAL`, and `PERIOD` values are exported as JSON string values, in the same format returned by an in-memory fetch.
+
+Limitations when exporting to JSON files:
+* When the application chooses to export results to a JSON file, the results are not available for the application to fetch in memory.
+* A warning is returned if the application specifies an export JSON file for a SQL statement that does not produce a result set.
+* Exporting a JSON file with FastExport has the same limitations and is used the same way as described in the [FastExport](#FastExport) section.
+* FastExport to JSON does not support `BLOB`, `CLOB`, `XML`, the database `JSON` data type, or `DATASET` data types. With `{fn teradata_try_fastexport}`, unsupported types cause fallback to a regular SQL query. With `{fn teradata_require_fastexport}`, unsupported types cause an error.
+
+
+
+### JSONL Export Results
+
+The driver can export query results to JSONL (JSON Lines) files. This feature can be used with SQL query results, with calls to stored procedures, and with FastExport.
+
+To export a result set to a JSONL file, the application prepends the escape function `{fn teradata_write_jsonl(`*JSONLFileName*`)}` to the SQL request text.
+
+If the query returns multiple result sets, each result set will be written to a separate file. The file name is varied by inserting the string "_N" between the specified file name and file type extension (e.g. `fileName.jsonl`, `fileName_1.jsonl`, `fileName_2.jsonl`). If no file type extension is specified, then the suffix "_N" is appended to the end of the file name (e.g. `fileName`, `fileName_1`, `fileName_2`).
+
+A stored procedure call that produces multiple dynamic result sets behaves like other SQL requests that return multiple result sets. The stored procedure's output parameter values are exported as the first JSONL file.
+
+Example of a SQL request that returns multiple results:
+
+`{fn teradata_write_jsonl(myFile.jsonl)}select 'abc' ; select 123`
+
+JSONL File Name | Content
+--------------- | ---
+myFile.jsonl | First result set
+myFile_1.jsonl | Second result set
+
+To obtain the metadata for each result set, use the escape function `{fn teradata_fake_result_sets}`. A fake result set containing the metadata will be written to a file preceding each real result set.
+
+Example of a query that returns multiple result sets with metadata:
+
+`{fn teradata_fake_result_sets}{fn teradata_write_jsonl(myFile.jsonl)}select 'abc' ; select 123`
+
+JSONL File Name | Content
+--------------- | ---
+myFile.jsonl | Fake result set containing the metadata for the first result set
+myFile_1.jsonl | First result set
+myFile_2.jsonl | Fake result set containing the metadata for the second result set
+myFile_3.jsonl | Second result set
+
+Exported JSONL files have the following characteristics:
+* Each file contains one JSON object per line, with one object per result set row (e.g. `{"col1":1,"col2":"abc"}` on one line and `{"col1":2,"col2":"def"}` on the next line).
+* Each object's keys are the result set column names. If an AS-clause alias is available, then the alias is used. Otherwise the column name is used, or the column title if no column name is available.
+* Each result set column name must be unique. By default, the driver returns an error if names are duplicated; use column aliases to make them unique. Alternatively, specify `{fn teradata_auto_rename_columns}` to have the driver rename duplicates automatically. The first occurrence keeps its original name. Each subsequent occurrence receives the lowest available suffix (`_1`, `_2`, and so on) that does not conflict with another column name.
+* A `NULL` value is exported as a JSON `null` value.
+* `BIGINT`, `BYTEINT`, `INTEGER`, and `SMALLINT` values are exported as JSON number values.
+* `FLOAT` values are exported as JSON number values. A `FLOAT` value of `NaN` or `Infinity` cannot be represented in JSON, and causes the driver to return an error rather than writing an invalid value.
+* `DECIMAL` and `NUMBER` values are exported as unquoted JSON number tokens containing the exact decimal text returned by the database. The `json` module parses these as `float` by default. Use `json.load(`*File*`, parse_float=decimal.Decimal)` to obtain exact-precision `Decimal` numbers.
+* `BYTE` and `VARBYTE` values, and `BLOB` values for non-FastExport exports, are exported as lowercase hexadecimal JSON string values.
+* `VECTOR` values are exported as JSON arrays of numbers (e.g. `[0.123,0.456,0.789]`).
+* `CHAR`, `VARCHAR`, `CLOB`, `XML`, and the database `JSON` data type are exported as JSON string values.
+* Date, time, timestamp, `INTERVAL`, and `PERIOD` values are exported as JSON string values, in the same format returned by an in-memory fetch.
+* A line terminator is written after each row, so the file is newline-delimited JSON (JSONL).
+
+Limitations when exporting to JSONL files:
+* When the application chooses to export results to a JSONL file, the results are not available for the application to fetch in memory.
+* A warning is returned if the application specifies an export JSONL file for a SQL statement that does not produce a result set.
+* Exporting a JSONL file with FastExport has the same limitations and is used the same way as described in the [FastExport](#FastExport) section.
+* FastExport to JSONL does not support `BLOB`, `CLOB`, `XML`, the database `JSON` data type, or `DATASET` data types. With `{fn teradata_try_fastexport}`, unsupported types cause fallback to a regular SQL query. With `{fn teradata_require_fastexport}`, unsupported types cause an error.
+
### Command Line Interface
@@ -1583,6 +2214,249 @@ Windows | `py -3 -m teradatasql host=whomooz,user=guest,password=please "
### Change Log
+`20.0.0.76` - November 16, 2026
+* GOSQL-143 trusted_sql connection parameter
+* GOSQL-383 Localize messages in FileImporterCSV and FileImporterParquet
+* GOSQL-455 Add Teradata Wallet support for credential resolution on Windows
+* GOSQL-471 escape function teradata_auto_rename_columns
+* Switch to golang.org/x/crypto v0.59.0
+* Switch to Go 1.27.4
+* Requires macOS 13 Ventura or later and ends support for older versions of macOS
+
+`20.0.0.75` - November 6, 2026
+* GOSQL-339 connection parameter jws_private_key_password
+* GOSQL-452 application layer keep-alive CopKindTest handshake
+
+`20.0.0.74` - October 30, 2026
+* GOSQL-320 charset and client_charset connection parameters
+
+`20.0.0.73` - October 28, 2026
+* GOSQL-485 Switch to Go 1.27.3
+
+`20.0.0.72` - October 12, 2026
+* GOSQL-476 Switch to Go 1.27.2
+* Switch to golang.org/x/crypto v0.58.0
+
+`20.0.0.71` - October 9, 2026
+* GOSQL-144 type=fastload/fastexport connection parameter
+* GOSQL-474 Client Attribute ClientSecProdUserId for database and identity provider TLS named group
+
+`20.0.0.70` - October 7, 2026
+* GOSQL-341 use Windows proxy settings including PAC file support
+* GOSQL-473 Switch to parquet-go/parquet-go v0.32.0
+* Switch to golang.org/x/crypto v0.57.0
+
+`20.0.0.69` - September 28, 2026
+* GOSQL-343 escape function teradata_write_jsonl
+* GOSQL-358 escape function teradata_write_json
+* GOSQL-430 escape function teradata_create_procedure to force CREATE/REPLACE PROCEDURE protocol
+
+`20.0.0.68` - September 1, 2026
+* GOSQL-465 accommodate missing issuers in certificate revocation checking
+
+`20.0.0.67` - August 28, 2026
+* GOSQL-385 escape function teradata_write_parquet
+* GOSQL-413 new connection parameter value sslcrc=DISABLE
+* GOSQL-439 Align Parquet FastExport Data Type Support with Protocol Capabilities
+
+`20.0.0.66` - August 19, 2026
+* GOSQL-441 avoid goroutine leak after connection failure
+* GOSQL-453 Switch to Go 1.26.6
+* GOSQL-454 Switch to golang.org/x/crypto v0.55.0
+
+`20.0.0.65` - August 12, 2026
+* GOSQL-440 validate browser= connection parameter against TERADATA_BROWSER environment variable
+
+`20.0.0.64` - July 31, 2026
+* GOSQL-426 add NullableKnown field to fake result set column and parameter metadata JSON
+* GOSQL-427 add Proxy Server Support section to README
+* GOSQL-428 teradata_provide(config_response) JSON field QueryableViewColumnInfoSupport
+* GOSQL-433 Switch to golang.org/x/crypto v0.54.0
+* GOSQL-434 Switch to github.com/klauspost/compress v1.19.1
+
+`20.0.0.63` - July 14, 2026
+* GOSQL-415 connection parameter column_type
+* GOSQL-416 escape syntax support for char_length and character_length
+* GOSQL-417 escape function CONVERT behavior change SQL_LONGVARBINARY is BLOB and SQL_LONGVARCHAR is CLOB
+* GOSQL-424 Switch to Go 1.26.5
+
+`20.0.0.62` - June 24, 2026
+* GOSQL-337 escape function teradata_read_jsonl
+* GOSQL-401 Update third party license files for parquet-go and dependencies
+* GOSQL-403 more accurate severity keyword for Go TeraGSS error messages
+* GOSQL-405 Improve error message for logmech=JWT when logdata is missing token= prefix
+
+`20.0.0.61` - June 4, 2026
+* GOSQL-371 reduce size of Parquet reader library
+* GOSQL-389 Replace Apache Arrow with parquet-go/parquet-go
+* GOSQL-399 Switch to Go 1.26.4
+
+`20.0.0.60` - May 29, 2026
+* GOSQL-357 escape function teradata_read_json
+* GOSQL-393 Switch to golang.org/x/crypto v0.52.0
+
+`20.0.0.59` - May 20, 2026
+* GOSQL-387 Switch to Go 1.26.3
+
+`20.0.0.58` - May 6, 2026
+* GOSQL-379 obtain locale from GetUserDefaultLocaleName on Windows
+* GOSQL-380 connection parameter jws_audience
+
+`20.0.0.57` - May 1, 2026
+* GOSQL-370 error message internationalization
+* GOSQL-372 error message Japanese translation
+* GOSQL-373 error message SQLState
+
+`20.0.0.56` - April 10, 2026
+* GOSQL-355 Switch to golang.org/x/crypto v0.47.0
+* GOSQL-360 Switch to Go 1.26.2
+
+`20.0.0.55` - April 3, 2026
+* GOSQL-225 escape function teradata_read_parquet
+
+`20.0.0.54` - March 19, 2026
+* GOSQL-340 escape function teradata_go_distribution
+
+`20.0.0.53` - March 10, 2026
+* GOSQL-327 Switch to Go 1.26.1
+
+`20.0.0.52` - Febuary 12, 2026
+* GOSQL-318 Switch to Go 1.26.0
+
+`20.0.0.51` - Febuary 12, 2026
+* GOSQL-317 Update README.md for connection parameters reconnect_count, reconnect_interval, redrive
+
+`20.0.0.50` - January 16, 2026
+* GOSQL-312 escape functions teradata_array_transform_off/on and teradata_udt_transforms_off/on
+* PYDBAPI-158 Module constructor teradatasql.factory to return connection factory function
+
+`20.0.0.49` - January 15, 2026
+* GOSQL-300 accept port range for oidc_redirect_port connection parameter
+* GOSQL-302 add state parameter to Authorization Code Flow
+* GOSQL-310 more StatementInfo parcel fields in fake result set JSON column and parameter metadata
+
+`20.0.0.48` - December 9, 2025
+* GOSQL-226 connection parameter local_catalog=true/false default false
+* GOSQL-227 fake_result_sets support for OTF catalog name in StatementInfo parcel
+* GOSQL-280 Switch to golang.org/x/crypto version 0.45.0
+* GOSQL-287 Switch to Go 1.25.5
+* GOSQL-290 avoid panic for reconnect after session aborted by administrator
+
+`20.0.0.47` - November 17, 2025
+* GOSQL-278 connection parameter ws_endpoint
+* PYDBAPI-151 command line interface to manage compute resources
+
+`20.0.0.46` - November 12, 2025
+* GOSQL-273 allow host=-none in token mode
+* GOSQL-277 escape function teradata_web_service
+* GOSQL-279 teradata_write_csv support for FastExport No Spool mode
+
+`20.0.0.44` - October 13, 2025
+* PYDBAPI-148 numpy float32 array and float64 array bind values for Vector columns
+* PYDBAPI-150 pandas DataFrame bind values for execute and executemany methods
+* Build DLL and shared library with Go 1.25.2
+
+`20.0.0.43` - October 9, 2025
+* Documentation correction for oidc_redirect_port
+
+`20.0.0.42` - October 9, 2025
+* GOSQL-262 add section anchor tags to README files
+* GOSQL-264 connection parameter oidc_redirect_port
+
+`20.0.0.41` - September 25, 2025
+* GOSQL-255 exclude from revocation checking last certificate in chain if self-signed
+* GOSQL-256 token mode
+* PYDBAPI-143 experimental Beta feature 32-bit Python for Windows x86
+* PYDBAPI-144 experimental Beta feature 32-bit Python for Linux Intel x86
+
+`20.0.0.40` - September 5, 2025
+* GOSQL-243 panic recovery with stack traces for top-level APIs
+* Build DLL and shared library with Go 1.25.1
+* Build DLL with MinGW 15.2.0
+* Switch to golang.org/x/crypto version 0.41.0
+
+`20.0.0.39` - September 2, 2025
+* GOSQL-242 catch and wrap panic from deserialization
+
+`20.0.0.38` - August 25, 2025
+* GOSQL-239 Avoid database Error 3119 after cancel of CREATE PROCEDURE statement
+
+`20.0.0.37` - August 21, 2025
+* GOSQL-238 Avoid panic: runtime error: slice bounds out of range from getParcelHeadersFromMessage
+
+`20.0.0.36` - August 20, 2025
+* GOSQL-237 Avoid error for missing file /proc/sys/crypto/fips_enabled
+
+`20.0.0.35` - August 19, 2025
+* GOSQL-228 Windows automatic FIPS mode
+* GOSQL-229 Linux x64 and ARM automatic FIPS mode
+* GOSQL-236 macOS FIPS mode with environment variable GODEBUG=fips140=on
+* Build DLL and shared library with Go 1.24.6
+
+`20.0.0.34` - August 5, 2025
+* GOSQL-215 oauth_scopes connection parameter for OTF catalog and storage SSO
+* GOSQL-216 OIDC token refresh
+
+`20.0.0.33` - July 7, 2025
+* GOSQL-30 Recoverable Network Protocol and Redrive
+
+`20.0.0.32` - June 11, 2025
+* FastLoad to Vector column using transform Vector_IO or Vector_IO_VARCHAR
+
+`20.0.0.31` - June 2, 2025
+* Build DLL and shared library with standard Go 1.24.3
+* Added import Crypto.Hash.HMAC to sample program TJEncryptPassword.py
+
+`20.0.0.30` - April 25, 2025
+* GOSQL-32 DBCCONS partition
+
+`20.0.0.29` - April 22, 2025
+* GOSQL-221 connection parameter https_retry
+* GOSQL-222 connection parameter sslbase64
+
+`20.0.0.28` - April 5, 2025
+* GOSQL-219 sslnamedgroups connection parameter
+* GOSQL-220 connection parameter oidc_prompt
+* support for Linux ppc64le on 64-bit Power processors
+* streamlined teradatasql package description to avoid Azure DevOps artifact metadata limit
+
+`20.0.0.27` - April 1, 2025
+* GOSQL-207 OIDC token cache for improved Browser Authentication UX
+
+`20.0.0.26` - March 17, 2025
+* Vector data type support for FastLoad
+* Build DLL and shared library with standard Go 1.24.1
+* Environment variable GODEBUG=fips140=on directs the Go Cryptographic Module to operate in FIPS 140-3 mode, default is off
+* No longer uses OpenSSL on Linux, to avoid panic: opensslcrypto: FIPS mode requested (system FIPS mode) but not available in OpenSSL
+* client attribute ClientSecProdGrp no longer indicates OpenSSL library on Linux
+* Switch to golang.org/x/crypto version 0.36.0
+
+`20.0.0.25` - February 25, 2025
+* FIPS support
+* proxy server support for FastLoad and FastExport
+* GOSQL-182 transmit additional Client Attributes
+* client attribute ClientSecProdGrp also indicates OpenSSL library on Linux
+* Build DLL and shared library with Microsoft Go 1.24 using build tag goexperiment.systemcrypto for FIPS support
+* Requires macOS 12.4 Monterey or later and ends support for older versions of macOS
+* Requires Linux kernel version 3.2 or later and ends support for older versions of Linux
+
+`20.0.0.24` - February 3, 2025
+* default Linux Kerberos libraries /usr/lib64/libgssapi_krb5.so and /usr/lib64/libgssapi_krb5.so.2
+
+`20.0.0.23` - January 27, 2025
+* client attribute ClientSecProdGrp indicates Go crypto library version
+* Build DLL and shared library with Go 1.23.5
+* Build DLL and shared library with golang.org/x/crypto v0.32.0
+* Requires macOS 11 Big Sur or later and ends support for older versions of macOS
+
+`20.0.0.22` - January 6, 2025
+* Debug logging for Kerberos library dynamic loading and linking
+
+`20.0.0.21` - December 12, 2024
+* Provide driver version number and session number in Teradata Security exceptions
+* Add commands to teradatasql module command line interface
+* Add connection method `.nativeSQL`
+
`20.0.0.20` - October 25, 2024
* GOSQL-212 handle Microsoft Entra OIDC Authorization Code Response redirect error parameters
* Add escape function `{fn teradata_provide(dhke)}`
diff --git a/THIRDPARTYLICENSE b/THIRDPARTYLICENSE
index 40e29ce..9218277 100644
--- a/THIRDPARTYLICENSE
+++ b/THIRDPARTYLICENSE
@@ -38,3 +38,1017 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+_________________________________________________________________________________
+
+OSAT 23458
+
+The google/uuid library is included in this product in binary form.
+Use of the google/uuid library is governed by the terms of the license below:
+
+
+Copyright (c) 2009,2014 Google Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+_________________________________________________________________________________
+
+OSAT 26189
+
+The parquet-go library is included in this product in binary form.
+Use of the parquet-go library is governed by the terms of the license below:
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2023 Twilio, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+--------------------------------------------------------------------------------
+
+This product includes code from Apache Parquet.
+
+* deprecated/parquet.go is based on Apache Parquet's thrift file
+* format/parquet.go is based on Apache Parquet's thrift file
+
+Copyright: 2014 The Apache Software Foundation.
+Home page: https://github.com/apache/parquet-format
+License: http://www.apache.org/licenses/LICENSE-2.0
+
+_________________________________________________________________________________
+
+OSAT 26190
+
+The parquet-go/bitpack library is included in this product in binary form.
+Use of the parquet-go/bitpack library is governed by the terms of the license below:
+
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2025 Achille Roussel, Filip Petkovski
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+_________________________________________________________________________________
+
+OSAT 26191
+
+The parquet-go/jsonlite library is included in this product in binary form.
+Use of the parquet-go/jsonlite library is governed by the terms of the license below:
+
+
+MIT License
+
+Copyright (c) 2025 parquet-go
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+_________________________________________________________________________________
+
+OSAT 26193
+
+The twpayne/go-geom library is included in this product in binary form.
+Use of the twpayne/go-geom library is governed by the terms of the license below:
+
+
+Copyright (c) 2013, Tom Payne
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ Redistributions in binary form must reproduce the above copyright notice, this
+ list of conditions and the following disclaimer in the documentation and/or
+ other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+_________________________________________________________________________________
+
+OSAT 26195
+
+The andybalholm/brotli library is included in this product in binary form.
+Use of the andybalholm/brotli library is governed by the terms of the license below:
+
+
+Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+_________________________________________________________________________________
+
+OSAT 26196
+
+The klauspost/compress library is included in this product in binary form.
+Use of the klauspost/compress library is governed by the terms of the license below:
+
+
+Copyright (c) 2012 The Go Authors. All rights reserved.
+Copyright (c) 2019 Klaus Post. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+------------------
+
+Files: gzhttp/*
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2016-2017 The New York Times Company
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+------------------
+
+Files: s2/cmd/internal/readahead/*
+
+The MIT License (MIT)
+
+Copyright (c) 2015 Klaus Post
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+---------------------
+Files: snappy/*
+Files: internal/snapref/*
+
+Copyright (c) 2011 The Snappy-Go Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+-----------------
+
+Files: s2/cmd/internal/filepathx/*
+
+Copyright 2016 The filepathx Authors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+_________________________________________________________________________________
+
+OSAT 26197
+
+The pierrec/lz4 library is included in this product in binary form.
+Use of the pierrec/lz4 library is governed by the terms of the license below:
+
+
+Copyright (c) 2015, Pierre Curto
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of xxHash nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+_________________________________________________________________________________
+
+OSAT 26199
+
+The golang.org/x/crypto library is included in this product in binary form.
+Use of the golang.org/x/crypto library is governed by the terms of the license below:
+
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+_________________________________________________________________________________
+
+OSAT 26200
+
+The golang.org/x/sys library is included in this product in binary form.
+Use of the golang.org/x/sys library is governed by the terms of the license below:
+
+
+Copyright 2009 The Go Authors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google LLC nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+_________________________________________________________________________________
+
+OSAT 26201
+
+The google.golang.org/protobuf library is included in this product in binary form.
+Use of the google.golang.org/protobuf library is governed by the terms of the license below:
+
+
+Copyright (c) 2018 The Go Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/samples/AbortSession.py b/samples/AbortSession.py
new file mode 100644
index 0000000..722c9cd
--- /dev/null
+++ b/samples/AbortSession.py
@@ -0,0 +1,37 @@
+# Copyright 2025 by Teradata Corporation. All Rights Reserved.
+
+# This sample program demonstrates how to abort a session.
+
+import teradatasql
+
+def concise (ex):
+ asLines = str (ex).splitlines ()
+ # eliminate lines beginning with " at "
+ asLines = [ line for line in asLines if not line.lstrip ().startswith ("at ") ]
+ return "\n ".join (asLines)
+
+conUser = teradatasql.connect (host="whomooz", user="guest", password="please")
+try:
+ with conUser.cursor () as curUser:
+ curUser.execute ("select 123")
+ row = curUser.fetchone ()
+ print ("Query result:", row [0])
+
+ nSessionNumber = conUser.nativeSQL ("{fn teradata_session_number}")
+
+ with teradatasql.connect (host="whomooz", user="dbc", password="dbc") as conAdmin:
+ with conAdmin.cursor () as curAdmin:
+ print ("Aborting session number", nSessionNumber)
+ curAdmin.execute ("select AbortSessions (-1, null, " + str (nSessionNumber) + ", 'Y', 'Y')")
+
+ try:
+ curUser.execute ("select 456")
+ row = curUser.fetchone ()
+ print ("Query result:", row [0])
+ except Exception as ex:
+ print ("Expected error after aborting session:", concise (ex))
+finally:
+ try:
+ conUser.close ()
+ except Exception as ex:
+ print ("Expected error after aborting session:", concise (ex))
diff --git a/samples/BatchInsertJSON.py b/samples/BatchInsertJSON.py
new file mode 100644
index 0000000..3855c33
--- /dev/null
+++ b/samples/BatchInsertJSON.py
@@ -0,0 +1,45 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to insert a batch of rows using a JSON file.
+# It also illustrates dual treatment of a nested JSON object: the raw JSON
+# string is stored verbatim in the "address" column, while the flattened
+# sub-field "city" is stored in a separate column.
+
+import json
+import os
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (id integer, name varchar(20), address varchar(200), city varchar(20)) on commit preserve rows")
+
+ # Each record has three top-level keys:
+ # id -- scalar integer
+ # name -- scalar string
+ # address -- nested object; its raw JSON string maps to the "address" column
+ # and its sub-field "city" maps to the "city" column.
+ records = [
+ {"id": 1, "name": "Alice", "address": {"city": "Boston"}},
+ {"id": 2, "name": "Bob", "address": {"city": "Austin"}},
+ {"id": 3, "name": "Carol", "address": {"city": "Chicago"}},
+ {"id": 4, "name": "Dave", "address": {"city": "Denver"}},
+ {"id": 5, "name": "Erin", "address": {"city": "Eugene"}},
+ {"id": 6, "name": "Frank", "address": {"city": "Fresno"}},
+ {"id": 7, "name": "Grace", "address": {"city": "Houston"}},
+ {"id": 8, "name": "Hank", "address": {"city": "Irvine"}},
+ {"id": 9, "name": "Iris", "address": {"city": "Jacksonville"}},
+ ]
+
+ sFileName = "dataBatchPy.json"
+ print (f"Writing {sFileName}")
+ with open (sFileName, "w", encoding="UTF-8") as f:
+ json.dump (records, f)
+
+ try:
+ print ("Inserting data")
+ cur.execute ("{fn teradata_read_json(%s)} insert into voltab (id, name, address, city) values (?, ?, ?, ?)" % sFileName)
+ finally:
+ os.remove (sFileName)
+
+ cur.execute ("select id, name, address, city from voltab order by 1")
+ [ print (row) for row in cur.fetchall () ]
diff --git a/samples/BatchInsertJSONL.py b/samples/BatchInsertJSONL.py
new file mode 100644
index 0000000..85739ad
--- /dev/null
+++ b/samples/BatchInsertJSONL.py
@@ -0,0 +1,40 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to insert a batch using a JSONL file.
+# It demonstrates key-order independence and explicit NULL handling.
+
+import os
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer not null, c2 varchar(10), c3 VECTOR) on commit preserve rows")
+
+ jsonlFileName = "dataBatchPy.jsonl"
+ print (f"Writing {jsonlFileName}")
+
+ lines = [
+ '{"c1":1,"c2":"x1","c3":[0.10,-0.20,0.30]}',
+ '{"c2":"x2","c1":2,"c3":[0.20,-0.40,0.60]}',
+ '{"c3":[0.30,-0.60,0.90],"c1":3,"c2":"x3"}',
+ '{"c1":4,"c2":"x4","c3":[0.40,-0.80,1.20]}',
+ '{"c1":5,"c2":null,"c3":[0.50,-1.00,1.50]}',
+ '{"c1":6,"c2":"x6","c3":[0.60,-1.20,1.80]}',
+ '{"c1":7,"c2":"x7","c3":[0.70,-1.40,2.10]}',
+ '{"c1":8,"c2":"x8","c3":[0.80,-1.60,2.40]}',
+ '{"c1":9,"c2":"x9","c3":[0.90,-1.80,2.70]}',
+ ]
+
+ with open (jsonlFileName, "w", encoding="UTF-8") as f:
+ for line in lines:
+ f.write (line + "\n")
+
+ try:
+ print ("Inserting data")
+ cur.execute (f"{{fn teradata_read_jsonl({jsonlFileName})}} insert into voltab (c1, c2, c3) values (?, ?, ?)")
+ finally:
+ print (f"os.remove({jsonlFileName})")
+ os.remove (jsonlFileName)
+
+ cur.execute ("select c1, c2, c3 from voltab order by 1")
+ [ print (row) for row in cur.fetchall () ]
diff --git a/samples/BatchInsertParquet.py b/samples/BatchInsertParquet.py
new file mode 100644
index 0000000..5842042
--- /dev/null
+++ b/samples/BatchInsertParquet.py
@@ -0,0 +1,39 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to insert a batch using a parquet file.
+
+import os
+import teradatasql
+import pyarrow as pa
+import pyarrow.parquet as pq
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(10)) on commit preserve rows")
+
+ # Create Parquet file with sample data
+ parquetFileName = "dataBatchPy.parquet"
+ print (f"Creating Parquet file: {parquetFileName}")
+
+ # Create data arrays
+ data = {
+ 'c1': [1, 2, 3, 4, 5, 6, 7, 8, 9],
+ 'c2': ['x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9']
+ }
+
+ # Create Arrow table
+ table = pa.table (data)
+
+ # Write Parquet file
+ pq.write_table (table, parquetFileName)
+ print ("Parquet file created successfully")
+
+ try:
+ print ("Inserting data")
+ cur.execute ("{fn teradata_read_parquet(%s)} insert into voltab (?, ?)" % parquetFileName)
+ finally:
+ print (f"os.remove({parquetFileName})")
+ os.remove (parquetFileName)
+
+ cur.execute ("select * from voltab order by 1")
+ [ print (row) for row in cur.fetchall () ]
diff --git a/samples/ExportJSONLResult.py b/samples/ExportJSONLResult.py
new file mode 100644
index 0000000..acb4f73
--- /dev/null
+++ b/samples/ExportJSONLResult.py
@@ -0,0 +1,31 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+# TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
+
+# This sample program demonstrates how to export a select result into a JSONL file.
+
+import json
+import os
+import teradatasql
+
+
+def readJSONL (sFileName):
+ with open (sFileName, "rt", encoding="UTF8") as f:
+ return [json.loads (sLine) for sLine in f]
+
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(100)) on commit preserve rows")
+
+ print ("Inserting data")
+ cur.execute ("insert into voltab values (?, ?)", [[1, "abc"], [2, None], [3, "xyz"]])
+
+ sFileName = "dataPy.jsonl"
+ print ("Exporting table data to file", sFileName)
+ cur.execute ("{fn teradata_write_jsonl(" + sFileName + ")}select * from voltab order by 1")
+
+ try:
+ print ("Reading file", sFileName)
+ print (readJSONL (sFileName))
+ finally:
+ os.remove (sFileName)
diff --git a/samples/ExportJSONLResults.py b/samples/ExportJSONLResults.py
new file mode 100644
index 0000000..ba9888b
--- /dev/null
+++ b/samples/ExportJSONLResults.py
@@ -0,0 +1,32 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+# TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
+
+# This sample program demonstrates how a multi-statement request writes multiple JSONL files.
+
+import json
+import os
+import teradatasql
+
+
+def readJSONL (sFileName):
+ with open (sFileName, "rt", encoding="UTF8") as f:
+ return [json.loads (sLine) for sLine in f]
+
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(100)) on commit preserve rows")
+
+ print ("Inserting data")
+ cur.execute ("insert into voltab values (?, ?)", [[1, "abc"], [2, None], [3, "xyz"]])
+
+ asFileNames = ["dataPy.jsonl", "dataPy_1.jsonl", "dataPy_2.jsonl"]
+ print ("Exporting multi-statement results to files", asFileNames)
+ cur.execute ("{fn teradata_write_jsonl(" + asFileNames [0] + ")}select * from voltab where c1 < 3 order by 1;select * from voltab where c1 >= 3 order by 1;select 123 as col1, 'abc' as col2")
+ try:
+ for sFileName in asFileNames:
+ print ("Reading file", sFileName)
+ print (readJSONL (sFileName))
+ finally:
+ for sFileName in asFileNames:
+ os.remove (sFileName)
diff --git a/samples/ExportJSONResult.py b/samples/ExportJSONResult.py
new file mode 100644
index 0000000..46aacb4
--- /dev/null
+++ b/samples/ExportJSONResult.py
@@ -0,0 +1,20 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+# TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
+
+# This sample program demonstrates how to export a select result into a JSON file.
+
+import json
+import os
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(100)) on commit preserve rows")
+ cur.execute ("insert into voltab values (?, ?)", [[1, "abc"], [2, None], [3, "xyz"]])
+ sFileName = "dataPy.json"
+ cur.execute ("{fn teradata_write_json(" + sFileName + ")}select * from voltab order by 1")
+ try:
+ with open (sFileName, "rt", encoding="UTF8") as f:
+ print (json.load (f))
+ finally:
+ os.remove (sFileName)
diff --git a/samples/ExportJSONResults.py b/samples/ExportJSONResults.py
new file mode 100644
index 0000000..c82588e
--- /dev/null
+++ b/samples/ExportJSONResults.py
@@ -0,0 +1,22 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+# TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
+
+# This sample program demonstrates how a multi-statement request writes multiple JSON files.
+
+import json
+import os
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(100)) on commit preserve rows")
+ cur.execute ("insert into voltab values (?, ?)", [[1, "abc"], [2, None], [3, "xyz"]])
+ asFileNames = ["dataPy.json", "dataPy_1.json", "dataPy_2.json"]
+ cur.execute ("{fn teradata_write_json(" + asFileNames [0] + ")}select * from voltab where c1 < 3 order by 1;select * from voltab where c1 >= 3 order by 1;select 123 as col1, 'abc' as col2")
+ try:
+ for sFileName in asFileNames:
+ with open (sFileName, "rt", encoding="UTF8") as f:
+ print (sFileName, json.load (f))
+ finally:
+ for sFileName in asFileNames:
+ os.remove (sFileName)
diff --git a/samples/ExportParquetResult.py b/samples/ExportParquetResult.py
new file mode 100644
index 0000000..ef8a185
--- /dev/null
+++ b/samples/ExportParquetResult.py
@@ -0,0 +1,66 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to export the results from a select statement into a Parquet file.
+
+import json
+import os
+import pyarrow.parquet as pq
+import teradatasql
+
+def read_parquet_file (sFileName):
+ print ("Reading Parquet file", sFileName)
+ table = pq.read_table (sFileName)
+ col_names = table.schema.names
+ n_rows = len (table)
+ for i in range (n_rows):
+ print ("Row", i + 1, ":")
+ for col in col_names:
+ val = table [col][i].as_py ()
+ print (" {:<20} = {}".format (col, format_value (val)))
+ print ("Row count:", n_rows)
+
+def format_value (val):
+ if val is None:
+ return "NULL"
+ if isinstance (val, (bytes, bytearray)):
+ try:
+ val = val.decode ("utf-8")
+ except UnicodeDecodeError:
+ return "0x" + bytes (val).hex ().upper ()
+ s = str (val)
+ stripped = s.strip ()
+ if stripped and stripped [0] in "{[":
+ try:
+ indent = " " * 25 # 2 spaces + 20 col name width + 3 for " = "
+ return json.dumps (json.loads (stripped), indent = 2).replace ("\n", "\n" + indent)
+ except (json.JSONDecodeError, ValueError):
+ pass
+ return s
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(10)) on commit preserve rows")
+
+ print ("Inserting data")
+ cur.execute ("insert into voltab values (?, ?)", [
+ [1, "x1"],
+ [2, "x2"],
+ [3, "x3"],
+ [4, "x4"],
+ [5, "x5"],
+ [6, "x6"],
+ [7, "x7"],
+ [8, "x8"],
+ [9, "x9"],
+ ])
+
+ sFileName = "dataPy.parquet"
+ print ("Exporting table data to file", sFileName)
+ cur.execute ("{fn teradata_write_parquet(" + sFileName + ")}select * from voltab order by 1")
+
+ try:
+ read_parquet_file (sFileName)
+
+ finally:
+ print ("os.remove(" + sFileName + ")")
+ os.remove (sFileName)
diff --git a/samples/ExportParquetResults.py b/samples/ExportParquetResults.py
new file mode 100644
index 0000000..9530e8b
--- /dev/null
+++ b/samples/ExportParquetResults.py
@@ -0,0 +1,66 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to export the results from a multi-statement request into multiple Parquet files.
+
+import json
+import os
+import pyarrow.parquet as pq
+import teradatasql
+
+def read_parquet_file (nRequest, sFileName):
+ print ("\nReading Parquet file", sFileName, "for request", nRequest)
+ table = pq.read_table (sFileName)
+ col_names = table.schema.names
+ n_rows = len (table)
+ for i in range (n_rows):
+ print ("Row", i + 1, ":")
+ for col in col_names:
+ val = table [col][i].as_py ()
+ print (" {:<20} = {}".format (col, format_value (val)))
+ print ("Row count:", n_rows)
+
+def format_value (val):
+ if val is None:
+ return "NULL"
+ if isinstance (val, (bytes, bytearray)):
+ try:
+ val = val.decode ("utf-8")
+ except UnicodeDecodeError:
+ return "0x" + bytes (val).hex ().upper ()
+ s = str (val)
+ stripped = s.strip ()
+ if stripped and stripped [0] in "{[":
+ try:
+ indent = " " * 25 # 2 spaces + 20 col name width + 3 for " = "
+ return json.dumps (json.loads (stripped), indent = 2).replace ("\n", "\n" + indent)
+ except (json.JSONDecodeError, ValueError):
+ pass
+ return s
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(10)) on commit preserve rows")
+
+ print ("Inserting data")
+ cur.execute ("insert into voltab values (?, ?)", [
+ [1, "x1"],
+ [2, "x2"],
+ [3, "x3"],
+ [4, "x4"],
+ [5, "x5"],
+ [6, "x6"],
+ [7, "x7"],
+ [8, "x8"],
+ [9, "x9"],
+ ])
+
+ asFileNames = ["dataPy.parquet", "dataPy_1.parquet", "dataPy_2.parquet"]
+ print ("Exporting table data to files", asFileNames)
+ cur.execute ("{fn teradata_write_parquet(" + asFileNames [0] + ")}select * from voltab where c1 < 5 order by 1 ; select * from voltab where c1 >= 5 order by 1 ; select 'abc' as col1, '12' as col2")
+
+ try:
+ for nRequest, sFileName in enumerate (asFileNames, start = 1):
+ read_parquet_file (nRequest, sFileName)
+
+ finally:
+ [ os.remove (sFileName) for sFileName in asFileNames ]
diff --git a/samples/FakeExportJSONLResults.py b/samples/FakeExportJSONLResults.py
new file mode 100644
index 0000000..e885c5c
--- /dev/null
+++ b/samples/FakeExportJSONLResults.py
@@ -0,0 +1,41 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+# TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
+
+# This sample program demonstrates fake multi-statement results written to JSONL files.
+
+import json
+import os
+import teradatasql
+
+
+def readJSONL (sFileName):
+ with open (sFileName, "rt", encoding="UTF8") as f:
+ return [json.loads (sLine) for sLine in f]
+
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(100)) on commit preserve rows")
+
+ print ("Inserting data")
+ cur.execute ("insert into voltab values (?, ?)", [[1, "abc"], [2, None], [3, "xyz"]])
+
+ asFileNames = ["dataPy.jsonl", "dataPy_1.jsonl", "dataPy_2.jsonl", "dataPy_3.jsonl", "dataPy_4.jsonl", "dataPy_5.jsonl"]
+ print ("Exporting fake multi-statement results to files", asFileNames)
+ cur.execute ("{fn teradata_write_jsonl(" + asFileNames [0] + ")}{fn teradata_fake_result_sets}select * from voltab where c1 < 3 order by 1;select * from voltab where c1 >= 3 order by 1;select 123 as col1, 'abc' as col2")
+ try:
+ for sFileName in asFileNames:
+ print ("Reading file", sFileName)
+ rows = readJSONL (sFileName)
+ for row in rows:
+ for sColumnName in ("ColumnMetadata", "ParameterMetadata"):
+ if isinstance (row.get (sColumnName), str):
+ try:
+ row [sColumnName] = json.loads (row [sColumnName])
+ except ValueError:
+ pass
+ print (f"{sFileName}:")
+ print (json.dumps (rows, indent=2))
+ finally:
+ for sFileName in asFileNames:
+ os.remove (sFileName)
diff --git a/samples/FakeExportJSONResults.py b/samples/FakeExportJSONResults.py
new file mode 100644
index 0000000..c6651a9
--- /dev/null
+++ b/samples/FakeExportJSONResults.py
@@ -0,0 +1,31 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+# TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
+
+# This sample program demonstrates fake multi-statement results written to JSON files.
+
+import json
+import os
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(100)) on commit preserve rows")
+ cur.execute ("insert into voltab values (?, ?)", [[1, "abc"], [2, None], [3, "xyz"]])
+ asFileNames = ["dataPy.json", "dataPy_1.json", "dataPy_2.json", "dataPy_3.json", "dataPy_4.json", "dataPy_5.json"]
+ cur.execute ("{fn teradata_write_json(" + asFileNames [0] + ")}{fn teradata_fake_result_sets}select * from voltab where c1 < 3 order by 1;select * from voltab where c1 >= 3 order by 1;select 123 as col1, 'abc' as col2")
+ try:
+ for sFileName in asFileNames:
+ with open (sFileName, "rt", encoding="UTF8") as f:
+ rows = json.load (f)
+ for row in rows:
+ for sColumnName in ("ColumnMetadata", "ParameterMetadata"):
+ if isinstance (row.get (sColumnName), str):
+ try:
+ row [sColumnName] = json.loads (row [sColumnName])
+ except ValueError:
+ pass
+ print (f"{sFileName}:")
+ print (json.dumps (rows, indent=2))
+ finally:
+ for sFileName in asFileNames:
+ os.remove (sFileName)
diff --git a/samples/FakeExportParquetResults.py b/samples/FakeExportParquetResults.py
new file mode 100644
index 0000000..0d242a6
--- /dev/null
+++ b/samples/FakeExportParquetResults.py
@@ -0,0 +1,75 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to export the results from a multi-statement request into
+# multiple Parquet files and obtain info on each statement using fake_result_sets escape function.
+
+import json
+import os
+import re
+import pyarrow.parquet as pq
+import teradatasql
+
+def read_parquet_file (sFileName):
+ print ("Reading Parquet file", sFileName)
+ table = pq.read_table (sFileName)
+ col_names = table.schema.names
+ n_rows = len (table)
+ for i in range (n_rows):
+ print ("Row", i + 1, ":")
+ for col in col_names:
+ val = table [col][i].as_py ()
+ print (" {:<20} = {}".format (col, format_value (val)))
+ print ("Row count:", n_rows)
+
+def format_value (val):
+ if val is None:
+ return "NULL"
+ if isinstance (val, (bytes, bytearray)):
+ try:
+ val = val.decode ("utf-8")
+ except UnicodeDecodeError:
+ return "0x" + bytes (val).hex ().upper ()
+ s = str (val)
+ stripped = s.strip ()
+ if stripped and stripped [0] in "{[":
+ try:
+ indent = " " * 25 # 2 spaces + 20 col name width + 3 for " = "
+ return json.dumps (json.loads (stripped), indent = 2).replace ("\n", "\n" + indent)
+ except (json.JSONDecodeError, ValueError):
+ pass
+ return s
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 varchar(10)) on commit preserve rows")
+
+ print ("Inserting data")
+ cur.execute ("insert into voltab values (?, ?)", [
+ [1, "x1"],
+ [2, "x2"],
+ [3, "x3"],
+ [4, "x4"],
+ [5, "x5"],
+ [6, "x6"],
+ [7, "x7"],
+ [8, "x8"],
+ [9, "x9"],
+ ])
+
+ # When using fake_result_sets, two Parquet files are produced per statement: fake then real.
+ asFileNames = ["dataPy.parquet", "dataPy_1.parquet", "dataPy_2.parquet", "dataPy_3.parquet", "dataPy_4.parquet", "dataPy_5.parquet"]
+ print ("Exporting table data to files", asFileNames)
+ cur.execute ("{fn teradata_write_parquet(" + asFileNames [0] + ")}{fn teradata_fake_result_sets}select * from voltab where c1 < 5 order by 1 ; select * from voltab where c1 >= 5 order by 1 ; select 'abc' as col1, '12' as col2")
+
+ try:
+ print ("\n=== Two Parquet files produced by each statement (fake then real) ===")
+ for i, sFileName in enumerate (asFileNames):
+ nPostfix = int (re.sub ("\\D", "", re.sub ("^$", "0", re.sub (".*dataPy", "", re.sub ("\\.parquet$", "", sFileName)))))
+ if nPostfix % 2 == 0:
+ print ("\n --- Fake result set", nPostfix // 2 + 1, "---")
+ else:
+ print ("\n --- Real result set", (nPostfix + 1) // 2, "---")
+ read_parquet_file (sFileName)
+
+ finally:
+ [ os.remove (sFileName) for sFileName in asFileNames ]
diff --git a/samples/FastExportJSON.py b/samples/FastExportJSON.py
new file mode 100644
index 0000000..e58c1fb
--- /dev/null
+++ b/samples/FastExportJSON.py
@@ -0,0 +1,25 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+# TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
+
+# This sample program demonstrates how to FastExport into a JSON file.
+
+import json
+import os
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ sTableName = "FastExportJSON"
+ cur.execute ("create table " + sTableName + " (c1 integer, c2 varchar(10))")
+ try:
+ cur.execute ("insert into " + sTableName + " values (?, ?)", [[1, None], [2, "abc"], [3, "xyz"]])
+ sFileName = "dataPy.json"
+ sSelect = "{fn teradata_try_fastexport}{fn teradata_write_json(" + sFileName + ")}select * from " + sTableName + " order by 1"
+ cur.execute (sSelect)
+ try:
+ with open (sFileName, "rt", encoding="UTF8") as f:
+ print (json.load (f))
+ finally:
+ os.remove (sFileName)
+ finally:
+ cur.execute ("drop table " + sTableName)
diff --git a/samples/FastExportJSONL.py b/samples/FastExportJSONL.py
new file mode 100644
index 0000000..7598d15
--- /dev/null
+++ b/samples/FastExportJSONL.py
@@ -0,0 +1,34 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+# TERADATA CORPORATION CONFIDENTIAL AND TRADE SECRET
+
+# This sample program demonstrates how to FastExport into a JSONL file.
+
+import json
+import os
+import teradatasql
+
+
+def readJSONL (sFileName):
+ with open (sFileName, "rt", encoding="UTF8") as f:
+ return [json.loads (sLine) for sLine in f]
+
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ sTableName = "FastExportJSONL"
+ cur.execute ("create table " + sTableName + " (c1 integer, c2 varchar(10))")
+ try:
+ print ("Inserting data")
+ cur.execute ("insert into " + sTableName + " values (?, ?)", [[1, None], [2, "abc"], [3, "xyz"]])
+
+ sFileName = "dataPy.jsonl"
+ sSelect = "{fn teradata_try_fastexport}{fn teradata_write_jsonl(" + sFileName + ")}select * from " + sTableName + " order by 1"
+ print ("FastExporting table data to file", sFileName)
+ cur.execute (sSelect)
+ try:
+ print ("Reading file", sFileName)
+ print (readJSONL (sFileName))
+ finally:
+ os.remove (sFileName)
+ finally:
+ cur.execute ("drop table " + sTableName)
diff --git a/samples/FastExportParquet.py b/samples/FastExportParquet.py
new file mode 100644
index 0000000..f338b8a
--- /dev/null
+++ b/samples/FastExportParquet.py
@@ -0,0 +1,99 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to FastExport into a Parquet file.
+
+import json
+import os
+import pyarrow.parquet as pq
+import teradatasql
+
+def read_parquet_file (sFileName):
+ print ("Reading Parquet file", sFileName)
+ table = pq.read_table (sFileName)
+ col_names = table.schema.names
+ n_rows = len (table)
+ for i in range (n_rows):
+ print ("Row", i + 1, ":")
+ for col in col_names:
+ val = table [col][i].as_py ()
+ print (" {:<20} = {}".format (col, format_value (val)))
+ print ("Row count:", n_rows)
+
+def format_value (val):
+ if val is None:
+ return "NULL"
+ if isinstance (val, (bytes, bytearray)):
+ try:
+ val = val.decode ("utf-8")
+ except UnicodeDecodeError:
+ return "0x" + bytes (val).hex ().upper ()
+ s = str (val)
+ stripped = s.strip ()
+ if stripped and stripped [0] in "{[":
+ try:
+ indent = " " * 25 # 2 spaces + 20 col name width + 3 for " = "
+ return json.dumps (json.loads (stripped), indent = 2).replace ("\n", "\n" + indent)
+ except (json.JSONDecodeError, ValueError):
+ pass
+ return s
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ with con.cursor () as cur2:
+ sTableName = "FastExportParquet"
+ try:
+ sRequest = "DROP TABLE " + sTableName
+ print (sRequest)
+ cur.execute (sRequest)
+ except Exception as ex:
+ print ("Ignoring", str (ex).split ("\n") [0])
+
+ sRequest = "CREATE TABLE " + sTableName + " (c1 INTEGER NOT NULL, c2 VARCHAR(10))"
+ print (sRequest)
+ cur.execute (sRequest)
+
+ try:
+ sInsert = "INSERT INTO " + sTableName + " VALUES (?, ?)"
+ print (sInsert)
+ cur.execute (sInsert, [
+ [1, None],
+ [2, "x2"],
+ [3, "x3"],
+ [4, "x4"],
+ [5, None],
+ [6, "x6"],
+ [7, "x7"],
+ [8, "x8"],
+ [9, None],
+ ])
+
+ sFileName = "dataPy.parquet"
+ sSelect = "{fn teradata_try_fastexport}{fn teradata_write_parquet(" + sFileName + ")}SELECT * FROM " + sTableName
+ print (sSelect)
+ cur.execute (sSelect)
+ try:
+ read_parquet_file (sFileName)
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_warnings}" + sSelect
+ print (sRequest)
+ cur2.execute (sRequest)
+ [ print (row) for row in cur2.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_errors}" + sSelect
+ print (sRequest)
+ cur2.execute (sRequest)
+ [ print (row) for row in cur2.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_logon_sequence_number}" + sSelect
+ print (sRequest)
+ cur2.execute (sRequest)
+ [ print (row) for row in cur2.fetchall () ]
+
+ finally:
+ print ("os.remove(" + sFileName + ")")
+ os.remove (sFileName)
+
+ finally:
+ sRequest = "DROP TABLE " + sTableName
+ print (sRequest)
+ cur.execute (sRequest)
diff --git a/samples/FastLoadJSON.py b/samples/FastLoadJSON.py
new file mode 100644
index 0000000..466ccfa
--- /dev/null
+++ b/samples/FastLoadJSON.py
@@ -0,0 +1,124 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to FastLoad a JSON file.
+# It also illustrates dual treatment of a nested JSON object: the raw JSON
+# string is stored verbatim in the "address" column, while the flattened
+# sub-field "city" is stored in a separate column.
+
+
+import json
+import os
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ sTableName = "FastLoadJSON"
+ sRequest = "DROP TABLE " + sTableName
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ sRequest = "DROP TABLE " + sTableName + "_ERR_1"
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ sRequest = "DROP TABLE " + sTableName + "_ERR_2"
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ # Each record has three top-level keys:
+ # id -- scalar integer
+ # name -- scalar string
+ # address -- nested object; its raw JSON string maps to the "address" column
+ # and its sub-field "city" maps to the "city" column.
+ records = [
+ {"id": 1, "name": "Alice", "address": {"city": "Boston"}},
+ {"id": 2, "name": "Bob", "address": {"city": "Austin"}},
+ {"id": 3, "name": "Carol", "address": {"city": "Chicago"}},
+ {"id": 4, "name": "Dave", "address": {"city": "Denver"}},
+ {"id": 5, "name": "Erin", "address": {"city": "Eugene"}},
+ {"id": 6, "name": "Frank", "address": {"city": "Fresno"}},
+ {"id": 7, "name": "Grace", "address": {"city": "Houston"}},
+ {"id": 8, "name": "Hank", "address": {"city": "Irvine"}},
+ {"id": 9, "name": "Iris", "address": {"city": "Jacksonville"}},
+ ]
+
+ jsonFileName = "dataPy.json"
+ print (f"Writing {jsonFileName}")
+ with open (jsonFileName, "w", encoding="UTF-8") as f:
+ json.dump (records, f)
+
+ try:
+ sRequest = "CREATE TABLE " + sTableName + " (id INTEGER, name VARCHAR(20), address VARCHAR(200), city VARCHAR(20)) UNIQUE PRIMARY INDEX (id)"
+ print (sRequest)
+ cur.execute (sRequest)
+
+ try:
+ print ("con.autocommit = False")
+ con.autocommit = False
+
+ try:
+ # The INSERT column list (id, name, address, city) drives name-based matching:
+ # ?1 -> id (scalar)
+ # ?2 -> name (scalar)
+ # ?3 -> address (raw JSON object string -- dual treatment)
+ # ?4 -> city (flattened sub-field of address)
+ sInsert = (
+ "{fn teradata_require_fastload}"
+ "{fn teradata_read_json(" + jsonFileName + ")}"
+ "INSERT INTO " + sTableName + " (id, name, address, city) VALUES (?, ?, ?, ?)"
+ )
+ print (sInsert)
+ cur.execute (sInsert)
+
+ # obtain the warnings and errors for transmitting the data to the database -- the acquisition phase
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_warnings}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_errors}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_logon_sequence_number}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ print ("con.commit()")
+ con.commit ()
+
+ # obtain the warnings and errors for the apply phase
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_warnings}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_errors}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ finally:
+ print ("con.autocommit = True")
+ con.autocommit = True
+
+ sRequest = "SELECT id, name, address, city FROM " + sTableName + " ORDER BY 1"
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ finally:
+ sRequest = "DROP TABLE " + sTableName
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ finally:
+ print (f"os.remove({jsonFileName})")
+ try:
+ os.remove (jsonFileName)
+ except OSError as e:
+ print (f"os.remove failed: {e}")
diff --git a/samples/FastLoadJSONL.py b/samples/FastLoadJSONL.py
new file mode 100644
index 0000000..b440eff
--- /dev/null
+++ b/samples/FastLoadJSONL.py
@@ -0,0 +1,109 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to FastLoad a JSONL file.
+# It demonstrates key-order independence and explicit NULL handling.
+
+import os
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ sTableName = "FastLoadJSONL"
+
+ sRequest = "DROP TABLE " + sTableName
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ sRequest = "DROP TABLE " + sTableName + "_ERR_1"
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ sRequest = "DROP TABLE " + sTableName + "_ERR_2"
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ jsonlFileName = "dataPy.jsonl"
+ print (f"Writing {jsonlFileName}")
+
+ lines = [
+ '{"c1":1,"c2":"x1","c3":[0.10,-0.20,0.30]}',
+ '{"c2":"x2","c1":2,"c3":[0.20,-0.40,0.60]}',
+ '{"c3":[0.30,-0.60,0.90],"c1":3,"c2":"x3"}',
+ '{"c1":4,"c2":"x4","c3":[0.40,-0.80,1.20]}',
+ '{"c1":5,"c2":null,"c3":[0.50,-1.00,1.50]}',
+ '{"c1":6,"c2":"x6","c3":[0.60,-1.20,1.80]}',
+ '{"c1":7,"c2":"x7","c3":[0.70,-1.40,2.10]}',
+ '{"c1":8,"c2":"x8","c3":[0.80,-1.60,2.40]}',
+ '{"c1":9,"c2":"x9","c3":[0.90,-1.80,2.70]}',
+ ]
+
+ with open (jsonlFileName, "w", encoding="UTF-8") as f:
+ for line in lines:
+ f.write (line + "\n")
+
+ try:
+ sRequest = "CREATE TABLE " + sTableName + " (c1 INTEGER NOT NULL, c2 VARCHAR(10), c3 VECTOR) UNIQUE PRIMARY INDEX (c1)"
+ print (sRequest)
+ cur.execute (sRequest)
+
+ try:
+ print ("con.autocommit = False")
+ con.autocommit = False
+
+ try:
+ sInsert = (
+ "{fn teradata_require_fastload}" +
+ "{fn teradata_read_jsonl(" + jsonlFileName + ")}" +
+ "INSERT INTO " + sTableName + " (c1, c2, c3) VALUES (?, ?, ?)"
+ )
+ print (sInsert)
+ cur.execute (sInsert)
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_warnings}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_errors}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_logon_sequence_number}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ print ("con.commit()")
+ con.commit ()
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_warnings}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_errors}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ finally:
+ print ("con.autocommit = True")
+ con.autocommit = True
+
+ sRequest = "SELECT c1, c2, c3 FROM " + sTableName + " ORDER BY 1"
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ finally:
+ sRequest = "DROP TABLE " + sTableName
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ finally:
+ print (f"os.remove({jsonlFileName})")
+ try:
+ os.remove (jsonlFileName)
+ except OSError as e:
+ print (f"os.remove failed: {e}")
diff --git a/samples/FastLoadParquet.py b/samples/FastLoadParquet.py
new file mode 100644
index 0000000..68a0952
--- /dev/null
+++ b/samples/FastLoadParquet.py
@@ -0,0 +1,107 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to FastLoad a Parquet file.
+
+import os
+import teradatasql
+import pyarrow as pa
+import pyarrow.parquet as pq
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ sTableName = "FastLoadParquet"
+ sRequest = "DROP TABLE " + sTableName
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ sRequest = "DROP TABLE " + sTableName + "_ERR_1"
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ sRequest = "DROP TABLE " + sTableName + "_ERR_2"
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ # Create Parquet file with sample data
+ parquetFileName = "dataPy.parquet"
+ print (f"Creating Parquet file: {parquetFileName}")
+
+ # Create data arrays
+ data = {
+ 'c1': [1, 2, 3, 4, 5, 6, 7, 8, 9],
+ 'c2': ['test1', 'test2', 'test3', 'test4', 'test5', 'test6', 'test7', 'test8', 'test9']
+ }
+
+ # Create Arrow table
+ table = pa.table (data)
+
+ # Write Parquet file
+ pq.write_table (table, parquetFileName)
+ print ("Parquet file created successfully")
+
+ try:
+ sRequest = "CREATE TABLE " + sTableName + " (c1 INTEGER, c2 VARCHAR(10))"
+ print (sRequest)
+ cur.execute (sRequest)
+
+ try:
+ print ("con.autocommit = False")
+ con.autocommit = False
+
+ try:
+ sInsert = "{fn teradata_require_fastload}{fn teradata_read_parquet(" + parquetFileName + ")}INSERT INTO " + sTableName + " (?, ?)"
+ print (sInsert)
+ cur.execute (sInsert)
+
+ # obtain the warnings and errors for transmitting the data to the database -- the acquisition phase
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_warnings}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_errors}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_logon_sequence_number}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ print ("con.commit()")
+ con.commit ()
+
+ # obtain the warnings and errors for the apply phase
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_warnings}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ sRequest = "{fn teradata_nativesql}{fn teradata_get_errors}" + sInsert
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ finally:
+ print ("con.autocommit = True")
+ con.autocommit = True
+
+ sRequest = "SELECT * FROM " + sTableName + " ORDER BY 1"
+ print (sRequest)
+ cur.execute (sRequest)
+ [ print (row) for row in cur.fetchall () ]
+
+ finally:
+ sRequest = "DROP TABLE " + sTableName
+ print (sRequest)
+ cur.execute (sRequest, ignoreErrors=3807)
+
+ finally:
+ print (f"os.remove({parquetFileName})")
+ try:
+ os.remove (parquetFileName)
+ except OSError as e:
+ print (f"os.remove failed: {e}")
diff --git a/samples/InsertVector.py b/samples/InsertVector.py
new file mode 100644
index 0000000..931b7ec
--- /dev/null
+++ b/samples/InsertVector.py
@@ -0,0 +1,45 @@
+# Copyright 2025 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates how to insert values into a Vector column.
+
+import numpy as np
+import pandas as pd
+import teradatasql
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table voltab (c1 integer, c2 vector) on commit preserve rows")
+
+ # Example 1 - bind values as list of lists
+ # Vector values are string having VARCHAR format compatible with Vector
+ cur.execute ("insert into voltab values (?, ?)", [
+ [1, "1.7,1.8,1.9"],
+ [2, "2.7,2.8,2.9"],
+ ])
+
+ # Example 2 - bind values as list of lists
+ # Vector values are one-dimensional numpy arrays, both float32 and float64 are supported
+ cur.execute ("insert into voltab values (?, ?)", [
+ [3, np.array ([3.7, 3.8, 3.9], dtype=np.float32)],
+ [4, np.array ([4.7, 4.8, 4.9], dtype=np.float64)],
+ ])
+
+ # Example 3 - bind values as pandas DataFrame constructed from list of lists
+ # Vector values are one-dimensional numpy arrays, both float32 and float64 are supported
+ df = pd.DataFrame ([
+ [5, np.array ([5.7, 5.8, 5.9], dtype=np.float32)],
+ [6, np.array ([6.7, 6.8, 6.9], dtype=np.float64)],
+ ], columns=["c1", "c2"])
+ cur.execute ("insert into voltab values (?, ?)", df)
+
+ # Example 4 - bind values as pandas DataFrame constructed from dictionary
+ # Vector values are one-dimensional numpy arrays, both float32 and float64 are supported
+ df = pd.DataFrame ({
+ "c1": [7, 8],
+ "c2": [np.array ([7.7, 7.8, 7.9], dtype=np.float32), np.array ([8.7, 8.8, 8.9], dtype=np.float64)],
+ })
+ cur.execute ("insert into voltab values (?, ?)", df)
+
+ cur.execute ("set transform group for type vector vector_io_varchar")
+ cur.execute ("select * from voltab order by 1")
+ [ print (row) for row in cur.fetchall () ]
diff --git a/samples/LoadParquetFile.py b/samples/LoadParquetFile.py
new file mode 100644
index 0000000..838cb86
--- /dev/null
+++ b/samples/LoadParquetFile.py
@@ -0,0 +1,29 @@
+# Copyright 2026 by Teradata Corporation. All rights reserved.
+
+# This sample program demonstrates two different approaches to load data values
+# from a Parquet file and insert those data values into a database table.
+# This sample program requires the airports.parquet file to be located in the current directory.
+
+import teradatasql
+import pyarrow.parquet as pq
+
+with teradatasql.connect (host="whomooz", user="guest", password="please") as con:
+ with con.cursor () as cur:
+ cur.execute ("create volatile table Airports (City varchar(100), Airport varchar(100), AirportCode varchar(10)) on commit preserve rows")
+
+ print ("Slower approach - use pyarrow to parse data values from a Parquet file")
+ table = pq.read_table ("airports.parquet")
+ listRows = table.to_batches () [0].to_pylist ()
+ data = [ [ row ['City'], row ['Airport'], row ['AirportCode'] ] for row in listRows ]
+ cur.execute ("insert into Airports (?, ?, ?)", data)
+
+ cur.execute ("select AirportCode, Airport, City from Airports order by AirportCode")
+ [ print (row) for row in cur.fetchall () ]
+
+ cur.execute ("delete from Airports")
+
+ print ("Faster approach - the driver loads data values from a Parquet file")
+ cur.execute ("{fn teradata_read_parquet(airports.parquet)}insert into Airports (?, ?, ?)")
+
+ cur.execute ("select AirportCode, Airport, City from Airports order by AirportCode")
+ [ print (row) for row in cur.fetchall () ]
diff --git a/samples/MonitorAbort.py b/samples/MonitorAbort.py
index 3adfced..19767f3 100644
--- a/samples/MonitorAbort.py
+++ b/samples/MonitorAbort.py
@@ -3,6 +3,7 @@
# This sample program demonstrates how to use the Monitor partition to abort a session.
# The database user must have the MONITOR privilege: GRANT MONITOR TO guest
+import re
import teradatasql
def abortSession (nHostNumber, nSessionNumber):
@@ -33,6 +34,10 @@ def conciseError (ex):
sOutput += " " + sLine
return sOutput
+def getErrorCode (s):
+ mat = re.compile ("\\[Error (\\d+)\\]").search (s)
+ return int (mat.group (1)) if mat and mat.lastindex == 1 else 0
+
con = teradatasql.connect (host="whomooz", user="guest", password="please")
with con.cursor () as cur:
sQuery = "SELECT HostNo, SessionNo FROM DBC.SessionInfoV WHERE SessionNo = SESSION"
@@ -47,7 +52,7 @@ def conciseError (ex):
con.close ()
except Exception as ex:
s = conciseError (ex)
- if "[Error 503]" in s or "[Error 3000]" in s:
+ if getErrorCode (s) in [ 301, 503, 3000 ]:
print ("Ignoring", s)
else:
raise # rethrow
diff --git a/samples/TJEncryptPassword.py b/samples/TJEncryptPassword.py
index 2322e89..f21fc6b 100644
--- a/samples/TJEncryptPassword.py
+++ b/samples/TJEncryptPassword.py
@@ -286,6 +286,7 @@
import Crypto.Cipher
import Crypto.Cipher.AES
import Crypto.Hash
+import Crypto.Hash.HMAC
import Crypto.Hash.SHA1
import Crypto.Hash.SHA256
import Crypto.Random
@@ -496,7 +497,7 @@ def decryptPassword (sPassKeyFileName, sEncPassFileName):
if len (sys.argv) != 9:
print ("Parameters: Transformation KeySizeInBits MAC PasswordEncryptionKeyFileName EncryptedPasswordFileName Hostname Username Password")
- exit (1)
+ sys.exit (1)
sTransformation = sys.argv [1]
sKeySizeInBits = sys.argv [2]
diff --git a/samples/airports.parquet b/samples/airports.parquet
new file mode 100644
index 0000000..6bbef8d
Binary files /dev/null and b/samples/airports.parquet differ