Versions Compared

Key

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

...

CONSTRAINTS | INDEXES | STORAGE | COMMENTS | ALL

I suggest supporting INCLUDING/EXCLUDINGlike-options:

  • ALL
  • CONSTRAINTS: primary keys, unique key, does not include NOT NULL constraint (in Flink it's part of the type)
  • GENERATED: computed columns
  • OPTIONS: connector properties in WITH (...) clause
  • PARTITIONS: partitions definition

Additionally I suggest supporting different INCLUDING/EXCLUDING like-options strategies:

  • INCLUDING (default -> fail on duplicate keys)
  • EXCLUDING
  • OVERWRITING (any explicit options/columns overwrite options/columns from base source, overwriting happens in the order the LIKE clauses were declared)

The supported combinations would be:

...

The reason why I suggest not to support OVERWRITING CONSTRAINTS is that usually it's rather hard to overwrite only some of the constraints. If the constraint(primary key, unique key) from the base table does not apply to the derived table, in my opinion it is safer to exclude all constraints and redefine them.  We could revisit that in the future, if we see a need to support also OVERWRITING for constraints. The same applies for PARTITIONS.

Default options:

    INCLUDING ALL = INCLUDING CONSTRAINTS

...