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

Invalid "Invalid literal" error for complex expression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.10.0
    • 1.11.0
    • None
    • None

    Description

      SQL:

      select 8388608/(60+27.39)
      

      When I call the

      sqlToRelConverter.convertQuery 

      convert the SqlNode to RelNode, an error as follow:

      Exception in thread "main" java.lang.AssertionError: Internal error: invalid literal: 60 + 27.39
      	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.SqlBinaryOperator.getMonotonicity(SqlBinaryOperator.java:189)
      	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.PlannerImpl.rel(PlannerImpl.java:227)
      
      

      Is this OK?

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              dongming Dongming Liu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: