-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flink] Avoid deprecated usage on TableSchema, DataType and DescriptorProperties #4611
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am concern about the serialization for watermark spec, can you create some test for compatibility? (You can create schema file from old Paimon, and read it in tests)
@JingsongLi Map<String, String> expected = new HashMap<>();
String watermarkPrefix = compoundKey(SCHEMA, WATERMARK, 0);
expected.put(compoundKey(watermarkPrefix, WATERMARK_ROWTIME), "test_time");
expected.put(
compoundKey(watermarkPrefix, WATERMARK_STRATEGY_EXPR),
"`test_time` - INTERVAL '0.001' SECOND");
expected.put(compoundKey(watermarkPrefix, WATERMARK_STRATEGY_DATA_TYPE), "TIMESTAMP(3)"); This code stands for the serialization result since the older versions of Paimon. This PR does not change this part of code, which means the compatibility should be guaranteed. |
return builder.build(); | ||
} | ||
|
||
@Override | ||
public CatalogBaseTable copy() { | ||
return new DataCatalogTable( | ||
table, | ||
getSchema().copy(), | ||
Schema.newBuilder().fromSchema(schema).build(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need to copy it? I see there is no copy in DefaultCatalogTable
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy was added because the copy had been made in the existing implementation. But I agree with it that the copy is unnecessary. I'll remove it.
+1 |
Purpose
Linked issue: #4442
This PR removes deprecated usages about Flink Table API, mainly including TableSchema and DescriptorProperties.
Tests
Existing test cases are used to verify this change.
API and Format
This change does not affect API or storage format.
Documentation
This change does not affect introduce a new feature.