Repository: spark
Updated Branches:
  refs/heads/master db3469046 -> 9d3a75ef8


[SPARK-5606][SQL] Support plus sign in HiveContext

Now spark version is only support ```SELECT -key FROM DECIMAL_UDF;``` in 
HiveContext.
This patch is used to support ```SELECT +key FROM DECIMAL_UDF;``` in 
HiveContext.

Author: q00251598 <[email protected]>

Closes #4378 from watermen/SPARK-5606 and squashes the following commits:

777f132 [q00251598] sql-case22
74dd368 [q00251598] sql-case22
1a67410 [q00251598] sql-case22
c5cd5bc [q00251598] sql-case22


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9d3a75ef
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9d3a75ef
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9d3a75ef

Branch: refs/heads/master
Commit: 9d3a75ef80d0b736d1366a464bf00b64a120f461
Parents: db34690
Author: q00251598 <[email protected]>
Authored: Wed Feb 4 23:16:01 2015 -0800
Committer: Michael Armbrust <[email protected]>
Committed: Wed Feb 4 23:16:01 2015 -0800

----------------------------------------------------------------------
 sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/9d3a75ef/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
----------------------------------------------------------------------
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 286d139..62e9d92 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
@@ -1103,6 +1103,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) => UnaryMinus(nodeToExpr(child))
     case Token("~", child :: Nil) => BitwiseNot(nodeToExpr(child))
     case Token("+", left :: right:: Nil) => Add(nodeToExpr(left), 
nodeToExpr(right))


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to