Skip to content

Commit d5fc514

Browse files
adrian-wangmarmbrus
authored andcommitted
[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
1 parent ee04a8b commit d5fc514

File tree

1 file changed

+1
-1
lines changed
  • sql/hive/src/main/scala/org/apache/spark/sql/hive

1 file changed

+1
-1
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ https://cwiki.apache.org/confluence/display/Hive/Enhanced+Aggregation%2C+Cube%2C
10991099
Cast(nodeToExpr(arg), DateType)
11001100

11011101
/* Arithmetic */
1102-
case Token("+", child :: Nil) => Add(Literal(0), nodeToExpr(child))
1102+
case Token("+", child :: Nil) => nodeToExpr(child)
11031103
case Token("-", child :: Nil) => UnaryMinus(nodeToExpr(child))
11041104
case Token("~", child :: Nil) => BitwiseNot(nodeToExpr(child))
11051105
case Token("+", left :: right:: Nil) => Add(nodeToExpr(left), nodeToExpr(right))

0 commit comments

Comments
 (0)