GCSToTrinoOperator

Trino

Loads a csv file from Google Cloud Storage into a Trino table. Assumptions: 1. CSV file should not have headers 2. Trino table with requisite columns is already created 3. Optionally, a separate JSON file with headers can be provided

View on GitHub

Last Updated: Jan. 23, 2023

Access Instructions

Install the Trino provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

source_bucketRequiredSource GCS bucket that contains the csv
source_objectRequiredcsv file including the path
trino_tableRequiredtrino table to upload the data
trino_conn_iddestination trino connection
gcp_conn_id(Optional) The connection ID used to connect to Google Cloud and interact with the Google Cloud Storage service.
schema_fieldsThe names of the columns to fill in the table. If schema_fields is provided, any path provided in the schema object will be
schema_objectJSON file with schema fields
delegate_toThe account to impersonate using domain-wide delegation of authority, if any. For this to work, the service account making the request must have domain-wide delegation enabled.
impersonation_chainOptional service account to impersonate using short-term credentials, or chained list of accounts required to get the access_token of the last account in the list, which will be impersonated in the request. If set as a string, the account must grant the originating account the Service Account Token Creator IAM role. If set as a sequence, the identities from the list must grant Service Account Token Creator IAM role to the directly preceding identity, with first account from the list granting this role to the originating account.

Documentation

Loads a csv file from Google Cloud Storage into a Trino table. Assumptions: 1. CSV file should not have headers 2. Trino table with requisite columns is already created 3. Optionally, a separate JSON file with headers can be provided

Was this page helpful?