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

RexLiteral.getValue3 throws AssertionError with null literal of type DECIMAL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.17.0
    • core
    • None

    Description

      @Test public void testDecimalLiteral() {
        final RelDataTypeFactory typeFactory =
                new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT);
        RelDataType dateType = typeFactory.createSqlType(SqlTypeName.DECIMAL);
        final RexBuilder builder = new RexBuilder(typeFactory);
        RexLiteral literal = builder.makeExactLiteral(null, dateType);
        assertEquals(null, literal.getValue3());
      }
      

      AssertionError is thrown in above case:

      java.lang.AssertionError
      at org.apache.calcite.rex.RexLiteral.getValue3(RexLiteral.java:757)
      at org.apache.calcite.rex.RexBuilderTest.testDecimalLiteral(RexBuilderTest.java:485)

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            godfreyhe godfrey he
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: