The trino
endpoint allows you to connect and manage Trino data sources in Immuta.
Additional fields may be included in some responses you receive; however, these attributes are for internal purposes and are therefore undocumented.
Trino workflow
Create a data source
**Duplicate data sources**: In order to avoid two data sources referencing the same table, users can not create duplicate data sources. If you attempt to create a duplicate data source using the API, you will encounter a warning stating "duplicate tables are specified in the payload."
POST
/trino/handler
Save the provided connection information as a data source.
Payload parameters
Attribute
Description
Required
boolean
When false
, the data source will be publicly available in the Immuta UI.
array[object]
The parameters for this array include scheme
("https"
) and url
(an empty string).
string
Describes the type of underlying blob handler that will be used with this data source (e.g., MS SQL
).
string
The data format of blobs in the data source, such as json
, xml
, html
, or jpeg
.
string
The type of data source: ingested
(metadata will exist in Immuta) or queryable
(metadata is dynamically queried).
string
The name of the data source. It must be unique within the Immuta tenant.
string
A string that represents this data source's table in Immuta.
string
The organization that owns the data source.
string
The category of the data source.
string
The description of the data source.
boolean
When true
, the data source contains examples.
Response parameters
integer
The ID of the data source.
string
This message describes issues with the created data source, such as the data source being unhealthy.
string
The connection string used to connect the data source to Immuta.
Request example
This request creates a Trino data source.
Copy curl \
--request POST \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
--data @example-payload.json \
https://demo.immuta.com/trino/handler
Payload example
Copy {
"handler" : {
"metadata" : {
"staleDataTolerance" : 86400 ,
"schemaProjectName" : "Public" ,
"bodataSchemaName" : "public" ,
"columns" : [{
"name" : "c_customer_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_customer_id" ,
"dataType" : "text" ,
"remoteType" : "char(16)" ,
"nullable" : true
} , {
"name" : "c_current_cdemo_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_current_hdemo_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_current_addr_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_first_shipto_date_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_first_sales_date_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_salutation" ,
"dataType" : "text" ,
"remoteType" : "varchar(10)" ,
"nullable" : true
} , {
"name" : "c_first_name" ,
"dataType" : "text" ,
"remoteType" : "varchar(20)" ,
"nullable" : true
} , {
"name" : "c_last_name" ,
"dataType" : "text" ,
"remoteType" : "varchar(30)" ,
"nullable" : true
} , {
"name" : "c_preferred_cust_flag" ,
"dataType" : "text" ,
"remoteType" : "char(1)" ,
"nullable" : true
} , {
"name" : "c_birth_day" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_month" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_year" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_country" ,
"dataType" : "text" ,
"remoteType" : "varchar(20)" ,
"nullable" : true
} , {
"name" : "c_login" ,
"dataType" : "text" ,
"remoteType" : "char(13)" ,
"nullable" : true
} , {
"name" : "c_email_address" ,
"dataType" : "text" ,
"remoteType" : "varchar(50)" ,
"nullable" : true
} , {
"name" : "c_last_review_date" ,
"dataType" : "text" ,
"remoteType" : "varchar(10)" ,
"nullable" : true
}] ,
"hostname" : "example-trino.host.io" ,
"port" : 8080 ,
"ssl" : false ,
"authenticationMethod" : "No Authentication" ,
"connectionStringOptions" : "" ,
"userFiles" : [] ,
"database" : "public" ,
"sid" : "postgres" ,
"table" : "customer" ,
"schema" : "public" ,
"bodataTableName" : "customer" ,
"dataSourceName" : "Customer"
}
} ,
"dataSource" : {
"blobHandler" : {
"scheme" : "https" ,
"url" : ""
} ,
"blobHandlerType" : "Trino" ,
"recordFormat" : "" ,
"type" : "queryable" ,
"schemaEvolutionId" : null ,
"columnEvolutionEnabled" : true ,
"name" : "Customer" ,
"sqlTableName" : "customer"
} ,
"schemaEvolution" : {
"ownerProfileId" : 1 ,
"config" : {
"nameTemplate" : {
"nameFormat" : "<Tablename>" ,
"tableFormat" : "<tablename>" ,
"sqlSchemaNameFormat" : "<schema>" ,
"schemaProjectNameFormat" : "<Schema>"
}
} ,
"schemas" : []
}
}
Response example
Copy {
"id" : 1 ,
"dataSourceId" : 1 ,
"dataSource" : {
"blobHandler" : {
"accessKey" : "REDACTED" ,
"url" : "https://REDACTED/trino/handler/1" ,
"ca" : [ "-----BEGIN CERTIFICATE-----\nyourdXRhIENcertificate\n-----END CERTIFICATE-----" ] ,
"manualDictionary" : false
} ,
"blobHandlerType" : "Trino" ,
"recordFormat" : "Not Provided" ,
"type" : "queryable" ,
"schemaEvolutionId" : 1 ,
"columnEvolutionEnabled" : true ,
"name" : "Customer" ,
"sqlTableName" : "customer" ,
"sqlSchemaName" : "public" ,
"workspace" : null ,
"rowCount" : 0 ,
"seeded" : false ,
"owner" : {} ,
"documentation" : "# Customer" ,
"statsExpiration" : "2022-07-19T18:55:21.300Z" ,
"recordCount" : 0 ,
"createdBy" : 1 ,
"policyHandler" : null ,
"subscriptionType" : "manual" ,
"id" : 1 ,
"description" : null ,
"deleted" : false ,
"policyHandlerType" : "None" ,
"subscriptionPolicy" : null ,
"globalPolicies" : null ,
"status" : null ,
"statusInfo" : null ,
"catalogMetadata" : null ,
"createdAt" : "2022-07-19T18:55:21.302Z" ,
"updatedAt" : "2022-07-19T18:55:21.302Z" ,
"tags" : []
} ,
"warnings" : []
}
Get information about a data source
GET
/trino/handler/{handlerId}
Get the handler metadata associated with the provided handler ID.
Query parameters
Attribute
Description
Required
integer
The ID of the handler.
boolean
When true
, will skip the handler cache when retrieving metadata.
Response parameters
array[object]
Metadata about the data source, including the data source ID, schema, database, and connection string.
Request example
This request returns metadata for the handler with the ID 1
.
Copy curl \
--request GET \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/trino/handler/1
Response example
Copy {
"dataSourceId" : 1 ,
"metadata" : {
"sid" : "postgres" ,
"ssl" : false ,
"port" : 8080 ,
"query" : null ,
"table" : "customer" ,
"schema" : "public" ,
"database" : "public" ,
"hostname" : "trino-example-database.io" ,
"ephemeral" : true ,
"eventTime" : null ,
"userFiles" : [] ,
"dataSourceName" : "Customer" ,
"bodataTableName" : "customer" ,
"highCardinality" : "c_customer_sk" ,
"bodataSchemaName" : "public" ,
"columnsNormalized" : false ,
"schemaProjectName" : "Public" ,
"staleDataTolerance" : 0 ,
"authenticationMethod" : "No Authentication" ,
"connectionStringOptions" : null
} ,
"type" : "queryable" ,
"connectionString" : "trino-example-database.io:8080/postgres/public" ,
"id" : 1 ,
"createdAt" : "2022-07-19T18:55:21.220Z" ,
"updatedAt" : "2022-07-19T18:55:23.466Z" ,
"dbms" : {
"name" : "trino"
}
}
Manage data sources
/trino/handler/{handlerId}
/trino/handler/{handlerId}/triggerHighCardinalityJob
/trino/handler/{handlerId}/refreshNativeViewJob
Update a specific data source
PUT
/trino/handler/{handlerId}
Update the data source metadata associated with the provided handler ID. This endpoint does not perform partial updates, but will allow the dictionary to be omitted. In this case, it uses the current dictionary.
Query parameters
Attribute
Description
Required
integer
The ID of the handler.
boolean
When true
, will skip the handler cache when retrieving metadata.
Payload parameters
Attribute
Description
Required
metadata
Includes metadata about the handler, such as ssl
, port
, database
, hostname
, username
, and password
.
string
The connection string used to connect to the data source.
Response parameters
integer
The ID of the handler.
string
The certificate authority.
array[object]
This is a Data Dictionary object, which provides metadata about the columns in the data source, including the name and data type of the column.
Request example
This request updates the data source name to Marketing Data
for the data source with the handler ID 1
.
Copy curl \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
--data @example-payload.json \
https://demo.immuta.com/trino/handler/1
Payload example
Copy {
"handler" : {
"policyHandler" : null ,
"dataSourceId" : 1 ,
"metadata" : {
"sid" : "postgres" ,
"ssl" : false ,
"port" : 8080 ,
"query" : null ,
"table" : "customer" ,
"schema" : "public" ,
"database" : "public" ,
"hostname" : "trino-example.io" ,
"ephemeral" : true ,
"eventTime" : null ,
"userFiles" : [] ,
"dataSourceName" : "Marketing Data" ,
"bodataTableName" : "customer" ,
"highCardinality" : "c_customer_sk" ,
"bodataSchemaName" : "public" ,
"columnsNormalized" : false ,
"schemaProjectName" : "Public" ,
"staleDataTolerance" : 0 ,
"authenticationMethod" : "No Authentication" ,
"connectionStringOptions" : "" ,
"columns" : [{
"name" : "c_customer_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_customer_id" ,
"dataType" : "text" ,
"remoteType" : "char(16)" ,
"nullable" : true
} , {
"name" : "c_current_cdemo_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_current_hdemo_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_current_addr_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_first_shipto_date_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_first_sales_date_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_salutation" ,
"dataType" : "text" ,
"remoteType" : "varchar(10)" ,
"nullable" : true
} , {
"name" : "c_first_name" ,
"dataType" : "text" ,
"remoteType" : "varchar(20)" ,
"nullable" : true
} , {
"name" : "c_last_name" ,
"dataType" : "text" ,
"remoteType" : "varchar(30)" ,
"nullable" : true
} , {
"name" : "c_preferred_cust_flag" ,
"dataType" : "text" ,
"remoteType" : "char(1)" ,
"nullable" : true
} , {
"name" : "c_birth_day" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_month" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_year" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_country" ,
"dataType" : "text" ,
"remoteType" : "varchar(20)" ,
"nullable" : true
} , {
"name" : "c_login" ,
"dataType" : "text" ,
"remoteType" : "char(13)" ,
"nullable" : true
} , {
"name" : "c_email_address" ,
"dataType" : "text" ,
"remoteType" : "varchar(50)" ,
"nullable" : true
} , {
"name" : "c_last_review_date" ,
"dataType" : "text" ,
"remoteType" : "varchar(10)" ,
"nullable" : true
}]
} ,
"type" : "queryable" ,
"connectionString" : "trino-example.io:8080/postgres/public" ,
"id" : 1 ,
"createdAt" : "2022-07-19T18:55:21.220Z" ,
"updatedAt" : "2022-07-19T18:55:23.466Z" ,
"dbms" : {
"name" : "trino"
}
}
}
Response example
Copy {
"id" : 1 ,
"ca" : [ "-----BEGIN CERTIFICATE-----\nMIIuyourcertificate\n-----END CERTIFICATE-----" ] ,
"metadata" : {
"columns" : [{
"name" : "c_customer_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_customer_id" ,
"dataType" : "text" ,
"remoteType" : "char(16)" ,
"nullable" : true
} , {
"name" : "c_current_cdemo_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_current_hdemo_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_current_addr_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_first_shipto_date_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_first_sales_date_sk" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_salutation" ,
"dataType" : "text" ,
"remoteType" : "varchar(10)" ,
"nullable" : true
} , {
"name" : "c_first_name" ,
"dataType" : "text" ,
"remoteType" : "varchar(20)" ,
"nullable" : true
} , {
"name" : "c_last_name" ,
"dataType" : "text" ,
"remoteType" : "varchar(30)" ,
"nullable" : true
} , {
"name" : "c_preferred_cust_flag" ,
"dataType" : "text" ,
"remoteType" : "char(1)" ,
"nullable" : true
} , {
"name" : "c_birth_day" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_month" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_year" ,
"dataType" : "integer" ,
"remoteType" : "integer" ,
"nullable" : true
} , {
"name" : "c_birth_country" ,
"dataType" : "text" ,
"remoteType" : "varchar(20)" ,
"nullable" : true
} , {
"name" : "c_login" ,
"dataType" : "text" ,
"remoteType" : "char(13)" ,
"nullable" : true
} , {
"name" : "c_email_address" ,
"dataType" : "text" ,
"remoteType" : "varchar(50)" ,
"nullable" : true
} , {
"name" : "c_last_review_date" ,
"dataType" : "text" ,
"remoteType" : "varchar(10)" ,
"nullable" : true
}]
}
}
Update multiple data sources
PUT
/trino/bulk
Update the data source metadata associated with the provided connection string.
Payload parameters
Attribute
Description
Required
metadata
Includes metadata about the handler, such as ssl
, port
, database
, hostname
, username
, and password
.
string
The connection string used to connect to the data sources.
Response parameters
string
The ID of the bulk data source update.
string
The connection string shared by the data sources bulk updated.
integer
The number of jobs that ran to update the data sources; this number corresponds to the number of data sources updated.
Request example
This request updates the metadata for all data sources with the connection string specified in example-payload.json
.
Copy curl \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
--data @example-payload.json \
https://demo.immuta.com/trino/bulk
Payload example
The payload below adds a certificate (certificate.json
) to the data sources with the provided connection.
Copy {
"handler" : {
"metadata" : {
"sid" : "postgres" ,
"ssl" : false ,
"port" : 8080 ,
"database" : "public" ,
"hostname" : "trino-example.io" ,
"userFiles" : [{
"keyName" : "certificate" ,
"filename" : "576d8b38e9e8bc3749599489408a0b9f605b2a8d.md" ,
"userFilename" : "certificate.json"
}] ,
"authenticationMethod" : "No Authentication" ,
"connectionStringOptions" : ""
}
} ,
"connectionString" : "trino-example.io:8080/postgres/public"
}
Response example
Copy {
"bulkId" : "bulk_ds_update_657dd563e6e746069bf040de5e6909a9" ,
"connectionString" : "trino-example.io:8080/postgres/public" ,
"jobsCreated" : 4
}
Recalculate the high cardinality column for a data source
PUT
/trino/handler/{handlerId}/triggerHighCardinalityJob
Recalculate the high cardinality column for the specified data source.
Query parameters
Attribute
Description
Required
integer
The ID of the handler.
Response parameters
The response returns a string of characters that identify the high cardinality job run.
Request example
This request re-runs the job that calculates the high cardinality column for the data source with the handler ID 30
.
Copy curl \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/trino/handler/30/triggerHighCardinalityJob
Response example
Copy f 6 ac 1 ad 0-26 d 0-11 ec -8078 -d 36 bbf 5 b 90 fb
Refresh a native view
PUT
/trino/handler/{handlerId}/refreshNativeViewJob
Refresh the native view of a data source.
Query parameters
Attribute
Description
Required
integer
The ID of the handler.
Response parameters
The response returns a string of characters that identifies the refresh view job run.
Request example
This request refreshes the view for the data source with the handler ID 7
.
Copy curl \
--request PUT \
--header "Content-Type: application/json" \
--header "Authorization: Bearer dea464c07bd07300095caa8" \
https://demo.immuta.com/trino/handler/7/refreshNativeViewJob
Response example
Copy 53 c 256 d 0 -eb 57-11 ec-b 275 -d 95 a 8e998142