Versions Compared

Key

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

...

Public Interfaces

DEFAULT Syntax

CREATE TABLE table_name (

     metadataCol

VARCHAR METADATA DEFAULT 'UNKNOWN',
  col VARCHAR DEFAULT '',

    col2 VARCHAR DEFAULT NULL

) WITH (
  ...
)

combine with VIRTUAL:

CREATE TABLE table

_

name (     metadataCol_

1 VARCHAR METADATA DEFAULT 'UNKNOWN',

     metadataCol_2 VARCHAR METADATA VIRTUAL DEFAULT 'UNKNOWN',
  col_1 VARCHAR DEFAULT '',

   

col2

col_2 VARCHAR DEFAULT NULL
) WITH (
  ...
)

 

Proposed Changes

Flink Table API & SQL handles DEFAULT constraint in the ddl.

...

The proposed syntax also follows this concept.

Implementation

Add DEFAULT keyword like current VIRTUAL keyword. Implemented details to be added.

Compatibility, Deprecation, and Migration Plan

The DEFAULT constraint is an optional KEYWORD to let uses define default value, so we don't need to deal with migration plan. And here is no need to add deprecationdeprecations.

Test Plan

Add DEFAULT constraint test cases & ensure all table & sql cases passed

...