GuidesRecipesAPI ReferenceChangelogDiscussions
Log In

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

ParameterTypeDescriptionExample
modelstr
Model
Model identifier provided by Modzy or a model object previusly loaded.'ed542963de'
versionstrThe model’s version number. It follows the semantic versioning format.'1.0.1'
urlstrJDBC url to connect to the database'jdbc:postgresql://database-host:5432/mydatabase'
usernamestrThe username to access the database'username'
passwordstrThe password to access the database'password'
driverstrFull driver class name'org.posgresql.Driver'
querystrThe 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'
explainboolIf the model supports explainability, flag this job to return an explanation of the predictionsTrue

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'