PHILO-HE commented on code in PR #7704:
URL: https://github.com/apache/incubator-gluten/pull/7704#discussion_r1824087071
##########
backends-velox/src/main/scala/org/apache/spark/sql/execution/ColumnarBuildSideRelation.scala:
##########
@@ -141,48 +141,7 @@ case class ColumnarBuildSideRelation(output:
Seq[Attribute], batches: Array[Arra
ColumnarBatches.getNativeHandle(batch),
0)
batch.close()
- val columnNames = key.flatMap {
- case expression: AttributeReference =>
- Some(expression)
- case _ =>
- None
- }
- if (columnNames.isEmpty) {
- throw new IllegalArgumentException(s"Key column not found in
expression: $key")
- }
- if (columnNames.size != 1) {
- throw new IllegalArgumentException(s"Multiple key columns found
in expression: $key")
- }
- val columnExpr = columnNames.head
- val oneColumnWithSameName = output.count(_.name ==
columnExpr.name) == 1
- val columnInOutput = output.zipWithIndex.filter {
- p: (Attribute, Int) =>
- if (oneColumnWithSameName) {
- // The comparison of exprId can be ignored when
- // only one attribute name match is found.
- p._1.name == columnExpr.name
- } else {
- // A case where output has multiple columns with same name
- p._1.name == columnExpr.name && p._1.exprId ==
columnExpr.exprId
Review Comment:
@yikf, sorry for the delayed response. I tested this patch on all TPCDS
queries with Spark CBO turned on. There is no functionality issue.
--
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]