diff options
author | Daoyuan Wang <daoyuan.wang@intel.com> | 2015-02-12 15:22:07 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2015-02-12 15:22:07 -0800 |
commit | d5fc51491808630d0328a5937dbf349e00de361f (patch) | |
tree | dea6b073f6d5eeb0a21e50bdf0a46ea87ed50c70 | |
parent | ee04a8b19be8330bfc48f470ef365622162c915f (diff) | |
download | spark-d5fc51491808630d0328a5937dbf349e00de361f.tar.gz spark-d5fc51491808630d0328a5937dbf349e00de361f.tar.bz2 spark-d5fc51491808630d0328a5937dbf349e00de361f.zip |
[SPARK-5755] [SQL] remove unnecessary Add
explain extended select +key from src;
before:
== Parsed Logical Plan ==
'Project [(0 + 'key) AS _c0#8]
'UnresolvedRelation [src], None
== Analyzed Logical Plan ==
Project [(0 + key#10) AS _c0#8]
MetastoreRelation test, src, None
== Optimized Logical Plan ==
Project [(0 + key#10) AS _c0#8]
MetastoreRelation test, src, None
== Physical Plan ==
Project [(0 + key#10) AS _c0#8]
HiveTableScan [key#10], (MetastoreRelation test, src, None), None
after this patch:
== Parsed Logical Plan ==
'Project ['key]
'UnresolvedRelation [src], None
== Analyzed Logical Plan ==
Project [key#10]
MetastoreRelation test, src, None
== Optimized Logical Plan ==
Project [key#10]
MetastoreRelation test, src, None
== Physical Plan ==
HiveTableScan [key#10], (MetastoreRelation test, src, None), None
Author: Daoyuan Wang <daoyuan.wang@intel.com>
Closes #4551 from adrian-wang/positive and squashes the following commits:
0821ae4 [Daoyuan Wang] remove unnecessary Add
-rw-r--r-- | sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala index f3c9e63652..5269460e5b 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala @@ -1099,7 +1099,7 @@ https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C Cast(nodeToExpr(arg), DateType) /* Arithmetic */ - case Token("+", child :: Nil) => Add(Literal(0), nodeToExpr(child)) + case Token("+", child :: Nil) => nodeToExpr(child) case Token("-", child :: Nil) => UnaryMinus(nodeToExpr(child)) case Token("~", child :: Nil) => BitwiseNot(nodeToExpr(child)) case Token("+", left :: right:: Nil) => Add(nodeToExpr(left), nodeToExpr(right)) |