Versions Compared

Key

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

...

so we propose this flip.

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 VARCHAR DEFAULT '',

    col2 VARCHAR DEFAULT NULL
) WITH (
  ...
)

 

Proposed Changes

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

This allows user set optional default value for the columns(physical columns/metadata columns). The only difference between current column and DEFAULT column is that we have a default value on that column.

The proposed syntax also follows this concept.

Implementation

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

...