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

Deduce whether CASE and COALESCE may produce NULL values

    XMLWordPrintableJSON

Details

    Description

      When executing queries like: 
      "SELECT COALESCE(name, 'unknown') as name_out FROM PCOLLECTION"
      (input 'name' is nullable)

      There is a need to know whether the result is nullable or not (in this case - not). During validation stage "COALESCE" is being transformed (via SqlValidatorImpl.performUnconditionalRewrites) into a "CASE" statement, which currently does not determine nullability of a result.

      Attachments

        Issue Links

          Activity

            People

              Chunwei Lei Chunwei Lei
              kirillkozlov Kirill Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              6 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 - 2h 10m
                  2h 10m