Skip to content
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-20500][upsert-kafka] Fix temporal join test #14689

Merged
merged 2 commits into from
Jan 20, 2021

Conversation

fsk119
Copy link
Member

@fsk119 fsk119 commented Jan 19, 2021

What is the purpose of the change

The reason why the test fails is the records in the same partition are out-of-order. I print the partition-id and offset in the partition.

partition-0
<102,Greg,Berlin,BERLIN,2020-08-15T00:00:03,0,0>
<103,Richard,Berlin,BERLIN,2020-08-16T00:01:05,0,1>
<103,Richard,London,LONDON,2020-08-16T01:01:05,0,2>
<105,Tim,Shenzhen,SHENZHEN,2020-08-16T00:06,0,3>
<105,Tim,Hongkong,HONGKONG,2020-08-16T01:06,0,4>

partition-1
<100,Bob,Beijing,BEIJING,2020-08-15T00:00:01,1,0>
<101,Alice,Shanghai,SHANGHAI,2020-08-15T00:00:02,1,1>
<101,Alice,Wuhan,WUHAN,2020-08-16T00:02,1,2>
<101,Alice,Hangzhou,HANGZHOU,2020-08-16T01:04:05,1,3>
<104,Tomato,Hongkong,HONGKONG,2020-08-16T00:05:05,1,4>
<104,Tomato,Shenzhen,SHENZHEN,2020-08-16T01:05:05,1,5>

In the test, the expected record is <10004,104,2020-08-16T00:05:06,Tomato,HONGKONG,2020-08-16T00:05:05> but the actual record is <10004,104,2020-08-16T00:05:06,null,null,null>.

It may be the left stream record <10004,104,2020-08-16T00:05:06> arrives before the record <104,Tomato,Hongkong,HONGKONG,2020-08-16T00:05:05,1,4> in the right stream. When the left stream arrives, it finds the watermark is at timestamp 2020-08-16T01:04:05 in the right stream, which means the records before 2020-08-16T01:04:05 have arrived and emits itself.

Therefore, we should adjust the order in the partition or watermark strategy. Here we just adjust order for convenience. The new order in the partition follows.

<102,Greg,Berlin,BERLIN,2020-08-15T00:00:03,0,0>
<103,Richard,Berlin,BERLIN,2020-08-16T00:01:05,0,1>
<105,Tim,Shenzhen,SHENZHEN,2020-08-16T00:06,0,2>
<103,Richard,London,LONDON,2020-08-16T01:01:05,0,3>
<105,Tim,Hongkong,HONGKONG,2020-08-16T01:06,0,4>

<100,Bob,Beijing,BEIJING,2020-08-15T00:00:01,1,0>
<101,Alice,Shanghai,SHANGHAI,2020-08-15T00:00:02,1,1>
<101,Alice,Wuhan,WUHAN,2020-08-16T00:02,1,2>
<104,Tomato,Hongkong,HONGKONG,2020-08-16T00:05:05,1,3>
<101,Alice,Hangzhou,HANGZHOU,2020-08-16T01:04:05,1,4>
<104,Tomato,Shenzhen,SHENZHEN,2020-08-16T01:05:05,1,5>

Brief change log

  • Reorder the records in the partition

Documentation

  • Does this pull request introduce a new feature? (yes / no)

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 19, 2021

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 3e87860 (Fri May 28 07:11:18 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

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 commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 19, 2021

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@leonardBang leonardBang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fsk119 for the contribution, the change look good to me, the PR description is really good, it's great if we can add some note I in the code for readable consideration.

Copy link
Contributor

@leonardBang leonardBang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@wuchong wuchong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR description and thanks for digging into it.

LGTM.

@wuchong wuchong merged commit 5990514 into apache:master Jan 20, 2021
YuvalItzchakov pushed a commit to YuvalItzchakov/flink that referenced this pull request Jan 23, 2021
@fsk119 fsk119 deleted the FLINK-20500-3 branch November 22, 2021 07:43
jnh5y pushed a commit to jnh5y/flink that referenced this pull request Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants