Repository: spark Updated Branches: refs/heads/branch-1.0 e0bc72eb7 -> 3143e51d7
[SPARK-2730][SQL] When retrieving a value from a Map, GetItem evaluates key twice JIRA: https://issues.apache.org/jira/browse/SPARK-2730 Author: Yin Huai <h...@cse.ohio-state.edu> Closes #1637 from yhuai/SPARK-2730 and squashes the following commits: 1a9f24e [Yin Huai] Remove unnecessary key evaluation. (cherry picked from commit e3643485de8fdaf5c52b266fead1b13214f29d5e) Signed-off-by: Michael Armbrust <mich...@databricks.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/3143e51d Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/3143e51d Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/3143e51d Branch: refs/heads/branch-1.0 Commit: 3143e51d7c45cb614095033244fae1fa66114e01 Parents: e0bc72e Author: Yin Huai <h...@cse.ohio-state.edu> Authored: Tue Jul 29 12:23:34 2014 -0700 Committer: Michael Armbrust <mich...@databricks.com> Committed: Tue Jul 29 12:23:49 2014 -0700 ---------------------------------------------------------------------- .../org/apache/spark/sql/catalyst/expressions/complexTypes.scala | 1 - 1 file changed, 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/3143e51d/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala ---------------------------------------------------------------------- diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala index 5d3bb25..0acb290 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala @@ -61,7 +61,6 @@ case class GetItem(child: Expression, ordinal: Expression) extends Expression { } } else { val baseValue = value.asInstanceOf[Map[Any, _]] - val key = ordinal.eval(input) baseValue.get(key).orNull } }