Skip to content

Couchbase

Bases: Spout

__init__(output, state, **kwargs)

Initialize the Spanner class.

Parameters:

Name Type Description Default
output BatchOutput

An instance of the BatchOutput class for saving the data.

required
state State

An instance of the State class for maintaining the state.

required
**kwargs

Additional keyword arguments.

{}

Using geniusrise to invoke via command line

genius Spanner rise \
    batch \
        --output_s3_bucket my_bucket \
        --output_s3_folder s3/folder \
    none \
    fetch \
        --project_id my_project_id instance_id=my_instance database_id=my_database table_id=my_table

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_spanner_spout:
        name: "Spanner"
        method: "fetch"
        args:
            project_id: "my_project_id"
            instance_id: "my_instance"
            database_id: "my_database"
            table_id: "my_table"
        output:
            type: "batch"
            args:
                bucket: "my_bucket"
                s3_folder: "s3/folder"

fetch(project_id, instance_id, database_id, table_id)

📖 Fetch data from a Spanner database and save it in batch.

Parameters:

Name Type Description Default
project_id str

The Google Cloud project ID.

required
instance_id str

The Spanner instance ID.

required
database_id str

The Spanner database ID.

required
table_id str

The Spanner table ID.

required

Raises:

Type Description
Exception

If unable to connect to the Spanner database or execute the query.