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

Julian Hyde commented on CALCITE-2653:
--------------------------------------

I am still mystified why it doesn't work for you. Functions are 
case-insensitive (at least in the usual connection settings), so both forms 
work for me:
{noformat}
sqlline> !connect jdbc:calcite: sa ""
0: jdbc:calcite:> values substring('hello' from 2 for 2);
+--------+
| EXPR$0 |
+--------+
| el     |
+--------+
1 row selected (0.867 seconds)
0: jdbc:calcite:> values SUBSTRING('hello' from 2 for 2);
+--------+
| EXPR$0 |
+--------+
| el     |
+--------+
1 row selected (0.098 seconds)
0: jdbc:calcite:> values SUBSTRING('hello', 2, 2);
+--------+
| EXPR$0 |
+--------+
| el     |
+--------+
1 row selected (0.051 seconds)
0: jdbc:calcite:> values substring('hello', 2, 2);
+--------+
| EXPR$0 |
+--------+
| el     |
+--------+
1 row selected (0.026 seconds)
{noformat}

> Correct the operator syntax of String Function SUBSTRING in reference.md
> ------------------------------------------------------------------------
>
>                 Key: CALCITE-2653
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2653
>             Project: Calcite
>          Issue Type: Improvement
>          Components: site
>    Affects Versions: 1.17.0
>            Reporter: winifredtang
>            Assignee: Julian Hyde
>            Priority: Minor
>
> I wonder if we can change the operator syntax of String Function SUBSTRING 
> from SUBSTRING(string FROM integer) to SUBSTRING(string, integer). Since it 
> might be a bit of misleading.
> Executing a SQL statement like "select substring(name FROM 2) from 
> sales.depts;" would throw a exception :
> "Caused by: org.apache.calcite.sql.parser.impl.ParseException: Encountered 
> "select" at line 2, column 1."
> The correct SQL statement is "select substring(NAME,2) from sales.depts;".
> SUBSTRING(string FROM integer FOR integer) has the same promble.
> If necessary, I'd like to modify it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to