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-16264][table] Fix ConnectTableDescriptor loose time attribute bug #11204
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 25f8beb (Tue Feb 25 03:16:49 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
Thanks @JingsongLi . I think FLINK-16265 is also introduced by FLINK-15912. We should fix that too. |
I created #11205 to fix FLINK-16265. |
/** | ||
* Test for {@link ConnectTableDescriptor}. | ||
*/ | ||
public class ConnectTableDescriptorTest { |
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 think we can add a verification in org.apache.flink.table.client.gateway.local.ExecutionContextTest#testTemporalTables
to check that the tableEnv.from("EnrichmentSource").getTableSchema
contains the rowtime field. It can cover the bug path.
It's not clear what the purpose of this test.
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.
There is no rowtime field in tableEnv.from("EnrichmentSource").getSchema
. Rowtime field needs special handle in connector codes when translate select ...
query.
This test is just for making sure CatalogTable
should be same to properties.
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.
There should be a rowtime field in tableEnv.from("EnrichmentSource").getSchema
, because DummyTableSourceFactory
in sql-client handles this.
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.
Maybe not.
It is catalog table, not ConnectorCatalogTable
.
Real invoking is in StreamTableSourceScan.translateToPlan
, it is hard to validate it.
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.
OK, it is from SQL-CLI, it is ConnectorCatalogTable
now, added test.
@@ -100,7 +100,7 @@ public TestTableSourceFactoryBase(String type, String testProperty) { | |||
public StreamTableSource<Row> createTableSource(TableSourceFactory.Context context) { | |||
TableSchema schema = context.getTable().getSchema(); | |||
final DescriptorProperties params = new DescriptorProperties(true); | |||
params.putProperties(context.getTable().getProperties()); | |||
params.putProperties(context.getTable().toProperties()); |
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 do you change this? Is it a mistake?
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.
Yes, SchemaValidator.deriveRowtimeAttributes
need properties contains TableSchema
.
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 class was createTableSource(properties)
, we should revert to that properties.
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.
Thank you. I see.
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.
LGTM.
Travis passed in: https://travis-ci.org/JingsongLi/flink/builds/654822147 |
Thanks @wuchong for reviewing, merged. |
What is the purpose of the change
In
CatalogTableImpl.fromProperties
, we can not remove allschema.*
for TableSchema, because Schema (it is a descriptor) is not same to TableSchema. Schema contains time attribute, so we need keep them in properties.Brief change log
Remove per key for TableSchema in
CatalogTableImpl.fromProperties
.Add test
ConnectTableDescriptorTest
.Verifying this change
ConnectTableDescriptorTest
.Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation