-
Notifications
You must be signed in to change notification settings - Fork 404
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
[#6486] feat(iceberg): supports change Iceberg request in pre event listener #6485
base: main
Are you sure you want to change the base?
Conversation
@jerryshao @puchengy PTAL. |
@FANNG1 LGTM, can we also support Update table as well to begin with? Thanks |
I have a concern with this piece solution. Either we need to augment the create table request to meet the requirement, or we need a global solution for events. By global solution, I mean we may need a wrapper pattern for all events. Of course we can get his one case handled today, but in the long run, we have to make sure the same thing won't happen again. |
Regarding this PR, I think it is clean and okay to go ahead. |
return createTableRequestWrapper.get(); | ||
} | ||
|
||
public ObjectWrapper<CreateTableRequest> createTableRequestWrapper() { |
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.
what is this function used for? I can't find the caller. Same questions for similar functions in the preEvent classes.
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.
event listener invokes this function to get ObjectWrapper and set an new CreateTableRequest
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.
@FANNG1 Is this an upcoming change or is this included in the PR? I searched around but do not see where this method is called.
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 upcoming changes, it's the responsibility of end users to provide custom event listeners, like
public void onPreEvent(PreEvent preEvent) {
if (preEvent instanceof IcebergCreateTablePreEvent) {
ObjectWrapper<CreateTableRequest> objectWrapper = ((IcebergCreateTablePreEvent) preEvent).createTableRequestWrapper();
CreateTableRequest originalRequest = objectWrapper.get();
// create newRequest according to your business logic
objectWrapper.set(newRequest);
}
}
What changes were proposed in this pull request?
Use an wrapper class to allow user create an new request, and the dispatcher operator use the new created request. The event listener could leverage
ObjectWrapper
to create new Iceberg request.Why are the changes needed?
Fix: #6486
Does this PR introduce any user-facing change?
no
How was this patch tested?
change the iceberg request and it take affects when creating table in local enviroment