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

ClassCastException with FLOOR and CEIL on conformances that are not builtin

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 1.35.0
    • None

    Description

      CALCITE-5747 introduced some BigQuery-specific logic for FLOOR and CEIL that is keyed off the conformance being SqlConformanceEnum.BIG_QUERY. However, it was implemented in such a way that implementations of SqlConformance that are not SqlConformanceEnum would throw ClassCastException, due to this line in Parser.jj:

      SqlOperator op = SqlStdOperatorTable.floorCeil(floorFlag, (SqlConformanceEnum) this.conformance);
      

      Better would be to pass this.conformance without casting, and adjust SqlStdOperatorTable.floorCeil to handle any kind of conformance.

      This affects us in Apache Druid land, because we have a conformance that extends SqlAbstractConformance.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gian Gian Merlino
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: