[Feature] Support config column/primaryKey/constraintKey in schema#5564
Conversation
9715f38 to
a6d35a8
Compare
a6d35a8 to
2e595a0
Compare
f0b787c to
2b296e2
Compare
| |:---------------|:------------| | ||
| | KEY | key | | ||
| | UNIQUE_KEY | unique key | | ||
| | FOREIGN_KEY | foreign key | |
There was a problem hiding this comment.
How to use FOREIGN_KEY in SeaTunnel? Seem like never use it now?
There was a problem hiding this comment.
In fact, we don't support foreign keys!
There was a problem hiding this comment.
So I think we should remove it?
There was a problem hiding this comment.
OK, I will remove this until we support it in the future
|
|
||
| | ConstraintType | Description | | ||
| |:---------------|:------------| | ||
| | KEY | key | |
There was a problem hiding this comment.
KEY means the index in schema, I am not clear if we need to rename it to index, since in the backend code it is KEY.
There was a problem hiding this comment.
Yes, use INDEX_KEY is better
70682c7 to
640c451
Compare
| |:---------------|:------------| | ||
| | KEY | key | | ||
| | UNIQUE_KEY | unique key | | ||
| | FOREIGN_KEY | foreign key | |
There was a problem hiding this comment.
So I think we should remove it?
|
|
||
| | ConstraintType | Description | | ||
| |:---------------|:------------| | ||
| | KEY | key | |
| @Deprecated | ||
| public static final Option<Map<String, String>> SCHEMA = |
There was a problem hiding this comment.
Can we just delete it now? Since it just be used in internal code.
| // Use TableSchemaOptions.FieldOptions.FIELDS instead | ||
| @Deprecated | ||
| public static final Option<Map<String, Object>> FIELDS = | ||
| Options.key("schema.fields") |
|
Any demo we can directly run? I find we add this new feature but we don't have any e2e demo to prove it worked. |
I will add e2e after #5562 merged, right now the CatalogTable cannot transport from source to post task. |
b80fd3f to
b08f83a
Compare
a621ba9 to
af7e2d7
Compare
af7e2d7 to
da21881
Compare
da21881 to
cb7a606
Compare
cb7a606 to
d300a88
Compare
| implements TableSchemaParser.ConstraintKeyParser<ReadonlyConfig> { | ||
|
|
||
| @Override | ||
| public List<ConstraintKey> parse(ReadonlyConfig schemaConfig) { |
| () -> | ||
| new IllegalArgumentException( | ||
| "schema.constraintKeys.* config need option [constraintType], please correct your config first")); | ||
| List<ConstraintKey.ConstraintKeyColumn> columns = |
There was a problem hiding this comment.
After ReadonlyConfig refactor, we may support get object from ReadonlyConfig or do this check in a better way.
Purpose of this pull request
Add some options in the schema used to define the whole TableSchema.
Does this PR introduce any user-facing change?
Yes, but this is compatibility with the history version.
How was this patch tested?
Check list
New License Guide
release-note.