diff options
author | Yin Huai <huai@cse.ohio-state.edu> | 2014-07-29 12:23:34 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-07-29 12:23:34 -0700 |
commit | e3643485de8fdaf5c52b266fead1b13214f29d5e (patch) | |
tree | c7a83a967ea401e7e3025986a8608e48d018d31e | |
parent | 0c5c6a63d19bed2a813a09309c46971ecdd173f0 (diff) | |
download | spark-e3643485de8fdaf5c52b266fead1b13214f29d5e.tar.gz spark-e3643485de8fdaf5c52b266fead1b13214f29d5e.tar.bz2 spark-e3643485de8fdaf5c52b266fead1b13214f29d5e.zip |
[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 <huai@cse.ohio-state.edu>
Closes #1637 from yhuai/SPARK-2730 and squashes the following commits:
1a9f24e [Yin Huai] Remove unnecessary key evaluation.
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypes.scala | 1 |
1 files changed, 0 insertions, 1 deletions
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 5d3bb25ad5..0acb29012f 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 } } |