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

Julian Hyde commented on CALCITE-6523:
--------------------------------------

Currently this case is merely an observation, "Oracle SUBSTR semantics 
different from Calcite", so is not actionable. Can you re-phrase summary and 
description so that it reads like a bug? I think there is a test case where 
someone submits a query to Calcite (expecting Calcite semantics), and Calcite's 
JDBC adapter translates the query to Oracle SQL, and Oracle does not return the 
results that the user expected.

> Oracle SUBSTR semantics different from Calcite
> ----------------------------------------------
>
>                 Key: CALCITE-6523
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6523
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: suibianwanwan
>            Priority: Minor
>
> Oracle's `SUBSTR` has very different semantics. For example, if the length of 
> the character is less than the second argument, null is returned. 
> {code:java}
> select substr('a', 2, 1);{code}
> I tested Spark sql, presto, mysql all return empty string, same in calcite. I 
> noticed that in CALCITE-4427, the substr is handled in sqlToRel, should we 
> also do some conversion in reltosqlConverter?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to