yikf commented on code in PR #7704:
URL: https://github.com/apache/incubator-gluten/pull/7704#discussion_r1820031533
##########
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:
I suspect this has something to do with the previous implementation of bound
references, it proactively imposes certain conditions. The purpose of the
transform is to retrieve the values computed by expr from the relation, I think
we can directly simply use the clear way to retrieve them.
I ran q72 in my test environment and it works normally. Can you help double
check if you find a time?
--
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]