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-35981][transform] Transform rule support referencing one column more than once #3515

Merged
merged 5 commits into from
Aug 9, 2024

Conversation

MOBIN-F
Copy link
Contributor

@MOBIN-F MOBIN-F commented Aug 7, 2024

Currently, transform rule (projection / filtering) doesn't support referencing one column more than once, which means if we write such a projection rule:

transform:

projection: *, age * age AS age_square
filter: age < 18 OR age > 60

Caused by: org.apache.flink.shaded.guava31.com.google.common.util.concurrent.UncheckedExecutionException: org.apache.flink.api.common.InvalidProgramException: Expression cannot be compiled. This is a bug. Please file an issue.
Expression: import static org.apache.flink.cdc.runtime.functions.SystemFunctionUtils.*;age * age

@MOBIN-F
Copy link
Contributor Author

MOBIN-F commented Aug 7, 2024

please help to review this PR, thanks. @yuxiqian

Copy link
Contributor

@yuxiqian yuxiqian left a comment

Choose a reason for hiding this comment

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

Looks good! Just left a minor comment about test case.

Copy link
Contributor

@yuxiqian yuxiqian left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! To make CI pass, please wait for #3516 to be merged, and rebase this PR to master then.

# Conflicts:
#	flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/ProjectionColumnProcessor.java
#	flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/TransformFilterProcessor.java
#	flink-cdc-runtime/src/test/java/org/apache/flink/cdc/runtime/operators/transform/PostTransformOperatorTest.java
@yuxiqian
Copy link
Contributor

yuxiqian commented Aug 9, 2024

Hi @MOBIN-F, sorry but another rebasing might be required since #3465 got merged. :(

@MOBIN-F
Copy link
Contributor Author

MOBIN-F commented Aug 9, 2024

Hi @MOBIN-F, sorry but another rebasing might be required since #3465 got merged. :(

done

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 @MOBIN-F for the contribution, LGTM

@leonardBang leonardBang merged commit 84ef9d5 into apache:master Aug 9, 2024
21 checks passed
qiaozongmi pushed a commit to qiaozongmi/flink-cdc that referenced this pull request Sep 23, 2024
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.

3 participants