You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 12a12bc
Browse filesBrowse the repository at this point in the historyBrowse files
- Per-expression early bail-out: check has_subquery(&rewritten) immediately
after each rewrite instead of processing all exprs then checking at end.
Preserves all-or-nothing semantics with earlier termination.
- Add "Optimization:" prefix to alias preservation comment to clarify it is
not required for correctness.
- Add test projection_mixed_decorrelatable_and_non_bails_out covering one
decorrelatable + one non-decorrelatable subquery in the same projection
(exercises the partial-rewrite-then-bail path).
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
// case_ok is listed before case_bad so it would decorrelate first
2460
+
// if we processed each expression independently. The per-expression
2461
+
// bail-out must detect case_bad's failure and discard case_ok's
2462
+
// rewrite too.
2463
+
let plan = LogicalPlanBuilder::from(table_scan)
2464
+
.project(vec![col("a"), case_ok, case_bad])?
2465
+
.build()?;
2466
+
2467
+
// Both subqueries remain — bail-out is all-or-nothing.
2468
+
// The decorrelatable one is NOT rewritten because its sibling can't be.
2469
+
assert_optimized_plan_equal!(
2470
+
plan,
2471
+
@r#"
2472
+
Projection: test.a, CASE WHEN test.c IN (<subquery>) THEN Utf8("ok") ELSE Utf8("not_ok") END, CASE WHEN test.c IN (<subquery>) THEN Utf8("bad") ELSE Utf8("not_bad") END [a:UInt32, CASE WHEN IN THEN Utf8("ok") ELSE Utf8("not_ok") END:Utf8, CASE WHEN IN THEN Utf8("bad") ELSE Utf8("not_bad") END:Utf8]
0 commit comments