Class - mitto.iov2.types.OutputSection
¶
JSON Schema¶
OutputSection¶
Top-level job configuration section that defines where data will be output. Example job configuration fragment: {
input: {...}
output: {
dbo: postgresql://db/analytics
schema: test_schema
tablename: test_table
use: call:mitto.iov2.db#todb
}
steps: [...]
}
Example MS SQLServer job configuration fragment: output: {
dbo: mssql+pyodbc://user:pass!@warehouse\mssqlserver08/somedb?driver=ODBC+Driver+17+for+SQL+Server&UseFMTONLY=Yes
schema: test_schema
tablename: test_table
use: call:mitto.iov2.db#todb
query_params: {
fast_executemany: false
}
engine_kwargs: {
fast_executemany: false
pool_recycle: 12000
}
}
Example Redshift job configuration fragment: output: {
dbo: redshift+psycopg2://username:password@zuar-redshift.c8xy937zxyyx.us-east-1.redshift.amazonaws.com:5439/dev
credentials: {
bucket: east1.redshift.zuar.com
s3_access_key: AKIAYL4WNSO6DLPL7L6E
s3_secret_key: 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
}
schema: test_schema
tablename: test_table
use: call:mitto.iov2.db#todb
}
|
|||
type |
object |
||
properties |
|||
|
Use |
||
The Python function that will be used to output data. |
|||
type |
string |
||
examples |
call:mitto.iov2.db#todb |
||
call:mitto.iov2#null |
|||
call:mitto.iov2#tocsv |
|||
call:mitto.iov2.tojson#tojson |
|||
|
Dbo |
||
Connection string of the output database. The string contain actual credentials or named credentials. The first example shows a string containing credentials. The second example shows the use credentials named: steves-creds. See this page for more information. |
|||
examples |
postgresql://steve:steves-password@zuar.net/analytics |
||
postgresql://steves-creds@zuar.net/analytics |
|||
redshift+psycopg2://username:password@zuar-redshift.c8xy937zxyyx.us-east-1.redshift.amazonaws.com:5439/dev |
|||
|
Schema |
||
The name of the schema in the output database. Placed in the job’s execution environment as SCHEMA. |
|||
type |
string |
||
|
Tablename |
||
Name of the table in the output database. Placed in the job’s execution environment as both TABLE and and ORIGIN_TABLE. |
|||
type |
string |
||
|
Credentials |
||
|
|||
examples |
steves-creds |
||
{“username”: “steve”, “password”: “steves-pass”} |
|||
{“bucket”: “east1.redshift.zuar.com”, “s3_access_key”: “AKIAYL4SRFE6DLPL7L6E”, “s3_secret_key”: “eB/0bfoAoYBfMIugYVttIBUHOMUtvmBWuF+qyQer”} |
|||
anyOf |
type |
string |
|
|
Engine Kwargs |
||
Parameters passed to create_engine. |
|||
allOf |
|||
|
Location |
||
Deprecated. Use “engine_kwargs”: {“location”: “some-location”} instead. |
|||
type |
string |
||
|
Query Params |
||
MS SQLServer only. |
|||
allOf |
|||
|
Truncate |
||
If ‘true’, the output table is truncated before writing data. |
|||
type |
boolean |
||
examples |
true |
||
false |
|||
default |
True |
||
definitions |
|||
|
BasicCredentials |
||
Basic credentials: username/password. |
|||
type |
object |
||
properties |
|||
|
Username |
||
The username. |
|||
type |
string |
||
minLength |
1 |
||
|
Password |
||
The password. |
|||
type |
string |
||
minLength |
1 |
||
format |
password |
||
|
GenericCredentials |
||
Generic credentials - any arbitrary dict. Used for arbitrary credentials for which no specific credential type is available. |
|||
type |
object |
||
properties |
|||
|
Value |
||
Arbitrary credentials formatted as a JSON string |
|||
type |
string |
||
examples |
{“client_id”: “some-id”, “client_secret”: “some-secret”} |
||
default |
{ } |
||
format |
json |
||
|
GoogleServiceAccountCredentials |
||
Credentials for Google BigQuery. See this document for information on creating the credentials. |
|||
type |
object |
||
properties |
|||
|
Type |
||
type |
string |
||
default |
service_account |
||
|
Project Id |
||
type |
string |
||
default |
mitto-183418 |
||
|
Private Key Id |
||
type |
string |
||
|
Private Key |
||
type |
string |
||
|
Client Email |
||
type |
string |
||
|
Client Id |
||
type |
string |
||
|
Auth Uri |
||
type |
string |
||
|
Token Uri |
||
type |
string |
||
default |
|||
|
Auth Provider X509 Cert Url |
||
type |
string |
||
default |
|||
|
Client X509 Cert Url |
||
type |
string |
||
|
RedshiftCredentials |
||
Credentials for AWS Redshift. |
|||
type |
object |
||
properties |
|||
|
S3 Access Key |
||
type |
string |
||
|
S3 Secret Key |
||
type |
string |
||
|
Bucket |
||
type |
string |
||
|
SQLServerQueryParameters |
||
Cursor parameters for MS SQLServer. NOTE: This is only used with MS SQLServer. This value is passed to cursor.fast_executemany. This value should match the value of engine_kwargs.fast_executemany present in the same output section. |
|||
type |
object |
||
properties |
|||
|
Fast Executemany |
||
Used to set fast_executemany on the cursor before execution. |
|||
type |
boolean |
||
|
EngineKwArgs |
||
Runner uses SQLAlchemy to interact with databases. Runner calls sqlalchemy.create_engine to establish a connection with the specified database. create_engine accepts a very large number of parameters that can be used to modify database engine behavior. You can provide parameters to create_engine via the engine_kwargs parameter of the job’s output step. Example usage: output: {
use: call:mitto.iov2.db#todb
dbo: postgresql://mitto:1234@db/analytics
schema: example_schema
tablename: example_table
engine_kwargs: {
echo: true
echo_pool: debug
pool_pre_ping: false
execution_options: {
max_row_buffer: 5000
}
}
}
output: {
use: call:mitto.iov2.db#todb
dbo: mssql+pyodbc://user:pass!@warehouse\mssqlserver08/somedb?driver=ODBC+Driver+17+for+SQL+Server&UseFMTONLY=Yes
schema: example_schema
tablename: example_table
engine_kwargs: {
fast_executemany: false
query_params: {
fast_executemany: false
}
}
}
Refer to the sqlalchemy.create_engine documentation for a list of all possible parameters. Common create_engine parameters are listed here as a convenience. Note engine_kwargs accepts any valid create_engine parameter, even if it is not shown here. Be aware that some parameters require values which can’t be provided in a Runner job configuration. For example, the value of creator must be a Python callable, which can’t be specified in a job’s configuration. Warning This is an advanced job configuration parameter intended for use only by those with a strong knowledge of both SQLAlchemy and Runner internals. |
|||
type |
object |
||
properties |
|||
|
Echo |
||
type |
boolean |
||
|
Echo Pool |
||
type |
boolean |
||
|
Execution Options |
||
Dictionary of execution options that will be applied to all connections. These will be provided as parameters when Connection.execution_options() is called. Refer to the documentation for a list of supported parameters. |
|||
type |
object |
||
examples |
{“max_row_buffer”: 5000} |
||
|
Query Params |
||
Additional parameters used only with MS SQLServer. |
|||
examples |
{“fast_excutemany”: true} |
||
allOf |
|||
|
Hide Parameters |
||
type |
boolean |
||
|
Isolation Level |
||
type |
string |
||
|
Label Length |
||
type |
integer |
||
|
Logging Name |
||
type |
string |
||
|
Max Identifier Length |
||
type |
integer |
||
|
Max Overflow |
||
type |
integer |
||
|
Param Style |
||
type |
string |
||
|
Pool Logging Name |
||
type |
string |
||
|
Pool Pre Ping |
||
NOTE: In some cases, this may be overridden by Runner. |
|||
type |
boolean |
||
|
Pool Size |
||
type |
integer |
||
|
Pool Recycle |
||
type |
integer |
||
|
Pool Timeout |
||
type |
integer |
||
|
Pool Use Lifo |
||
type |
boolean |
||
|
Query Cache Size |
||
type |
integer |
JSON Schema Definitions¶
#/definitions/BasicCredentials
¶
BasicCredentials¶
Basic credentials: username/password. |
||
type |
object |
|
properties |
||
|
Username |
|
The username. |
||
type |
string |
|
minLength |
1 |
|
|
Password |
|
The password. |
||
type |
string |
|
minLength |
1 |
|
format |
password |
#/definitions/GenericCredentials
¶
GenericCredentials¶
Generic credentials - any arbitrary dict. Used for arbitrary credentials for which no specific credential type is available. |
||
type |
object |
|
properties |
||
|
Value |
|
Arbitrary credentials formatted as a JSON string |
||
type |
string |
|
examples |
{“client_id”: “some-id”, “client_secret”: “some-secret”} |
|
default |
{ } |
|
format |
json |
#/definitions/GoogleServiceAccountCredentials
¶
GoogleServiceAccountCredentials¶
Credentials for Google BigQuery. See this document for information on creating the credentials. |
||
type |
object |
|
properties |
||
|
Type |
|
type |
string |
|
default |
service_account |
|
|
Project Id |
|
type |
string |
|
default |
mitto-183418 |
|
|
Private Key Id |
|
type |
string |
|
|
Private Key |
|
type |
string |
|
|
Client Email |
|
type |
string |
|
|
Client Id |
|
type |
string |
|
|
Auth Uri |
|
type |
string |
|
|
Token Uri |
|
type |
string |
|
default |
||
|
Auth Provider X509 Cert Url |
|
type |
string |
|
default |
||
|
Client X509 Cert Url |
|
type |
string |
#/definitions/RedshiftCredentials
¶
RedshiftCredentials¶
Credentials for AWS Redshift. |
||
type |
object |
|
properties |
||
|
S3 Access Key |
|
type |
string |
|
|
S3 Secret Key |
|
type |
string |
|
|
Bucket |
|
type |
string |
#/definitions/SQLServerQueryParameters
¶
SQLServerQueryParameters¶
Cursor parameters for MS SQLServer. NOTE: This is only used with MS SQLServer. This value is passed to cursor.fast_executemany. This value should match the value of engine_kwargs.fast_executemany present in the same output section. |
||
type |
object |
|
properties |
||
|
Fast Executemany |
|
Used to set fast_executemany on the cursor before execution. |
||
type |
boolean |
#/definitions/EngineKwArgs
¶
EngineKwArgs¶
Runner uses SQLAlchemy to interact with databases. Runner calls sqlalchemy.create_engine to establish a connection with the specified database. create_engine accepts a very large number of parameters that can be used to modify database engine behavior. You can provide parameters to create_engine via the engine_kwargs parameter of the job’s output step. Example usage: output: {
use: call:mitto.iov2.db#todb
dbo: postgresql://mitto:1234@db/analytics
schema: example_schema
tablename: example_table
engine_kwargs: {
echo: true
echo_pool: debug
pool_pre_ping: false
execution_options: {
max_row_buffer: 5000
}
}
}
output: {
use: call:mitto.iov2.db#todb
dbo: mssql+pyodbc://user:pass!@warehouse\mssqlserver08/somedb?driver=ODBC+Driver+17+for+SQL+Server&UseFMTONLY=Yes
schema: example_schema
tablename: example_table
engine_kwargs: {
fast_executemany: false
query_params: {
fast_executemany: false
}
}
}
Refer to the sqlalchemy.create_engine documentation for a list of all possible parameters. Common create_engine parameters are listed here as a convenience. Note engine_kwargs accepts any valid create_engine parameter, even if it is not shown here. Be aware that some parameters require values which can’t be provided in a Runner job configuration. For example, the value of creator must be a Python callable, which can’t be specified in a job’s configuration. Warning This is an advanced job configuration parameter intended for use only by those with a strong knowledge of both SQLAlchemy and Runner internals. |
||
type |
object |
|
properties |
||
|
Echo |
|
type |
boolean |
|
|
Echo Pool |
|
type |
boolean |
|
|
Execution Options |
|
Dictionary of execution options that will be applied to all connections. These will be provided as parameters when Connection.execution_options() is called. Refer to the documentation for a list of supported parameters. |
||
type |
object |
|
examples |
{“max_row_buffer”: 5000} |
|
|
Query Params |
|
Additional parameters used only with MS SQLServer. |
||
examples |
{“fast_excutemany”: true} |
|
allOf |
||
|
Hide Parameters |
|
type |
boolean |
|
|
Isolation Level |
|
type |
string |
|
|
Label Length |
|
type |
integer |
|
|
Logging Name |
|
type |
string |
|
|
Max Identifier Length |
|
type |
integer |
|
|
Max Overflow |
|
type |
integer |
|
|
Param Style |
|
type |
string |
|
|
Pool Logging Name |
|
type |
string |
|
|
Pool Pre Ping |
|
NOTE: In some cases, this may be overridden by Runner. |
||
type |
boolean |
|
|
Pool Size |
|
type |
integer |
|
|
Pool Recycle |
|
type |
integer |
|
|
Pool Timeout |
|
type |
integer |
|
|
Pool Use Lifo |
|
type |
boolean |
|
|
Query Cache Size |
|
type |
integer |