Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • LITERAL

  • DATE TIME VALUE FUNCTION i.e. CURRENT_TIME, CURRENT_DATE

  • CURRENT_USER()

  • CURRENT_DATABASE()

  • NULL

INSERT

Anytime user doesn’t specify a value explicitly for a column its default value will be used if defined e.g

...

  • ALTER TABLE CHANGE COLUMN

  • ALTER TABLE DROP CONSTRAINT

 

Restrictions

  • Hive will have strict type rules for defining default value i.e. default value will have to be exact type as column type.
  • Default with Complex data types i.e Array, Struct, Map and Union are not allowed.

Proposed Design

Currently if INSERT query is missing a value in INSERT i.e. if user hasn’t specified a value for column Hive uses ‘NULL’ as default. Hive compiler detects this missing column value at compile time and inserts a NULL. We propose to update this logic to check for default and use that instead of NULL value.

...