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

Calcite. 'CREATE TABLE' fails if 'DEFAULT' is null.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.14
    • 2.17
    • None
    • SQL Calcite: Fixed failure on 'CREATE TABLE' DDL with Calcite engine when 'DEFAULT' column value is NULL.
    • Release Notes Required

    Description

      Reproducer:

      CREATE TABLE tbl(id int PRIMARY KEY, val INTEGER DEFAULT NULL)
      
      org.apache.ignite.internal.processors.query.IgniteSQLException: Cannot convert literal NULL to type class java.lang.Byte
      	at org.apache.ignite.internal.processors.query.calcite.util.TypeUtils.fromLiteral(TypeUtils.java:508) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.prepare.ddl.DdlSqlToCommandConverter.convertCreateTable(DdlSqlToCommandConverter.java:235) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.prepare.ddl.DdlSqlToCommandConverter.convert(DdlSqlToCommandConverter.java:158) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareDdl(PrepareServiceImpl.java:132) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareSingle(PrepareServiceImpl.java:84) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$5(CalciteQueryProcessor.java:524) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.lambda$queryPlan$0(QueryPlanCacheImpl.java:70) ~[classes/:?]
      	at java.base/java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:330) ~[?:?]
      	at org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:70) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.lambda$parseAndProcessQuery$6(CalciteQueryProcessor.java:521) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.processQuery(CalciteQueryProcessor.java:641) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.parseAndProcessQuery(CalciteQueryProcessor.java:518) ~[classes/:?]
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:393) ~[classes/:?]
      

      Adoption of #IGNITE-18965

      Attachments

        Issue Links

          Activity

            People

              vladsz83 Vladimir Steshin
              vladsz83 Vladimir Steshin
              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 - 20m
                  20m