Airflow Summit 2025 is coming October 07-09. Register now for early bird ticket!

airflow.providers.teradata.utils.bteq_util

Functions

verify_bteq_installed()

Verify if BTEQ is installed and available in the system's PATH.

verify_bteq_installed_remote(ssh_client)

Verify if BTEQ is installed on the remote machine.

transfer_file_sftp(ssh_client, local_path, remote_path)

prepare_bteq_script_for_remote_execution(conn, sql)

Build a BTEQ script with necessary connection and session commands.

prepare_bteq_script_for_local_execution(sql)

Build a BTEQ script with necessary connection and session commands.

prepare_bteq_command_for_remote_execution(timeout, ...)

Prepare the BTEQ command with necessary parameters.

prepare_bteq_command_for_local_execution(conn, ...)

Prepare the BTEQ command with necessary parameters.

is_valid_file(file_path)

is_valid_encoding(file_path[, encoding])

Check if the file can be read with the specified encoding.

read_file(file_path[, encoding])

Read the content of a file with the specified encoding.

is_valid_remote_bteq_script_file(ssh_client, ...[, logger])

Check if the given remote file path is a valid BTEQ script file.

Module Contents

airflow.providers.teradata.utils.bteq_util.verify_bteq_installed()[source]

Verify if BTEQ is installed and available in the system’s PATH.

airflow.providers.teradata.utils.bteq_util.verify_bteq_installed_remote(ssh_client)[source]

Verify if BTEQ is installed on the remote machine.

airflow.providers.teradata.utils.bteq_util.transfer_file_sftp(ssh_client, local_path, remote_path)[source]
airflow.providers.teradata.utils.bteq_util.prepare_bteq_script_for_remote_execution(conn, sql)[source]

Build a BTEQ script with necessary connection and session commands.

airflow.providers.teradata.utils.bteq_util.prepare_bteq_script_for_local_execution(sql)[source]

Build a BTEQ script with necessary connection and session commands.

airflow.providers.teradata.utils.bteq_util.prepare_bteq_command_for_remote_execution(timeout, bteq_script_encoding, bteq_session_encoding, timeout_rc)[source]

Prepare the BTEQ command with necessary parameters.

airflow.providers.teradata.utils.bteq_util.prepare_bteq_command_for_local_execution(conn, timeout, bteq_script_encoding, bteq_session_encoding, timeout_rc)[source]

Prepare the BTEQ command with necessary parameters.

airflow.providers.teradata.utils.bteq_util.is_valid_file(file_path)[source]
airflow.providers.teradata.utils.bteq_util.is_valid_encoding(file_path, encoding='UTF-8')[source]

Check if the file can be read with the specified encoding.

Parameters:
  • file_path (str) – Path to the file to be checked.

  • encoding (str) – Encoding to use for reading the file.

Returns:

True if the file can be read with the specified encoding, False otherwise.

Return type:

bool

airflow.providers.teradata.utils.bteq_util.read_file(file_path, encoding='UTF-8')[source]

Read the content of a file with the specified encoding.

Parameters:
  • file_path (str) – Path to the file to be read.

  • encoding (str) – Encoding to use for reading the file.

Returns:

Content of the file as a string.

Return type:

str

airflow.providers.teradata.utils.bteq_util.is_valid_remote_bteq_script_file(ssh_client, remote_file_path, logger=None)[source]

Check if the given remote file path is a valid BTEQ script file.

Was this entry helpful?