aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMichael Armbrust <michael@databricks.com>2014-07-15 17:56:17 -0700
committerMichael Armbrust <michael@databricks.com>2014-07-15 17:56:17 -0700
commit502f90782ad474e2630ed5be4d3c4be7dab09c34 (patch)
tree62839c780352b099d78805b8be6bf7c241a36680 /sql
parent61de65bc69f9a5fc396b76713193c6415436d452 (diff)
downloadspark-502f90782ad474e2630ed5be4d3c4be7dab09c34.tar.gz
spark-502f90782ad474e2630ed5be4d3c4be7dab09c34.tar.bz2
spark-502f90782ad474e2630ed5be4d3c4be7dab09c34.zip
[SQL] Attribute equality comparisons should be done by exprId.
Author: Michael Armbrust <michael@databricks.com> Closes #1414 from marmbrus/exprIdResolution and squashes the following commits: 97b47bc [Michael Armbrust] Attribute equality comparisons should be done by exprId.
Diffstat (limited to 'sql')
-rw-r--r--sql/core/src/main/scala/org/apache/spark/sql/columnar/InMemoryColumnarTableScan.scala6
1 files changed, 5 insertions, 1 deletions
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 ff7f664d8b..88901debbb 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)