KNOWLEDGE BASE

Error "Catalog must be specified when session catalog is not set" When connecting to Trino/Presto with Custom SQL


Published: 03 Mar 2023
Last Modified Date: 03 Mar 2023

Issue

When connecting to Trino using Custom SQL, we got the error below:

=====
Error Code: FAB9A2C5
"Catalog must be specified when session catalog is not set"
=====

 

Environment

  • Tableau Desktop 
  • Trino/Presto

Resolution

Check the Custom SQL script used and add your catalog name if it's missing.

For Example, if your Custom SQL is like below:
=====
SELECT
 *
FROM database_name.table_name
WHERE col_1 = 'AAA'
=====​​​​​​

You need to add your catalog name into your Custom SQL like:
=====
SELECT
 *
FROM catalog_name.database_name.table_name
WHERE col_1 = 'AAA'
=====​​​​​​

Cause

The catalog name needs to be specified in the query or set in the session of catalog. This is an expected behavior in Trino/Presto side.
Did this article resolve the issue?