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

Enable GREATEST, LEAST functions in PostgreSQL library

    XMLWordPrintableJSON

Details

    Description

      The LEAST and GREATEST functions have been implemented for BigQuery and Oracle, but haven't been added for PostgreSQL. PostgreSQL supports LEAST, GREATEST as well [1].

      Also PostgreSQL's LEAST, GREATEST functions behave differently with NULL values than ORACLE or BigQuery.

      From PostgreSQL documentation [1]:
      The result will be NULL only if all the expressions evaluate to NULL.

      From BigQuery documentation [2]:
      They return NULL if any of the input parameters is NULL.

      [1] https://www.postgresql.org/docs/15/functions-conditional.html#FUNCTIONS-GREATEST-LEAST
      [2] https://cloud.google.com/bigquery/docs/reference/standard-sql/mathematical_functions

      Attachments

        Issue Links

          Activity

            People

              njordan Norman Jordan
              dmsysolyatin Dmitry Sysolyatin
              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 - 1h
                  1h