Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-17902

Ignite 3. SQL. Dynamic parameter type can't be inferred for the most of built-in SQL functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • sql
    • Docs Required, Release Notes Required

    Description

      Queries like:

      SELECT LOWER(?)
      

      Fails with:

      Caused by: org.apache.calcite.runtime.CalciteContextException: At line 1, column 14: Illegal use of dynamic parameter
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at org.apache.calcite.runtime.Resources$ExInstWithCause.ex(Resources.java:505)
          at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:932)
          at org.apache.calcite.sql.SqlUtil.newContextException(SqlUtil.java:917)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.newValidationError(SqlValidatorImpl.java:5266)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:1975)
          at org.apache.ignite.internal.processors.query.calcite.prepare.IgniteSqlValidator.inferUnknownTypes(IgniteSqlValidator.java:534)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.inferUnknownTypes(SqlValidatorImpl.java:2057)
          at org.apache.ignite.internal.processors.query.calcite.prepare.IgniteSqlValidator.inferUnknownTypes(IgniteSqlValidator.java:534)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.expandSelectItem(SqlValidatorImpl.java:461)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelectList(SqlValidatorImpl.java:4409)
          at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3652)

      We can try to infer types by type checker for SQL functions with 

      empty operandTypeInference.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jooger Iurii Gerzhedovich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: