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

Calcite engine. String functions fail on NULL constant

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql
    • Docs Required, Release Notes Required

    Description

      The query
      select UPPER(NULL), LOWER(NULL)

      Functions:

      • UPPER
      • LOWER
      • LEFT
      • RIGHT
      • REPEAT
      • REVERSE
      • SUBSTRING

      fails with exception:

      java.lang.RuntimeException: while resolving method 'valueOf[class java.lang.String]' in class class java.lang.Void
      
      	at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:323)
      	at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:445)
      	at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:457)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.ConverterUtils.convert(ConverterUtils.java:229)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.ConverterUtils.convert(ConverterUtils.java:175)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexImpTable$AbstractRexCallImplementor.genValueStatement(RexImpTable.java:1962)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexImpTable$AbstractRexCallImplementor.implement(RexImpTable.java:1909)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.visitCall(RexToLixTranslator.java:978)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.visitCall(RexToLixTranslator.java:78)
      	at org.apache.calcite.rex.RexCall.accept(RexCall.java:174)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.visitLocalRef(RexToLixTranslator.java:873)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.visitLocalRef(RexToLixTranslator.java:78)
      	at org.apache.calcite.rex.RexLocalRef.accept(RexLocalRef.java:75)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.translate(RexToLixTranslator.java:204)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.translate(RexToLixTranslator.java:197)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.translateList(RexToLixTranslator.java:750)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.translateProjects(RexToLixTranslator.java:178)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl.compile(ExpressionFactoryImpl.java:300)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl.lambda$scalar$4(ExpressionFactoryImpl.java:263)
      	at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl.scalar(ExpressionFactoryImpl.java:263)
      	at org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl.project(ExpressionFactoryImpl.java:220)
      	at org.apache.ignite.internal.processors.query.calcite.exec.LogicalRelImplementor.visit(LogicalRelImplementor.java:202)
      	at org.apache.ignite.internal.processors.query.calcite.exec.LogicalRelImplementor.visit(LogicalRelImplementor.java:109)
      	at org.apache.ignite.internal.processors.query.calcite.rel.IgniteProject.accept(IgniteProject.java:89)
      	at org.apache.ignite.internal.processors.query.calcite.exec.LogicalRelImplementor.visit(LogicalRelImplementor.java:657)
      	at org.apache.ignite.internal.processors.query.calcite.exec.LogicalRelImplementor.go(LogicalRelImplementor.java:672)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executeQuery(ExecutionServiceImpl.java:717)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executePlan(ExecutionServiceImpl.java:657)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executePlans(ExecutionServiceImpl.java:410)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executeQuery(ExecutionServiceImpl.java:392)
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:258)
      	at org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner.sql(SqlScriptRunner.java:111)
      	at org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner$Query.execute(SqlScriptRunner.java:512)
      	at org.apache.ignite.internal.processors.query.calcite.logical.SqlScriptRunner.run(SqlScriptRunner.java:93)
      	at org.apache.ignite.internal.processors.query.calcite.logical.ScriptTestRunner$1.run(ScriptTestRunner.java:219)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: java.lang.NoSuchMethodException: java.lang.Void.valueOf(java.lang.String)
      	at java.base/java.lang.Class.getMethod(Class.java:2109)
      	at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:314)
      	... 36 more
      

      The function SUBSTRING fails on NULL constant as the from and the for arguments.

      Attachments

        Issue Links

          Activity

            People

              alex_pl Aleksey Plekhanov
              tledkov-gridgain Taras Ledkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 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 - 0.5h
                  0.5h