diff options
author | Takuya UESHIN <ueshin@happy-camper.st> | 2014-10-20 15:51:05 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-10-20 15:51:05 -0700 |
commit | 364d52b707b5c49bc29ce60dbfe6e845a75d5d86 (patch) | |
tree | 884c4d726773a27726e99e5a499cf14b9e85c751 /sql/catalyst | |
parent | e9c1afa87b8a6d9ea02aa9f7c319a36f00c0e4c3 (diff) | |
download | spark-364d52b707b5c49bc29ce60dbfe6e845a75d5d86.tar.gz spark-364d52b707b5c49bc29ce60dbfe6e845a75d5d86.tar.bz2 spark-364d52b707b5c49bc29ce60dbfe6e845a75d5d86.zip |
[SPARK-3966][SQL] Fix nullabilities of Cast related to DateType.
Author: Takuya UESHIN <ueshin@happy-camper.st>
Closes #2820 from ueshin/issues/SPARK-3966 and squashes the following commits:
ca4a745 [Takuya UESHIN] Fix nullabilities of Cast related to DateType.
Diffstat (limited to 'sql/catalyst')
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala | 4 |
1 files changed, 4 insertions, 0 deletions
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 8e5ee12e31..8e5baf0eb8 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 } |