Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.13.0
-
None
Description
While working on a Drill plugin, Calcite unparsed a JdbcRel node and produced the following PostgreSQL query
SELECT "TEMP( Test)( 535799381)( 0)" FROM (SELECT "STRPOS"("str1", 'BI') = 1 AS "TEMP( Test)( 535799381)( 0)" FROM "TestV1"."Calcs") AS "t" GROUP BY "TEMP( Test)( 535799381)( 0)"
The query fails due to a parsing exception, the reason is that the STRPOS function name is quoted using double quotes. I tried the query manually without quoting the function name and it executed successfully.
I debugged through Calcite and found that the this method unparses the function name as a plain identifier which leads to the quoting of the function name if the dialect supports it.
Drill uses Calcite v1.4 but as I compared it with the master branch, I found them identical.
I haven't tried that with custom functions yet.
Attachments
Issue Links
- links to