andygrove commented on code in PR #2898:
URL:
https://github.com/apache/datafusion-ballista/pull/2898#discussion_r4643076334
##########
ballista/scheduler/src/planner.rs:
##########
@@ -186,10 +186,26 @@ impl DefaultDistributedPlanner {
)?;
stages.append(&mut probe_stages);
+ let null_aware = hash_join.null_aware;
let new_join = execution_plan.replace_children(
vec![broadcast_left, probe],
ReplaceChildrenOptions::new(ChildrenPropertiesMode::Recompute),
)?;
+ // A null-aware join must keep the coalesce over its probe side,
but
+ // `EnsureRequirements` removes it if it reruns over this stage at
a
+ // boundary above. Close the stage at the join so it cannot.
+ if null_aware {
Review Comment:
One small thought. When the join is already at the root, this adds a stage
that only copies the join output. That seems fine to me given how small that
output is. Would it be worth a short note in the comment that this is expected,
so nobody "optimizes" it away later?
##########
ballista/client/tests/null_aware.rs:
##########
@@ -79,23 +95,50 @@ mod null_aware {
// all. "prefer_hash_join" and "aqe" exercise the rewrite under the
// hash-join planning paths. "rewrite_disabled" turns the rewrite off
// with hash joins preferred, covering the fallback path where the
- // null-aware join survives and is lowered to a single task.
- for variant in ["default", "prefer_hash_join", "aqe",
"rewrite_disabled"] {
- let ctx = SessionContext::standalone().await.unwrap();
+ // null-aware join survives and is lowered to a single task, under the
+ // default adaptive planner; "rewrite_disabled_static" and
+ // "rewrite_disabled_pipelined" do the same under the static planner,
+ // which pipelined mode always uses. All three run one partition per
+ // task, as on a cluster.
+ for variant in [
+ "default",
+ "prefer_hash_join",
+ "aqe",
+ "rewrite_disabled",
+ "rewrite_disabled_static",
+ "rewrite_disabled_pipelined",
+ ] {
+ // A standalone cluster started pipelined runs push-staged. Its
+ // placement doesn't pick up a later `SET` of the task cap.
+ let ctx = if variant == "rewrite_disabled_pipelined" {
+ let state = ballista_state(&[
+ (BALLISTA_EXECUTION_MODE, "pipelined"),
+ ("ballista.scheduler.max_partitions_per_task", "1"),
+ ]);
+ SessionContext::standalone_with_state(state).await.unwrap()
+ } else {
+ SessionContext::standalone().await.unwrap()
+ };
if variant == "aqe" {
set_option(&ctx, "ballista.planner.adaptive.enabled",
"true").await;
}
if variant != "default" {
set_option(&ctx, "datafusion.optimizer.prefer_hash_join",
"true").await;
}
- if variant == "rewrite_disabled" {
+ if variant.starts_with("rewrite_disabled") {
set_option(&ctx, "ballista.optimizer.not_in_subquery_rewrite",
"false")
.await;
+ set_option(&ctx, "ballista.scheduler.max_partitions_per_task",
"1").await;
Review Comment:
Tiny one. The `rewrite_disabled_pipelined` variant sets
`max_partitions_per_task` in `ballista_state` and then again through
`set_option` here. Totally harmless. Just flagging it in case you want to skip
the second `SET` for that variant.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]