-
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] Support speculative execution when batch read paimon table. #4395
[Flink] Support speculative execution when batch read paimon table. #4395
Conversation
@@ -41,7 +42,8 @@ | |||
|
|||
/** A {@link SplitEnumerator} implementation for {@link StaticFileStoreSource} input. */ | |||
public class StaticFileStoreSplitEnumerator | |||
implements SplitEnumerator<FileStoreSourceSplit, PendingSplitsCheckpoint> { | |||
implements SplitEnumerator<FileStoreSourceSplit, PendingSplitsCheckpoint>, | |||
SupportsHandleExecutionAttemptSourceEvent { |
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.
You may need to introduce classes for Flink 1.15.
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 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.
No, it is good to keep Flink 1.15 support.
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
2e799fe
to
766d8d2
Compare
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.
A simpler solution for 1.15, you can just create a class org.apache.flink.api.connector.source.SupportsHandleExecutionAttemptSourceEvent
in paimon-flink-1.15.
766d8d2
to
35b595c
Compare
Good idea, done. |
// Only recognize events that don't care attemptNumber | ||
handleSourceEvent(subtaskId, sourceEvent); | ||
} | ||
|
||
@Override | ||
public void handleSourceEvent(int subtaskId, SourceEvent sourceEvent) { | ||
if (sourceEvent instanceof ReaderConsumeProgressEvent) { |
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 add a comment to note that when to support a new kind of event, one needs to pay attention that whether the event can be sent multiple times from different attempts of one subtask. See the description of SupportsHandleExecutionAttemptSourceEvent
for more details.
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.
In case someone later adds a new kind of event directly to this method, ignoring the method with attemptNumber
.
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.
thx, done
c60a5b5
to
97f7845
Compare
97f7845
to
e00ebc7
Compare
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.
+1 Thanks @wwj6591812 and @zhuzhurk |
Purpose
In my company's production job, when batch read a paimon table, I receive the exception.
After read flink and paimon code, I know it means paimon use custom SourceEvent ReaderConsumeProgressEvent.
I have come up with two solutions:
1、Implement the interface SupportsHandleExecutionAttemptSourceEvent according to the exception suggestion;
2、Delete ReaderConsumeProgressEvent in StaticFileStoreSplitEnumerator.
Due to the possibility of new other SourceEvent being added in the future, so I chose the solutions-1.
Linked issue: close #xxx
Tests
API and Format
Documentation