blob: 64694d04384fb1cefd556bf9ef9ffa0e487097c2 [file] [log] [blame]
:py:mod:`airflow.providers.trino.transfers.gcs_to_trino`
========================================================
.. py:module:: airflow.providers.trino.transfers.gcs_to_trino
.. autoapi-nested-parse::
This module contains Google Cloud Storage to Trino operator.
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.trino.transfers.gcs_to_trino.GCSToTrinoOperator
.. py:class:: GCSToTrinoOperator(*, source_bucket, source_object, trino_table, trino_conn_id = 'trino_default', gcp_conn_id = 'google_cloud_default', schema_fields = None, schema_object = None, delegate_to = None, impersonation_chain = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
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
:param source_bucket: Source GCS bucket that contains the csv
:param source_object: csv file including the path
:param trino_table: trino table to upload the data
:param trino_conn_id: destination trino connection
:param gcp_conn_id: (Optional) The connection ID used to connect to Google Cloud and
interact with the Google Cloud Storage service.
:param schema_fields: The names of the columns to fill in the table. If schema_fields is
provided, any path provided in the schema object will be
:param schema_object: JSON file with schema fields
:param delegate_to: The 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.
:param impersonation_chain: Optional 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.
.. py:attribute:: template_fields
:annotation: :Sequence[str] = ['source_bucket', 'source_object', 'trino_table']
.. py:method:: execute(self, context)
This is the main method to derive when creating an operator.
Context is the same dictionary used as when rendering jinja templates.
Refer to get_template_context for more context.