Copy data from Cassandra to Google Cloud Storage in JSON format

View on GitHub

Last Updated: Jan. 23, 2023

Access Instructions

Install the Google provider package into your Airflow environment.

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


cqlRequiredThe CQL to execute on the Cassandra table.
bucketRequiredThe bucket to upload to.
filenameRequiredThe filename to use as the object name when uploading to Google Cloud Storage. A {} should be specified in the filename to allow the operator to inject file numbers in cases where the file is split due to size.
schema_filenameIf set, the filename to use as the object name when uploading a .json file containing the BigQuery schema fields for the table that was dumped from MySQL.
approx_max_file_size_bytesThis operator supports the ability to split large table dumps into multiple files (see notes in the filename param docs above). This param allows developers to specify the file size of the splits. Check to see the maximum allowed file size for a single object.
cassandra_conn_idReference to a specific Cassandra hook.
gzipOption to compress file for upload
gcp_conn_id(Optional) The connection ID used to connect to Google Cloud.
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 (templated).
query_timeout(Optional) The amount of time, in seconds, used to execute the Cassandra query. If not set, the timeout value will be set in Session.execute() by Cassandra driver. If set to None, there is no timeout.
encode_uuid(Optional) Option to encode UUID or not when upload from Cassandra to GCS. Default is to encode UUID.


Copy data from Cassandra to Google Cloud Storage in JSON format

Note: Arrays of arrays are not supported.

Was this page helpful?