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

The type of a union of CHAR columns of different lengths should be VARCHAR (based on a conformance setting)

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.17.0
    • Component/s: core
    • Labels:
      None

      Description

      The shouldRaggedFixedLengthValueUnionBeVariable() function in SqlTypeFactoryImpl always return false now. It is good to make it configurable since some system may need the function to return true to provide pragmatic behavior. For example, for the sql: case 1 when 1 then 'a' when 2 then 'bcd' end, we need the return value to be 'a' instead of 'a ' of CHAR(3).

      I see one option to solve this issue: Add boolean shouldRaggedFixedLengthValueUnionBeVariable() in RelDataTypeSystem, so external system can override to configure the value.

      Any suggestions are welcomed. Thanks a lot.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              hequn8128 Hequn Cheng
              Reporter:
              hequn8128 Hequn Cheng

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment