MemSQL¶
Bases: Spout
__init__(output, state, **kwargs)
¶
Initialize the MemSQL 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 MemSQL rise \
batch \
--output_s3_bucket my_bucket \
--output_s3_folder s3/folder \
none \
fetch \
--args host=mymemsqlhost user=myuser password=<PASSWORD> database=mydatabase query="SELECT * FROM mytable"
Using geniusrise to invoke via YAML file¶
fetch(host, user, password, database, query)
¶
📖 Fetch data from a MemSQL database and save it in batch.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host |
str
|
The MemSQL host. |
required |
user |
str
|
The MemSQL user. |
required |
password |
str
|
The MemSQL password. |
required |
database |
str
|
The MemSQL database name. |
required |
query |
str
|
The SQL query to execute. |
required |
Raises:
Type | Description |
---|---|
Exception
|
If unable to connect to the MemSQL server or execute the query. |