Skip to content

[AURON #2304] Add end-to-end IT coverage for composed native Calc predicates and expressions#2306

Merged
Tartarus0zm merged 2 commits into
apache:masterfrom
weiqingy:AURON-2304-impl
Jun 5, 2026
Merged

[AURON #2304] Add end-to-end IT coverage for composed native Calc predicates and expressions#2306
Tartarus0zm merged 2 commits into
apache:masterfrom
weiqingy:AURON-2304-impl

Conversation

@weiqingy

@weiqingy weiqingy commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #2304

Rationale for this change

Several operator combinations convert into a single native Flink Calc now that the expression converters merged (#1859 math, #1860 logical, #1861 comparison/LIKE), but they lacked end-to-end ITCase coverage — each composed case could not be tested while its partner operator still fell back, so only the per-operator converter unit tests existed. This adds the missing end-to-end coverage so a regression in the composed native path is caught. Test-only; no production change.

What changes are included in this PR?

Five end-to-end ITCase methods over the existing T1 table, asserting the final row set (native-on):

AuronFlinkCalcITCase (compound filters):

  • testFilterAndComparisonwhere int <> 1 AND ts = '2020-10-10 00:00:02'[2]
  • testFilterOrComparisonwhere int = 1 OR ts = '2020-10-10 00:00:03'[1, 2]
  • testFilterNotLikewhere string NOT LIKE 'Comment%'["Hi"]

AuronCalcRewriteITCase (CASE projections):

  • testCaseWhenComparisonGuardCASE WHEN int > 1 THEN int * 2 ELSE 0 END[0, 4, 4]
  • testCaseWhenMultipleBranchesCASE WHEN int = 1 THEN 'one' WHEN int > 2 THEN 'big' ELSE 'two' END["one", "two", "two"]

The compound predicates cross two columns deliberately: a same-column compound (e.g. int > 1 AND int < 5) is folded by Calcite's RexSimplify into a single SEARCH before reaching the converter, so it would not build a native And/Or node. String operands use equality (varchar inequalities currently fall back), and the comparisons avoid decimal-literal-vs-DOUBLE forms. Both operands of each compound are load-bearing, so an AND/OR swap changes the asserted row set.

Are there any user-facing changes?

No.

How was this patch tested?

These are the tests. The full auron-flink-planner module passes (109/109) with 0 Checkstyle violations. Each new test was confirmed to execute natively during development — the runtime plan dump shows the expected native node (FilterExec [int != 1 AND ts = ...], FilterExec [int = 1 OR ts = ...], FilterExec [NOT string LIKE Comment%], and ProjectExec [CASE WHEN ... END]) over the FFI reader, rather than a Flink-codegen fallback.

@github-actions github-actions Bot added the flink label Jun 4, 2026
@weiqingy

weiqingy commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi @Tartarus0zm, could you please help review this PR when you get a chance? Thanks!

I probably need to do rebase once #2303 is merged.

@Tartarus0zm

Copy link
Copy Markdown
Contributor

hi @weiqingy #2303 has merged, you can rebase and resolve conflicts

@Tartarus0zm
Tartarus0zm self-requested a review June 4, 2026 09:27
weiqingy added 2 commits June 4, 2026 20:27
…on tests

Add end-to-end ITCase coverage to AuronFlinkCalcITCase for operator
combinations that convert into a single native Flink Calc: AND/OR of
cross-column comparisons and NOT LIKE. Row-set assertions over T1,
native-on.
…gration tests

Add end-to-end ITCase coverage to AuronCalcRewriteITCase for CASE
expressions composed with comparisons: a per-row comparison guard and
a multi-branch searched CASE. Row-set assertions over T1, native-on.
@weiqingy

weiqingy commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @Tartarus0zm! The PR has been updated to resolve the conflicts.

@Tartarus0zm Tartarus0zm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hi @weiqingy thanks for your contribution!
LGTM

@Tartarus0zm
Tartarus0zm merged commit 7f5d84e into apache:master Jun 5, 2026
123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add end-to-end IT coverage for composed native Calc predicates and expressions

2 participants