-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[FLINK-37914][table] Add built-in OBJECT_UPDATE function #26806
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davidradl
reviewed
Jul 17, 2025
56a3f1e
to
e437f51
Compare
twalthr
reviewed
Jul 22, 2025
.../flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/BaseExpressions.java
Outdated
Show resolved
Hide resolved
.../flink-table-api-java/src/main/java/org/apache/flink/table/api/internal/BaseExpressions.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/flink/table/types/inference/strategies/ObjectUpdateInputTypeStrategy.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/flink/table/types/inference/strategies/ObjectUpdateInputTypeStrategy.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/flink/table/types/inference/strategies/ObjectUpdateTypeStrategy.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/flink/table/types/inference/strategies/ObjectUpdateTypeStrategy.java
Outdated
Show resolved
Hide resolved
...lanner/src/test/java/org/apache/flink/table/planner/functions/StructuredFunctionsITCase.java
Show resolved
Hide resolved
5a1cb17
to
336f2b3
Compare
twalthr
reviewed
Jul 24, 2025
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.
Last review comment. Almost there :-)
...in/java/org/apache/flink/table/types/inference/strategies/ObjectUpdateInputTypeStrategy.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/flink/table/types/inference/strategies/ObjectUpdateTypeStrategy.java
Outdated
Show resolved
Hide resolved
...lanner/src/test/java/org/apache/flink/table/planner/functions/StructuredFunctionsITCase.java
Show resolved
Hide resolved
...time/src/main/java/org/apache/flink/table/runtime/functions/scalar/ObjectUpdateFunction.java
Show resolved
Hide resolved
twalthr
approved these changes
Jul 28, 2025
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.
Thanks for the update @raminqaf. LGTM.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
This pull request implements the
OBJECT_UPDATE
built-in function as part of FLIP-520: Simplify StructuredType handling. The function allows users to update existing fields in structured objects by providing key-value pairs, enabling mutation operations on structured types in both SQL and Table API without requiring custom UDFs.Brief change log
ObjectUpdateInputTypeStrategy
for validating input arguments (structured object + key-value pairs)ObjectUpdateTypeStrategy
for inferring return types (same as input structured type)ObjectUpdateFunction
runtime function for performing field updatesOBJECT_UPDATE
toBuiltInFunctionDefinitions
with proper type inference strategiesobjectUpdate()
method on expressionsVerifying this change
This change added tests and can be verified as follows:
ObjectUpdateInputTypeStrategyTest
for input validation scenariosStructuredFunctionsITCase
for end-to-end SQL functionalityDoes this pull request potentially affect one of the following parts:
@Public(Evolving)
: yes (new built-in function)Documentation