Versions Compared

Key

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

...

  • 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 Hive will only permit default values which falls in one of following category:

  • LITERAL

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

  • CURRENT_USER() 
  • CURRENT_DATABASE()

  • NULL

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

...