You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/01/23 23:44:12 UTC

[GitHub] [calcite] xwkuang5 commented on a change in pull request #2333: [CALCITE-4347] Add type inference for SqlSubstringFunction (Louis Kuang)

xwkuang5 commented on a change in pull request #2333:
URL: https://github.com/apache/calcite/pull/2333#discussion_r563213727



##########
File path: core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
##########
@@ -7810,9 +7810,6 @@ public void _testGroupExpressionEquivalenceParams() {
     sql("select * from emp where deptno = ?").ok();
     sql("select * from emp where deptno = ? and sal < 100000").ok();
     sql("select case when deptno = ? then 1 else 2 end from emp").ok();
-    // It is not possible to infer type of ?, because SUBSTRING is overloaded
-    sql("select deptno from emp group by substring(ename from ^?^ for ?)")
-        .fails("Illegal use of dynamic parameter");

Review comment:
       @julianhyde maybe I am missing something but why was it impossible to infer type of `?`. The overload is only for the first argument but not the second and the third according to https://calcite.apache.org/docs/reference.html#character-string-operators-and-functions




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org