Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-3216

Fix existing(+) INFORMATION_SCHEMA.COLUMNS columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • None
    • None

    Description

      Change logical null from -1 to actual NULL:

      • Change column CHARACTER_MAXIMUM_LENGTH.
      • Change column NUMERIC_PRECISION.
      • Change column NUMERIC_PRECISION_RADIX.
      • Change column NUMERIC_SCALE.

      Change column ORDINAL_POSITION from zero-based to one-based.

      Change column DATA_TYPE from short names (e.g., "CHAR") to specified names (e.g., "CHARACTER").

      • "CHAR" -> "CHARACTER"
      • "VARCHAR" -> "CHARACTER VARYING"
      • "VARBINARY" -> "BINARY VARYING"
      • "... ARRAY" -> "ARRAY"
      • "STRUCT (...)" -> "STRUCT"
      • ("(...) MAP" -> "MAP" (extension to standard, but follows standard's pattern))

      Fix data type names "INTERVAL_DAY_TIME" and "INTERVAL_YEAR_MONTH" to "INTERVAL":

      • Change column DATA_TYPE to list "INTERVAL" for interval types.
      • Add column INTERVAL_TYPE.

      Move CHAR length from NUMERIC_PRECISION to CHARACTER_MAXIMUM_LENGTH (same as VARCHAR length):

      • Change column NUMERIC_PRECISION from length to logical null for CHAR.
      • Change column CHARACTER_MAXIMUM_LENGTH from logical null to length for CHAR.

      Move BINARY and VARBINARY length from NUMERIC_PRECISION to CHARACTER_MAXIMUM_LENGTH (same as CHAR and VARCHAR length):

      • Change column NUMERIC_PRECISION from length to logical null for BINARY and VARBINARY.
      • Change column CHARACTER_MAXIMUM_LENGTH from logical null to length for BINARY and VARBINARY.

      To correct ordinal position of some existing columns:

      • Add column COLUMN_DEFAULT.
      • Add column CHARACTER_OCTET_LENGTH.
      • Reorder column NUMERIC_PRECISION.

      Move date/time and interval precisions from NUMERIC_PRECISION to DATETIME_PRECISION and INTERVAL_PRECISION:

      • Change column NUMERIC_PRECISION to logically null for date/time and interval types.
      • Add column DATETIME_PRECISION.
      • Add column INTERVAL_PRECISION.

      Implement NUMERIC_PRECISION_RADIX:

      • Change column NUMERIC_PRECISION_RADIX from always logically null to appropriate values (2, 10, NULL).

      Add missing numeric precision and scale values (for non-DECIMAL types):

      • Change NUMERIC_SCALE from logical null to zero for integer types.
      • Change NUMERIC_PRECISION from logical null to precision for non-DECIMAL numeric types.

      Update implementation of JDBC's DatabaseMeta.getColumns():

      • first, enough to not break
      • second, to use newly available data to fix some partial implementations.

      Attachments

        1. DRILL-3216.1Hygiene.4.patch.txt
          136 kB
          Daniel Barclay
        2. DRILL-3216.1Hygiene.6.patch.txt
          136 kB
          Daniel Barclay
        3. DRILL-3216.1HygieneBASE.4.patch.txt
          233 kB
          Daniel Barclay
        4. DRILL-3216.2Core.4.patch.txt
          223 kB
          Daniel Barclay
        5. DRILL-3216.2Core.5.patch.txt
          230 kB
          Daniel Barclay
        6. DRILL-3216.2Core.6.patch.txt
          230 kB
          Daniel Barclay
        7. DRILL-3216.2CoreBASE.4.patch.txt
          365 kB
          Daniel Barclay

        Issue Links

          Activity

            People

              dsbos Daniel Barclay
              dsbos Daniel Barclay
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: