[
https://issues.apache.org/jira/browse/CALCITE-6523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
suibianwanwan updated CALCITE-6523:
-----------------------------------
Description:
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?
was:
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.
Should we do something about this in RelToSqlConverter?
> 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)