-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-19188][examples-table] Add a new streaming SQL example #13413
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
Conversation
… wrong result The batch mode rank only supports RANK function, so we only rewrite the stream mode query.
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 4ccc07b (Fri May 28 06:58:32 UTC 2021) 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. DetailsThe 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:
|
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.
Nice work!
+1 to merge, (after #13291 is merged, ofc ;) )
| import java.util.List; | ||
|
|
||
| /** | ||
| * Example for aggregating and ranking data using Flink SQL on updating (but bounded) streams. |
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.
nit: Is the (but bounded) note necessary or important for the example? Just wondering if it helps users understand the use case/example or introduces unnecessary distraction/additional concept to understand.
| ); | ||
|
|
||
| // since all cluster operations of the Table API are executed asynchronously, | ||
| // we need wait until the insertion has been completed, |
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.
| // we need wait until the insertion has been completed, | |
| // we need to wait until the insertion has been completed, |
|
@rmetzger Do we consider examples as features? This PR is laying around for quite some time and was blocked by a bug that will be fixed soon. The Table/SQL API lacks new updated examples. |
|
I think examples are comparable to documentation. I still would be careful if an example changes a lot of dependencies. In this case I'm fine with merging it. |
| final RowKind kind = row.getKind(); | ||
| switch (kind) { | ||
| case INSERT: | ||
| case UPDATE_BEFORE: |
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.
Here should be UPDATE_AFTER
| row.setKind(RowKind.INSERT); // for equality | ||
| materializedUpdates.add(row); | ||
| break; | ||
| case UPDATE_AFTER: |
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.
Here should be UPDATE_BEFORE
What is the purpose of the change
Example for aggregating and ranking data using Flink SQL on updating (but bounded) streams.
This PR depends on #13291.
Brief change log
The example shows how to declare a table using SQL DDL for reading insert-only data and handling
updating data. It should give a first impression about Flink SQL as a changelog processor. The example
uses some streaming operations that produce a stream of updates. See the other examples for pure CDC
processing and more complex operations.
Verifying this change
This change added tests and can be verified as follows:
UpdatingTopCityExampleDoes this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation