Repository: spark Updated Branches: refs/heads/master 61de65bc6 -> 502f90782
[SQL] Attribute equality comparisons should be done by exprId. Author: Michael Armbrust <[email protected]> Closes #1414 from marmbrus/exprIdResolution and squashes the following commits: 97b47bc [Michael Armbrust] Attribute equality comparisons should be done by exprId. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/502f9078 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/502f9078 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/502f9078 Branch: refs/heads/master Commit: 502f90782ad474e2630ed5be4d3c4be7dab09c34 Parents: 61de65b Author: Michael Armbrust <[email protected]> Authored: Tue Jul 15 17:56:17 2014 -0700 Committer: Michael Armbrust <[email protected]> Committed: Tue Jul 15 17:56:17 2014 -0700 ---------------------------------------------------------------------- .../apache/spark/sql/columnar/InMemoryColumnarTableScan.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/502f9078/sql/core/src/main/scala/org/apache/spark/sql/columnar/InMemoryColumnarTableScan.scala ---------------------------------------------------------------------- diff --git a/sql/core/src/main/scala/org/apache/spark/sql/columnar/InMemoryColumnarTableScan.scala b/sql/core/src/main/scala/org/apache/spark/sql/columnar/InMemoryColumnarTableScan.scala index ff7f664..88901de 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/columnar/InMemoryColumnarTableScan.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/columnar/InMemoryColumnarTableScan.scala @@ -96,7 +96,11 @@ private[sql] case class InMemoryColumnarTableScan( new Iterator[Row] { // Find the ordinals of the requested columns. If none are requested, use the first. val requestedColumns = - if (attributes.isEmpty) Seq(0) else attributes.map(relation.output.indexOf(_)) + if (attributes.isEmpty) { + Seq(0) + } else { + attributes.map(a => relation.output.indexWhere(_.exprId == a.exprId)) + } val columnAccessors = requestedColumns.map(columnBuffers(_)).map(ColumnAccessor(_)) val nextRow = new GenericMutableRow(columnAccessors.length)
