Repository: spark
Updated Branches:
  refs/heads/master e9c1afa87 -> 364d52b70


[SPARK-3966][SQL] Fix nullabilities of Cast related to DateType.

Author: Takuya UESHIN <[email protected]>

Closes #2820 from ueshin/issues/SPARK-3966 and squashes the following commits:

ca4a745 [Takuya UESHIN] Fix nullabilities of Cast related to DateType.


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

Branch: refs/heads/master
Commit: 364d52b707b5c49bc29ce60dbfe6e845a75d5d86
Parents: e9c1afa
Author: Takuya UESHIN <[email protected]>
Authored: Mon Oct 20 15:51:05 2014 -0700
Committer: Michael Armbrust <[email protected]>
Committed: Mon Oct 20 15:51:05 2014 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/sql/catalyst/expressions/Cast.scala   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/364d52b7/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
----------------------------------------------------------------------
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
index 8e5ee12..8e5baf0 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
@@ -32,6 +32,10 @@ case class Cast(child: Expression, dataType: DataType) 
extends UnaryExpression w
     case (StringType, _: NumericType) => true
     case (StringType, TimestampType)  => true
     case (StringType, DateType)       => true
+    case (_: NumericType, DateType)   => true
+    case (BooleanType, DateType)      => true
+    case (DateType, _: NumericType)   => true
+    case (DateType, BooleanType)      => true
     case _                            => child.nullable
   }
 


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

Reply via email to