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

AggregateCaseToFilterRule handles NULL values incorrectly

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.22.0
    • Component/s: None

      Description

      AggregateCaseToFilterRule handles NULL values incorrectly. It converts

      SELECT COUNT(CASE WHEN b THEN NULL ELSE 1 END) FROM t
      

      to

      SELECT COUNT(*) FILTER (WHERE b IS FALSE) FROM t
      

      which fails to count rows where b is UNKNOWN, so it should convert to

      SELECT COUNT(*) FILTER (WHERE b IS NOT TRUE) FROM t
      

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h

                  Issue deployment