You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Tanner Clary (Jira)" <ji...@apache.org> on 2023/04/20 16:49:00 UTC

[jira] [Commented] (CALCITE-5001) Error for sql query with non-ascii characters with Oracle db

    [ https://issues.apache.org/jira/browse/CALCITE-5001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17714677#comment-17714677 ] 

Tanner Clary commented on CALCITE-5001:
---------------------------------------

I was wondering whether you ever found a solution to this [~SwapnilG]? I am encountering a similar problem with queries ran for BigQuery that use UTF-8 encoding. When trying to encode some characters as the default {{CHARSET}} in Calcite, it is failing because these characters are found in UTF-8 but not in ISO-8859-1. I also tried changing the default {{CHARSET}} which worked in my case but it does not feel like a practical solution to change the default purely so BigQuery library string functions can handle well-formed UTF-8. If you have any thoughts as well [~zabetak] I would appreciate it! Thank you.

> 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.10#820010)