Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ class VeloxTestSettings extends BackendTestSettings {
.excludeByPrefix("SPARK-44647")
.excludeByPrefix("SPARK-41471")
.excludeByPrefix("SPARK-53322")
.excludeByPrefix("SPARK-54439")
// disable due to check for SMJ node
.excludeByPrefix("SPARK-41413: partitioned join:")
.excludeByPrefix("SPARK-42038: partially clustered:")
.exclude("SPARK-44641: duplicated records when SPJ is not triggered")
// TODO: fix on Spark-4.1
.excludeByPrefix("SPARK-54439") // see https://github.com/apache/spark/pull/53142
enableSuite[GlutenLocalScanSuite]
enableSuite[GlutenMetadataColumnSuite]
enableSuite[GlutenSupportsCatalogOptionsSuite]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2034,4 +2034,55 @@ class GlutenKeyGroupedPartitioningSuite
}
}

testGluten("SPARK-54439: KeyGroupedPartitioning and join key size mismatch") {
val items_partitions = Array(identity("id"))
createTable(items, itemsColumns, items_partitions)

sql(s"INSERT INTO testcat.ns.$items VALUES " +
"(1, 'aa', 40.0, cast('2020-01-01' as timestamp)), " +
"(3, 'bb', 10.0, cast('2020-01-01' as timestamp)), " +
"(4, 'cc', 15.5, cast('2020-02-01' as timestamp))")

createTable(purchases, purchasesColumns, Array.empty)
sql(s"INSERT INTO testcat.ns.$purchases VALUES " +
"(1, 42.0, cast('2020-01-01' as timestamp)), " +
"(3, 19.5, cast('2020-02-01' as timestamp))")

withSQLConf(SQLConf.V2_BUCKETING_SHUFFLE_ENABLED.key -> "true") {
// `time` and `item_id` in the required `ClusteredDistribution` for `purchases`, but `item` is
// storage partitioned only by `id`
val df = createJoinTestDF(Seq("arrive_time" -> "time", "id" -> "item_id"))
val shuffles = collectShuffles(df.queryExecution.executedPlan)
assert(shuffles.size == 1, "only shuffle one side not report partitioning")

Comment on lines +2055 to +2057
checkAnswer(df, Seq(Row(1, "aa", 40.0, 42.0)))
}
}

testGluten("SPARK-54439: KeyGroupedPartitioning with transform and join key size mismatch") {
// Do not use `bucket()` in "one side partition" tests as its implementation in
// `InMemoryBaseTable` conflicts with `BucketFunction`
val items_partitions = Array(years("arrive_time"))
createTable(items, itemsColumns, items_partitions)

sql(s"INSERT INTO testcat.ns.$items VALUES " +
"(1, 'aa', 40.0, cast('2020-01-01' as timestamp)), " +
"(1, 'bb', 10.0, cast('2021-01-01' as timestamp)), " +
"(4, 'cc', 15.5, cast('2021-02-01' as timestamp))")

createTable(purchases, purchasesColumns, Array.empty)
sql(s"INSERT INTO testcat.ns.$purchases VALUES " +
"(1, 42.0, cast('2020-01-01' as timestamp)), " +
"(3, 19.5, cast('2021-02-01' as timestamp))")

withSQLConf(SQLConf.V2_BUCKETING_SHUFFLE_ENABLED.key -> "true") {
// `item_id` and `time` in the required `ClusteredDistribution` for `purchases`, but `item` is
// storage partitioned only by `year(arrive_time)`
val df = createJoinTestDF(Seq("id" -> "item_id", "arrive_time" -> "time"))
val shuffles = collectShuffles(df.queryExecution.executedPlan)
assert(shuffles.size == 1, "only shuffle one side not report partitioning")

Comment on lines +2082 to +2084
checkAnswer(df, Seq(Row(1, "aa", 40.0, 42.0)))
}
}
}
Loading