1 Reply Latest reply on Apr 9, 2018 1:32 PM by Scott Borden

    Unable to connect to an existing Athena table in a custom sql query

    Scott Borden

      I received this error message when trying to write a custom SQL query when connecting to our Athena data store:

      com.tableausoftware.jdbc.TableauJDBCException: Error reading metadata for executed query: SELECT * FROM ( SELECT 'current_owner' AS owner_type, dt, account_id, current_owner_uid, current_owner_salesforce_id, current_owner_name, current_owner_revenue, total_daily_revenue FROM ad_sales_revenue_attribution UNION SELECT 'prior_owner' AS owner_type, dt, account_id, prior_owner_uid, prior_owner_salesforce_id, prior_owner_name, prior_owner_revenue, total_daily_revenue FROM ad_sales_revenue_attribution ) "custom_sql_query" LIMIT 0 com.facebook.presto.hive.DataCatalogException: Table ad_sales_revenue_attribution not found. Please check your query.

      There was a Java error.

      However, I'm able to successfully connect to this table when creating a data source (all expected fields are available to me when creating a new worksheet):


      I'm not sure if this is just a bad error and there is something wrong in my SQL (not familiar w/ what language Athena uses & cannot test in the AWS console at the moment). Or, if there's something weird I need to know when trying to create a custom SQL (with Athena).


      Any help is much appreciated!

        • 1. Re: Unable to connect to an existing Athena table in a custom sql query
          Scott Borden

          Answering my own question here!


          I was able to get access to our Athena AWS console, and found that I needed to reference my source table as "tableau"."ad_sales_revenue_attribution" instead of just ad_sales_revenue_attribution where "tableau" is the S3 bucket we store data for our Tableau integration.


          If you come across a similar issue I'd suggest getting access to your AWS console (or connecting with someone who does have access) to debug the query on that side.


          2 of 2 people found this helpful