Skip to content

Commit

Permalink
Fix bug of using un-projected expression in sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
szehon-ho committed Feb 27, 2024
1 parent 0754a23 commit 0016169
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ case class BatchScanExec(
KeyGroupedShuffleSpec.reducePartitionValue(row, partExpressions, reducers)
}.map { case (wrapper, splits) => (wrapper.row, splits.flatMap(_._2)) }.toSeq
val rowOrdering = RowOrdering.createNaturalAscendingOrdering(
expressions.map(_.dataType))
partExpressions.map(_.dataType))
result.sorted(rowOrdering.on((t: (InternalRow, _)) => t._1))
case _ => groupedPartitions
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class KeyGroupedPartitioningSuite extends DistributionAndOrderingSuiteBase {
.add("data", StringType)
.add("ts", TimestampType)
private val schema2 = new StructType()
.add("store_id", IntegerType)
.add("store_id", LongType)
.add("dept_id", IntegerType)
.add("data", StringType)

Expand Down Expand Up @@ -1482,7 +1482,7 @@ class KeyGroupedPartitioningSuite extends DistributionAndOrderingSuiteBase {
case (table1buckets, table2buckets) =>
catalog.clearTables()

val partition1 = Array(bucket(3, "store_id"),
val partition1 = Array(identity("data"),
bucket(table1buckets, "dept_id"))
val partition2 = Array(bucket(3, "store_id"),
bucket(table2buckets, "dept_id"))
Expand Down

0 comments on commit 0016169

Please sign in to comment.