Skip to content

Commit

Permalink
some refine
Browse files Browse the repository at this point in the history
  • Loading branch information
shuai-xu committed May 27, 2024
1 parent 866d904 commit b2e3de8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ class GlutenClickhouseCountDistinctSuite extends GlutenClickHouseWholeStageTrans
}

test("GLUTEN-5852: Fix mismatch result columns size exception related to 5618") {
val sql = "select distinct * from (select count(distinct a, b, c) from values " +
"(0, null, 1), (1, 1, 1), (2, 2, 1), (1, 2, 1) ,(2, 2, 2) as data(a,b,c) group by c) a"
val sql = "select distinct * from (select count(distinct a, b, c), 2 as r1, 2 as r2 from " +
" values (0, null, 1), (1, 1, 1), (2, 2, 1), (1, 2, 1) ,(2, 2, 2) as data(a,b,c) group by c)"
compareResultsAgainstVanillaSpark(sql, true, { _ => })
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ trait PullOutProjectHelper {
replaceBoundReference: Boolean = false): Expression =
expr match {
case alias: Alias =>
projectExprsMap.getOrElseUpdate(alias.child.canonicalized, alias)
alias.toAttribute
alias.child match {
case _: Literal =>
alias.toAttribute
case _ =>
projectExprsMap.getOrElseUpdate(alias.child.canonicalized, alias).toAttribute
}
case attr: Attribute => attr
case e: BoundReference if !replaceBoundReference => e
case other =>
Expand Down

0 comments on commit b2e3de8

Please sign in to comment.