Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: trivial edits in Proposed Changes section

...

CREATE TABLE will be updated to let user specify DEFAULT if following waysas follows:

  • With column definition

    • CREATE TABLE <tableName> (<columnName> <dataType> DEFAULT <defaultValue>)

  • With constraint specification

    • CREATE TABLE <tableName> (<columnName> <dataType>, …, CONSTRAINT <constraintName> DEFAULT <defaultValue> (<columnName>)

To be compliant with SQL standard standards, Hive will only permit default values which falls fall in one of the following categorycategories:

  • LITERALLITERAL 

  • DATE TIME VALUE FUNCTION i.e. , that is, CURRENT_TIME, CURRENT_DATEDATE 

  • CURRENT_USER() 
  • NULLNULL 
  • CAST (<expression in above category> as PRIMITIVE TYPE) 

INSERT

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

...