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

Validation of Pivot fails after creating a deep copy of SqlNode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.32.0
    • 1.33.0
    • None

    Description

      When creating a deep copy of SqlNode with the Pivot operator, SqlShuttle creates SqlBasicCall instead of SqlPivot, and such SqlNode fails when validating the query:

      Caused by: java.lang.ClassCastException: org.apache.calcite.sql.SqlBasicCall cannot be cast to org.apache.calcite.sql.SqlPivot
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.registerFrom(SqlValidatorImpl.java:2389)
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.registerQuery(SqlValidatorImpl.java:2757)
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.registerQuery(SqlValidatorImpl.java:2696)
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1074)
      	at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:782)
      	at org.apache.calcite.prepare.PlannerImpl.validate(PlannerImpl.java:224)
      	... 61 more
      

      Attachments

        Issue Links

          Activity

            People

              volodymyr Vova Vysotskyi
              volodymyr Vova Vysotskyi
              Votes:
              1 Vote for this issue
              Watchers:
              4 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 - 1h 10m
                  1h 10m