[
https://issues.apache.org/jira/browse/CALCITE-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17488590#comment-17488590
]
Swapnil Gujarathi commented on CALCITE-5001:
--------------------------------------------
Thanks [~zabetak] for your quick attention. I will try to find that out. As a
workaround I had tried to comment out the code block
{code:java}
if (containsNonAscii(val) && charsetName == null) {
quoteStringLiteralUnicode(buf, val);
} {code}
from method
[https://github.com/apache/calcite/blob/1d4f1b394bfdba03c5538017e12ab2431b137ca9/core/src/main/java/org/apache/calcite/sql/SqlDialect.java#L425]
which seemed to work. However, I am not very sure if it is really a workaround
or will break for some other cases which I may not think of. Any thoughts on
this please?
Thanks,
Swapnil
> 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
> Priority: Major
>
> 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)