ammarchalifah commented on code in PR #59599:
URL: https://github.com/apache/spark/pull/59599#discussion_r4377528632
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/KeyGroupedPartitionedScan.scala:
##########
@@ -18,13 +18,51 @@
package org.apache.spark.sql.execution
import org.apache.spark.sql.catalyst.InternalRow
-import org.apache.spark.sql.catalyst.expressions.RowOrdering
+import org.apache.spark.sql.catalyst.expressions.{Expression, RowOrdering}
import org.apache.spark.sql.catalyst.plans.physical.{KeyGroupedPartitioning,
KeyGroupedShuffleSpec}
import org.apache.spark.sql.catalyst.util.InternalRowComparableWrapper
import org.apache.spark.sql.execution.joins.StoragePartitionJoinParams
/** Base trait for a data source scan capable of producing a key-grouped
output. */
trait KeyGroupedPartitionedScan[T] {
+ /**
+ * Return join-key positions for `outputPartitioning`.
[[getInputPartitionGrouping]] always
+ * uses `spjParams.joinKeyPositions`. Skip output projection for a
leading-prefix subset of
+ * partition keys when common-partition metadata remains at full width;
projecting output
+ * misaligns nested siblings in a
+ * [[org.apache.spark.sql.catalyst.plans.physical.PartitioningCollection]].
+ */
+ private def joinKeyPositionsForOutput(
+ spjParams: StoragePartitionJoinParams,
+ baseExpressions: Seq[Expression]): Option[Seq[Int]] = {
+ spjParams.joinKeyPositions match {
+ case Some(pos) if pos.length < baseExpressions.length &&
Review Comment:
Addressed
--
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]