1 of 1 people found this helpful
I believe that the parameter value appears as a string literal in SQL query that gets sent to the database. So something like:
from hivedb.'parameter value'
I am not familiar with how Hive wants SQL queries to be formatted, but maybe you could try something like:
from 'hivedb'.<Parameters.Parameter Name>
so that the final query would be
from 'hivedb'.'parameter value'
To know exactly how the custom SQL query looks when it is sent to the Hive database, you can pull the queries from a performance recording or log files. See Viewing Underlying SQL Queries | Tableau Software
Hope this helps!
This query ran no problem:
where app_group_name = 'prod_1' and year = <Parameters.Year> and month = <Parameters.Month> and day = <Parameters.Day>
and hour = <Parameters.Hour>
--AND canvas_id IS NOT NULL
distribute by rand()
limit <Parameters.Record Limit>
But when I try a parameter to replace the table name (any portion of it) it doesn't work. I've added characters like ` or ' around different parts of the name as you suggested with no luck. I did do the performance recording and looked at the SQL but it didn't show me much related to how the table name is queried.
When I try to replace 'braze_currents_raw.braze_user_behaviors_app_first_session' with a parameter, this is the error that I get:
[Amazon][HiveODBC] (80) Syntax or semantic analysis error thrown in server while execurint query. Error message from server: Error while compiling statement: FAILED: ParseException line 3:2 cannot recognize input near '(' 'select' '*' in joinSource
Unable to connect to the server. Check that the server is running and that you have access privileges to the requested database.
Any other suggestions or ideas here?