Skip to content

Presto

Bases: Spout

__init__(output, state, **kwargs)

Initialize the Presto 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 Presto rise \
    batch \
        --output_s3_bucket my_bucket \
        --output_s3_folder s3/folder \
    none \
    fetch \
        --args host=mypresto.example.com username=myusername password=mypassword catalog=mycatalog schema=myschema table=mytable

Using geniusrise to invoke via YAML file

version: "1"
spouts:
    my_presto_spout:
        name: "Presto"
        method: "fetch"
        args:
            host: "mypresto.example.com"
            username: "myusername"
            password: "mypassword"
            catalog: "mycatalog"
            schema: "myschema"
            table: "mytable"
        output:
            type: "batch"
            args:
                bucket: "my_bucket"
                s3_folder: "s3/folder"

fetch(host, username, password, catalog, schema, table)

📖 Fetch data from a Presto table and save it in batch.

Parameters:

Name Type Description Default
host str

The Presto host.

required
username str

The Presto username.

required
password str

The Presto password.

required
catalog str

The Presto catalog name.

required
schema str

The Presto schema name.

required
table str

The name of the Presto table.

required

Raises:

Type Description
Exception

If unable to connect to the Presto server or execute the command.