GCSToPrestoOperator

Presto

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

View on GitHub

Last Updated: Jan. 23, 2023

Access Instructions

Install the Presto 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
presto_tableRequiredpresto table to upload the data
presto_conn_iddestination presto connection
gcp_conn_id(Optional) The connection ID used to connect to Google Cloud and interact with the Google Cloud Storage service.
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 Presto table. Assumptions: 1. CSV file should not have headers 2. Presto table with requisite columns is already created 3. Optionally, a separate JSON file with headers or list of headers can be provided

Was this page helpful?