Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1504

Assertion error when determining monotonicity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.10.0
    • 1.11.0
    • core
    • None

    Description

      Using JdbcExample.java as a starting point and changing the SQL query in the run method to:

      select 2 * 2 * "empid" from "hr"."emps"

      causes the following exception:

      Exception in thread "main" java.lang.AssertionError: Internal error: invalid literal: 2 * 2
      at org.apache.calcite.util.Util.newInternal(Util.java:777)
      at org.apache.calcite.sql.SqlLiteral.value(SqlLiteral.java:350)
      at org.apache.calcite.sql.SqlCallBinding.getOperandLiteralValue(SqlCallBinding.java:219)
      at org.apache.calcite.sql.fun.SqlMonotonicBinaryOperator.getMonotonicity(SqlMonotonicBinaryOperator.java:103)
      at org.apache.calcite.sql.SqlCall.getMonotonicity(SqlCall.java:180)
      at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectList(SqlToRelConverter.java:3502)
      at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:665)
      at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:622)
      at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:2852)
      at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:556)
      at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:229)
      at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:193)
      at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:734)
      at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:597)
      at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:567)
      at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:215)
      at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:594)
      at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:613)
      at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:139)
      at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:208)
      at org.apache.calcite.examples.foodmart.java.JdbcExample.run(JdbcExample.java:50)
      at org.apache.calcite.examples.foodmart.java.JdbcExample.main(JdbcExample.java:36)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              andreasdamm Andreas Damm
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: