Skip to content

Trino Tool - issue when creating a query

When executing the following request:

curl --location 'https://datamite-ds.iti.es/dbq/trinoquery/create' \
--header 'Content-Type: application/json' \
--data '{
  "name": "query1",
  "query": "SELECT t1.id, t1.firstname, t1.lastname, t2.firstname, t2.lastname FROM postgresql.public.customer  t1 JOIN mariadb.trinodb.customer t2  on t1.id = t2.id  where t1.firstname != t2.firstname",
  "isRecursive": true,
  "startDate": "2024-12-19T12:39:03.111Z",
  "endDate": "2025-04-19T16:00:03.111Z",
  "notes": "a description of the funcionality of the query",
  "intervalHours": 24
}'

The following error appears in the TrinoAPI log (ITI infra):

Validating FROM table - Catalog: postgresql, Database: public, Table: customer
2025-06-24T14:37:43.868044477Z datamite-demo_trino-api.1.88kdrcxp8768@datamite-quality    | Error creating query: Error: Database 'public' does not exist in catalog 'postgresql'.
2025-06-24T14:37:43.868054217Z datamite-demo_trino-api.1.88kdrcxp8768@datamite-quality    |     at TrinoQueryService.create (/opt/nodejs-server/dist/services/trinoQuery.service.js:236:27)

TrinoAPI is connected to the Datamite general DB

/cc @anacosta

Edited by Antoni Gimeno