Uploaded image for project: 'EXASOL Roadmap'
  1. EXASOL Roadmap
  2. EXASOL-2583

Full type deduction for nulls in tuples

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: Exasol 7.1.0
    • Component/s: None
    • Labels:
      None

      Description

      Problem

      Starting with version 6.2.3, Exasol deduces the type of NULL in tuples based on constants. Its type deduction does not support expressions. This can lead to type errors.

      Example:

      SELECT * FROM VALUES ((1+1, TRUE), (NULL, FALSE)) AS t(i, b);
      

      Workaround

      It is possible to cast the null to the desired data type.
      Example:

      SELECT * FROM VALUES ((1+1, TRUE), (CAST(NULL AS INT), FALSE)) AS t(i, b);
      

      Problem

      Up to version 6.2.3, Exasol assumes that the type of NULL in tuples is BOOLEAN. This can cause type errors.

      Example:

      SELECT * FROM VALUES ((1, TRUE), (NULL, FALSE)) AS t(i, b);
      

      Workaround

      It is possible to cast the null to the desired data type.
      Example:

      SELECT * FROM VALUES ((1, TRUE), (CAST(NULL AS CHAR(1)), FALSE)) AS t(i, b);
      

      With a full and fast type deduction such queries would not require casts.

        Attachments

          Activity

            People

            • Assignee:
              CaptainEXA Captain EXASOL
              Reporter:
              CaptainEXA Captain EXASOL
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: