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

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

In Oracle (at least in legacy settings), the empty string and NULL are the same 
thing. Are you using Oracle running in that mode? If so, it's not the SUBSTRING 
function, it's Oracle.

> SUBSTRING via JDBC Adapter on Oracle Returns Unexpected Results
> ---------------------------------------------------------------
>
>                 Key: CALCITE-6523
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6523
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: suibianwanwan
>            Priority: Minor
>
> I tried to submit the SQL to Calcite as follows, Calcite's JDBC adapter 
> converts the query to Oracle SQL, but the Oracle SQL returns results that do 
> not match the function's expectations
> {code:java}
> SELECT brand_name a ,substring(brand_name, 15, 1) b sub_brand FROM 
> foodmart.product LIMIT 1{code}
> Calcite expected result:
> {code:java}
>      a       |   b
> -------------+-------- 
>  Washington  |{code}
> Oracle Return Result:
> {code:java}
>      a       |   b 
> -------------+-------- 
>  Washington  |  NULL{code}



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

Reply via email to