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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.13
    • None

    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

              alex_pl Aleksey Plekhanov
              alex_pl Aleksey Plekhanov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m