[FLINK-38906] Pass transform parser in context and polish built-in functions#4248
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the TransformParser context handling and extends built-in function support for FLINK-38906. The PR introduces a structured Context class to organize transformation parameters, adds support for decimal arithmetic operations, and extends temporal functions with TO_TIMESTAMP_LTZ, DATE_FORMAT_TZ, and DATE_ADD. It also defers script expression generation from TransformFilter initialization to TransformFilterProcessor construction for better architecture.
Changes:
- Introduced JaninoCompiler.Context class to encapsulate columns, column name mappings, UDF descriptors, and metadata columns
- Added decimal arithmetic handling that generates method invocations for BigDecimal operations
- Extended temporal functions with TO_TIMESTAMP_LTZ, DATE_FORMAT_TZ, DATE_ADD, and added DATE/TIME support to DATE_FORMAT
- Moved script expression generation from TransformFilter to TransformFilterProcessor for proper column access
- Added Byte type support to comparison functions and refactored IN/NOT IN operations
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| JaninoCompiler.java | Introduced Context class, added decimal arithmetic handling, updated all method signatures to use Context |
| TransformParser.java | Updated to create and pass Context objects, added deduceSubExpressionType utility method |
| TransformFilter.java | Removed scriptExpression field and moved generation responsibility to processor |
| TransformFilterProcessor.java | Now generates script expression at construction time with proper column access |
| TransformExpressionKey.java | Moved loadSystemFunction call from construction to getExpression() method |
| ProjectionColumnProcessor.java | Removed redundant loadSystemFunction call |
| PreTransformOperator.java | Updated TransformFilter.of() call to not pass udfDescriptors |
| PostTransformOperator.java | Updated TransformFilter.of() call to not pass udfDescriptors |
| TransformSqlOperatorTable.java | Added TO_TIMESTAMP_LTZ, DATE_FORMAT_TZ, DATE_ADD functions and extended DATE_FORMAT operand types |
| ComparisonFunctions.java | Added Byte support for BETWEEN/IN operations, simplified IN/NOT IN implementations |
| TransformParserTest.java | Updated test calls to include new Context parameters |
| FlinkPipelineTransformITCase.java | Updated error message assertions to include LOAD_MODULES_EXPRESSION prefix |
| temporal.yaml | Removed ignore flags for tests now passing with new functionality |
| decimal.yaml | Removed ignore flags for tests now passing with decimal arithmetic support |
| comparison.yaml | Removed ignore flags for tests now passing with Byte support |
| meta.yaml | Removed unrelated test case for FIELD_NAME_LOWER_CASE converter |
| transform.md (English) | Added documentation for new temporal functions with formatting issues |
| transform.md (Chinese) | Added documentation for new temporal functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
…ATE related built-in functions
Hisoka-X
reviewed
Jan 30, 2026
…/flink/FlinkPipelineTransformITCase.java Co-authored-by: Jia Fan <fanjiaeminem@qq.com>
ThorneANN
pushed a commit
to ThorneANN/flink-cdc
that referenced
this pull request
Mar 19, 2026
…nctions (apache#4248) Co-authored-by: Jia Fan <fanjiaeminem@qq.com>
Mrart
pushed a commit
to Mrart/flink-cdc
that referenced
this pull request
Mar 26, 2026
…nctions (apache#4248) Co-authored-by: Jia Fan <fanjiaeminem@qq.com>
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
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.
This closes FLINK-38906...
...by allowing decimal arithmetic expressions and extended previously missing temporal functions.
Also organized TransformParser context into named structs, and added a utility function to infer physical type of calcite nodes.