client.jobs.submit_jdbc
Submits a job using JDCB parameters as inputs
client.jobs.submit_jdbc(model, version, url, username, password, driver, query, explain=False)
Submit a job based on a sql query on a database accessed through JDBC.
Parameters
Parameter | Type | Description | Example |
---|---|---|---|
model | str Model | Model identifier provided by Modzy or a model object previusly loaded. | 'ed542963de' |
version | str | The model’s version number. It follows the semantic versioning format. | '1.0.1' |
url | str | JDBC url to connect to the database | 'jdbc:postgresql://database-host:5432/mydatabase' |
username | str | The username to access the database | 'username' |
password | str | The password to access the database | 'password' |
driver | str | Full driver class name | 'org.posgresql.Driver' |
query | str | The query to execute, notice that we will try to match the column names to the model input keys, so you'll need to use alias for that. | 'select description as \'input.txt\' from my-table' |
explain | bool | If the model supports explainability, flag this job to return an explanation of the predictions | True |
Returns
A Job
object with the status from the server
{
"job_identifier": "string",
"status",
"account_identifier": "string",
"explain": "boolean",
"created_at": "date-time",
"updated_at": "date-time",
"submitted_at": "date-time",
"submitted_by": "string",
"pending": "integer",
"completed": "integer",
"failed": "integer",
"total": "integer",
"model": {
"identifier": "string",
"version": "string",
"name": "string"
},
"job_inputs": ["string"],
"user": {
"identifier": "string",
"external_identifier": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"status": "string",
"title": "string"
"access_keys": [
{
"prefix": "string",
"is_default": "boolean"
}
]
}
}
Examples
>>>job = client.jobs.submit_file('ed542963de', '0.0.27', 'jdbc:postgresql://database-host:5432/mydatabase', 'username', 'password', 'org.posgresql.Driver', 'select description as \'input.txt\' from my-table')
>>>job.job_identifier
'14856eb1-0ad8-49e7-9da3-887acb80fea5'
>>>job.status
'SUBMITTED'
Updated almost 2 years ago