milenkovicm commented on code in PR #1684:
URL:
https://github.com/apache/datafusion-ballista/pull/1684#discussion_r3255413292
##########
ballista/scheduler/src/state/aqe/adapter.rs:
##########
@@ -57,10 +58,54 @@ impl BallistaAdapter {
})?;
self.inputs.push(stage_id);
let partitioning = exchange.properties().partitioning.clone();
- let shuffle_read =
- ShuffleReaderExec::try_new(stage_id, partitions, schema,
partitioning)?;
- Ok(Transformed::yes(Arc::new(shuffle_read)))
+ let reader = match exchange.coalesce() {
+ Some(cp) => {
+ // Concatenate M-shape locations into K-shape per
CoalescePlan.groups.
+ let k_shape: Vec<Vec<_>> = cp
+ .groups
+ .iter()
+ .map(|pg| {
+ let mut concat = Vec::new();
+ for &idx in &pg.upstream_indices {
+ if let Some(inner) = partitions.get(idx as
usize) {
+ concat.extend_from_slice(inner);
+ }
+ }
+ concat
+ })
+ .collect();
+ let new_partitioning = match &partitioning {
+ Partitioning::Hash(keys, _m) => {
+ Partitioning::Hash(keys.clone(), cp.groups.len())
+ }
+ _ =>
Partitioning::UnknownPartitioning(cp.groups.len()),
+ };
+ ShuffleReaderExec::try_new_coalesced(
+ stage_id,
+ k_shape,
+ (*cp).clone(),
+ schema,
+ new_partitioning,
+ )?
+ }
+ None => ShuffleReaderExec::try_new(
+ stage_id,
+ partitions,
+ schema,
+ partitioning,
+ )?,
+ };
+
+ Ok(Transformed::yes(Arc::new(reader)))
+ } else if let Some(reader) =
plan.as_any().downcast_ref::<ShuffleReaderExec>() {
Review Comment:
I don't see this case in the rule, maybe we should remove this branch
##########
ballista/core/src/serde/scheduler/mod.rs:
##########
@@ -270,7 +270,10 @@ pub struct ExecutorDataChange {
pub struct PartitionStats {
pub(crate) num_rows: Option<u64>,
pub(crate) num_batches: Option<u64>,
- pub(crate) num_bytes: Option<u64>,
+ /// Per-partition byte size reported by the shuffle writer. Read by the
+ /// AQE coalesce rule (in `ballista-scheduler`) to bin-pack alignment
+ /// groups, so this field is `pub` rather than `pub(crate)`.
+ pub num_bytes: Option<u64>,
Review Comment:
Nit, there is public getter method, do we need this property public?
--
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]