airflow.providers.teradata.hooks.tpt¶
Classes¶
Hook for executing Teradata Parallel Transporter (TPT) operations. |
Module Contents¶
- class airflow.providers.teradata.hooks.tpt.TptHook(ssh_conn_id=None, *args, **kwargs)[source]¶
Bases:
airflow.providers.teradata.hooks.ttu.TtuHookHook for executing Teradata Parallel Transporter (TPT) operations.
This hook provides methods to execute TPT operations both locally and remotely via SSH. It supports DDL operations using tbuild utility. It extends the TtuHook and integrates with Airflow’s SSHHook for remote execution.
The TPT operations are used to interact with Teradata databases for DDL operations such as creating, altering, or dropping tables.
Features: - Supports both local and remote execution of TPT operations. - Secure file encryption for remote transfers. - Comprehensive error handling and logging. - Resource cleanup and management.
See also
- Parameters:
ssh_conn_id (str | None) – SSH connection ID for remote execution. If None, executes locally.
- execute_ddl(tpt_script, remote_working_dir)[source]¶
Execute a DDL statement using TPT.
- Args:
tpt_script: TPT script content as string or list of strings remote_working_dir: Remote working directory for SSH execution
- Returns:
Exit code from the TPT operation
- Raises:
ValueError: If tpt_script is empty or invalid RuntimeError: Non-zero tbuild exit status or unexpected execution failure ConnectionError: SSH connection not established or fails TimeoutError: SSH connection/network timeout FileNotFoundError: tbuild binary not found in PATH