airflow.providers.google.cloud.transfers.presto_to_gcs
¶
Module Contents¶
-
class
airflow.providers.google.cloud.transfers.presto_to_gcs.
_PrestoToGCSPrestoCursorAdapter
(cursor: PrestoCursor)[source]¶ An adapter that adds additional feature to the Presto cursor.
The implementation of cursor in the prestodb library is not sufficient. The following changes have been made:
The poke mechanism for row. You can look at the next row without consuming it.
The description attribute is available before reading the first row. Thanks to the poke mechanism.
the iterator interface has been implemented.
A detailed description of the class methods is available in PEP-249.
-
description
[source]¶ This read-only attribute is a sequence of 7-item sequences.
Each of these sequences contains information describing one result column:
name
type_code
display_size
internal_size
precision
scale
null_ok
The first two items (
name
andtype_code
) are mandatory, the other five are optional and are set to None if no meaningful values can be provided.
-
execute
(self, *args, **kwargs)[source]¶ Prepare and execute a database operation (query or command).
-
executemany
(self, *args, **kwargs)[source]¶ Prepare a database operation (query or command) and then execute it against all parameter sequences or mappings found in the sequence seq_of_parameters.
-
fetchone
(self)[source]¶ Fetch the next row of a query result set, returning a single sequence, or
None
when no more data is available.
-
fetchmany
(self, size=None)[source]¶ Fetch the next set of rows of a query result, returning a sequence of sequences (e.g. a list of tuples). An empty sequence is returned when no more rows are available.
-
class
airflow.providers.google.cloud.transfers.presto_to_gcs.
PrestoToGCSOperator
(*, presto_conn_id: str = 'presto_default', **kwargs)[source]¶ Bases:
airflow.providers.google.cloud.transfers.sql_to_gcs.BaseSQLToGCSOperator
Copy data from PrestoDB to Google Cloud Storage in JSON or CSV format.
- Parameters
presto_conn_id (str) -- Reference to a specific Presto hook.