Swapnil Gujarathi created CALCITE-5001:
------------------------------------------
Summary: Error for sql query with non-ascii characters with Oracle
db
Key: CALCITE-5001
URL: https://issues.apache.org/jira/browse/CALCITE-5001
Project: Calcite
Issue Type: Bug
Affects Versions: 1.28.0
Reporter: Swapnil Gujarathi
Hi,
I am using a calcite-core.jar version 1.28. I am facing an issue with a sql
query targeted for Oracle database (12.1.0.2.0). Example query is:
*select * from sample where column1 in ('héb', 'sio', 'dép');*
Query transformed and executed by Calcite:
*select * from sample where column1 in (u&'h\00e9b', 'sio', u&'d\00e9p')*
which gives sql error as: ORA-00907: missing right parenthesis.
I tried providing a system property calcite.default.charset=UTF-8 but it didn't
help. I tried to debug the code and found that method
[https://github.com/apache/calcite/blob/1d4f1b394bfdba03c5538017e12ab2431b137ca9/core/src/main/java/org/apache/calcite/sql/SqlDialect.java#L575]
is causing this encoding which gets invoked from
[https://github.com/apache/calcite/blob/1d4f1b394bfdba03c5538017e12ab2431b137ca9/core/src/main/java/org/apache/calcite/sql/SqlDialect.java#L425]
.
In the older version of calcite-core 1.15, the same query used to work. I have
no idea since which version of calcite-core, it started failing.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)