How to get the exact query generated by the ODBC driver - reporting-services

We are connecting Hadoop cloudera CDH distribution through ODBC driver. Queries are generated from SSRS. Few queries are working fine with parameters augmented through ? placeholder. Few other queries with parameters augmented through ? are not executing.
Error [HY000][Cloudera][ImpalaODBC] (100) error while executing a query in Impala[HY000] : AnalysisException : syntax error in line 1 where Date >= ? and Date <= ?
^Encountered : Unexpected characterExpected : Case... Exception : syntax error.
If i remove where Date >= ? and Date <= ? or supply the hard coded value then query is working perfect.
Few other queries with same filter are working perfect.
What should be recommended investigation points?
Where could i get the exact impala transformed query to investigate whether query is generated correct or not ?

You have a couple of options:
/var/log/impalad/audit stores audit logs (at least in CDH). Those logs contain sql_statement field that stores executed sql queries
Impala has a web server running on a 25000 port. You could connect
with your browser and see queries executed (/queries tab).
If you are using Cloudera Manager, you could see all executed impala
queries in "impala/queries"

Related

Passing parameters to Databricks SQL from SSRS

I have just set up a connection to connect SQL Server Reporting Services (SSRS) to my Databricks SQL endpoint. The connection works and I can query data. I am using the Simba Spark ODBC driver to do this and it works just fine.
Now, my report datasets in SSRS need to use some parameters. In regular SQL Server, I would just use #Parameter in my query. However, Databricks SQL works different passing parameters and the syntax should be {{ Parameter }}. I've tried multiple versions of this, for example {{ #Parameter }}, '{{ Parameter }}' et cetera.
This is what it looks like in SSRS:
Unfortunately, this doesn't work and it will give me:
ERROR [42000] [Simba][Hardy] (80) Syntax or semantic analysis error thrown in server while executing query. Error message from server: org.apache.hive.service.cli.HiveSQLException: Error running query: [PARSE_SYNTAX_ERROR] org.apache.spark.sql.catalyst.parser.ParseException: [PARSE_SYNTAX_ERROR] Syntax error at or near '{'(line 3, pos 28)
In Databricks SQL itself, this works fine! A parameter box pops up and I can fill it in.
Now, what DOES work, but is sub-optimal in my opinion, is setting the parameters as '?'
SELECT *
FROM table
WHERE column = ?
Then I will also need to put a '?' in the parameters section in SSRS, but this way you'll never know which parameter is which (in case of more than 1 parameter). Ofcourse I have tried ?Parameter and different versions of it... With no luck
Now I'm wondering: Am I doing something wrong, is this simply not possible? I am really starting the assume the latter.
Really appreciate any help or suggestions. Thanks in advance!

apache drill - AssertionError: Relational expression

running apache-drill-1.14.0
tested this query on mysql and got result in 0.02 sec
running the query in drill cli fails with AssertionError
Query:
product_id is BIGINT
SELECT test50.customername, test50.color, test50.age, test50.city,
test50.product_id, test50.price FROM myplugin.sampler.test50 JOIN
myplugin.sampler.test52 ON test50.product_id = test52.product_id WHERE
test50.product_id = 759216 GROUP BY test50.customername, test50.color,
test50.age, test50.city, test50.product_id, test50.price ORDER BY
test50.customername;
Error:
Error: SYSTEM ERROR: AssertionError: Relational expression
rel#873:DrillFilterRel.JDBC.myplugin.ANY([]).
[](input=rel#83:JdbcTableScan.JDBC.myplugin.ANY([]).[](table=[myplugin,
sampler, test50]),condition=OR(=($18, 759216), =($18, 494636))) has
calling-convention JDBC.myplugin but does not implement the required interface
'interface org.apache.calcite.adapter.jdbc.JdbcRel' of that convention
need help if I need some extra configuration ?
Thanks
Could you please check on current master? Looks like it was fixed in DRILL-6850.

Progress SQL error in ssis package: buffer too small for generated record

I have an ssis package which uses SQL command to get data from Progress database. Every time I execute the query, it throws this specific error:
ERROR [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Internal error -1 (buffer too small for generated record) in SQL from subsystem RECORD SERVICES function recPutLONG called from sts_srtt_t:::add_row on (ttbl# 4, len/maxlen/reqlen = 33/32/33) for . Save log for Progress technical support.
I am running the following query:
Select max(ROWID) as maxRowID from TableA
GROUP BY ColumnA,ColumnB,ColumnC,ColumnD
I've had the same error.
After change startup-parameter -SQLTempStorePageSize and -SQLTempStoreBuff to 24 and 3000 respectively the problem was solved.
I think, for you the values must be changed to 40 and 20000.
You can find more information here. The name of the parameter in that article was a bit different than in my Database, it depends on the Progress-version witch is used.

Using BIDS to extract data from Informix ODBC source with parameters

As it says in the title, I am trying to extract data from my Informix ODBC source with parameters. I have two parameters that i am trying to pass. Both are DateTime and i am trying to get the current starting date for example 2014-10-10 00:00:00 and the ending date 2014-10-10 23:59:59.
If i do this with a normal query:
SELECT * FROM TABLENAME
WHERE STARTDATETIME BETWEEN '2014-10-10 00:00:00' AND '2014-10-10 23:59:59'
Everything works fine. However, if I try and use the parameters that I have set up:
SELECT * FROM TABLENAME
WHERE STARTDATETIME BETWEEN ? AND ?
I get the following error:
Open Database Connectivity (ODBC) error occurred. state: '07001'.
Native Error Code: -11012. [Informix][Informix ODBC Driver]Wrong number of parameters.
I feel like it has to do with my query, but I have been looking and have found nothing. Would anyone be able to help me out? Thanks!
When you use parameterized query ('?') binding is needed.
Likely you may be using ODBC API SQLBindCol for binding it.
The number of parameter in the query (in this case it is 2)
should be matching with number of bind API calls.
Please check your ODBC code to make sure the binding is correctly done.

Edatabase error : Record not found while locating TTable ,

my application, i have used TTable.locate option in many places to move the cursor, but in only one place it will raise "EDatabaseerror : Record Not Found',
aslo it will raise for particular records only,
The Locate Option only returns boolean value, if records exist it return True,if not it return Fasle,
Why it raising Error?
am using:
Delphi 7, BDE5, Sql server 2008, am using Sql server native client driver to connect Sql server From BDE VIA ODBCE, application working fine except that place.
NOte:
am locting ttable using locaseinsensitive option,
example :
tb_user.locate('username',tb_global_user.fieldbyname('Username',[locaseinsensitive]));
this error raised from my Result form, am using this form for common search,
any helps ?