Skip to content

Commit

Permalink
[VL] Add a bad test case that final aggregate of collect_list is fall…
Browse files Browse the repository at this point in the history
…en back while partial aggregate is not (#5649)
  • Loading branch information
zhztheplayer authored May 8, 2024
1 parent e975bf3 commit e633887
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,40 @@ class FallbackSuite extends VeloxWholeStageTransformerSuite with AdaptiveSparkPl
}
}

// java.lang.NullPointerException
ignore("fallback final aggregate of collect_list") {
withSQLConf(
GlutenConfig.COLUMNAR_WHOLESTAGE_FALLBACK_THRESHOLD.key -> "1",
GlutenConfig.COLUMNAR_FALLBACK_IGNORE_ROW_TO_COLUMNAR.key -> "false",
GlutenConfig.EXPRESSION_BLACK_LIST.key -> "element_at"
) {
runQueryAndCompare(
"SELECT sum(ele) FROM (SELECT c1, element_at(collect_list(c2), 1) as ele FROM tmp1 " +
"GROUP BY c1)") {
df =>
val columnarToRow = collectColumnarToRow(df.queryExecution.executedPlan)
assert(columnarToRow == 1)
}
}
}

// java.lang.NullPointerException
ignore("fallback final aggregate of collect_set") {
withSQLConf(
GlutenConfig.COLUMNAR_WHOLESTAGE_FALLBACK_THRESHOLD.key -> "1",
GlutenConfig.COLUMNAR_FALLBACK_IGNORE_ROW_TO_COLUMNAR.key -> "false",
GlutenConfig.EXPRESSION_BLACK_LIST.key -> "element_at"
) {
runQueryAndCompare(
"SELECT sum(ele) FROM (SELECT c1, element_at(collect_set(c2), 1) as ele FROM tmp1 " +
"GROUP BY c1)") {
df =>
val columnarToRow = collectColumnarToRow(df.queryExecution.executedPlan)
assert(columnarToRow == 1)
}
}
}

test("fallback with AQE read") {
runQueryAndCompare(
"""
Expand Down

0 comments on commit e633887

Please sign in to comment.