[
https://issues.apache.org/jira/browse/CALCITE-7267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035491#comment-18035491
]
Yu Xu commented on CALCITE-7267:
--------------------------------
This issue describes a problem where Oracle supports the length function but
not char_length. Besides Oracle, other dialects like Presto also have this
problem. Such as https://issues.apache.org/jira/browse/CALCITE-6643
The current approach is to adapt this function conversion for each dialect
individually. This is a fairly common issue because multiple dialects have this
function adaptation problem, so I created a utility method in
RelToSqlConverterUtil to handle similar issues when new dialects are introduced
in the future.
I still can't figure out how the adaptation here relates to the data. Could
you help further explain the meaning of 'data-driven'? [~julianhyde]
> CHAR_LENGTH function is not support in Oracle
> ---------------------------------------------
>
> Key: CALCITE-7267
> URL: https://issues.apache.org/jira/browse/CALCITE-7267
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.41.0
> Reporter: Yu Xu
> Assignee: Yu Xu
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.42.0
>
>
> CHAR_LENGTH function is not support for Oracle, but LENGTH is supported
> sql
>
> {code:java}
> select CHAR_LENGTH('aaa') {code}
>
>
> error
>
> {code:java}
> ORA-00904: "CHAR_LENGTH": invalid identifier
> https://docs.oracle.com/error-help/db/ora-00904/
> 00904. 00000 - "%s: invalid identifier"
> *Cause: The identifier or column name entered was invalid.
> *Action: Ensure the following
> Error at Line: 1 Column: 6 {code}
>
>
> sql
>
> {code:java}
> select LENGTH('aaa') {code}
>
>
> result is ok:
>
> {code:java}
> 3
> {code}
> refer:
> https://docs.oracle.com/en/database/oracle/oracle-database/18/sqlrf/LENGTH.html
>
> This function is widely used and needs to be fixed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)