Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-16605

Enforce NOT NULL constraints

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • None

    Description

      Since NOT NULL is so common it would be great to have tables start to enforce that.

      ekoifman described a possible approach in HIVE-16575:

      One way to enforce not null constraint is to have the optimizer add enforce_not_null UDF which throws if it sees a NULL, otherwise it's pass through.
      So if 'b' has not null constraint,
      Insert into T select a,b,c... would become
      Insert into T select a, enforce_not_null(b), c.....
      This would work for any table type.

      Attachments

        1. HIVE-16605.1.patch
          59 kB
          Vineet Garg
        2. HIVE-16605.2.patch
          59 kB
          Vineet Garg
        3. HIVE-16605.3.patch
          284 kB
          Vineet Garg
        4. HIVE-16605.4.patch
          431 kB
          Vineet Garg
        5. HIVE-16605.5.patch
          440 kB
          Vineet Garg

        Issue Links

          Activity

            People

              vgarg Vineet Garg
              cartershanklin Carter Shanklin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: