diff options
author | Wenchen Fan <cloud0fan@outlook.com> | 2015-05-12 10:28:40 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-05-12 10:28:40 -0700 |
commit | 831504cf6bde6b1131005d5552e56a842725c84c (patch) | |
tree | f839c56f77dcad03f905302d84b4e3a233a94869 | |
parent | d86ce845840a92b4dde7975082738ed94ab8c570 (diff) | |
download | spark-831504cf6bde6b1131005d5552e56a842725c84c.tar.gz spark-831504cf6bde6b1131005d5552e56a842725c84c.tar.bz2 spark-831504cf6bde6b1131005d5552e56a842725c84c.zip |
[DataFrame][minor] cleanup unapply methods in DataTypes
Author: Wenchen Fan <cloud0fan@outlook.com>
Closes #6079 from cloud-fan/unapply and squashes the following commits:
40da442 [Wenchen Fan] one more
7d90a05 [Wenchen Fan] cleanup unapply in DataTypes
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala index 0992a7c311..a0b261649f 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataType.scala @@ -47,10 +47,7 @@ abstract class DataType { * ... * }}} */ - private[sql] def unapply(a: Expression): Boolean = a match { - case e: Expression if e.dataType == this => true - case _ => false - } + private[sql] def unapply(e: Expression): Boolean = e.dataType == this /** * The default size of a value of this data type, used internally for size estimation. @@ -137,10 +134,7 @@ private[sql] object IntegralType { * ... * }}} */ - def unapply(a: Expression): Boolean = a match { - case e: Expression if e.dataType.isInstanceOf[IntegralType] => true - case _ => false - } + def unapply(e: Expression): Boolean = e.dataType.isInstanceOf[IntegralType] } @@ -157,10 +151,7 @@ private[sql] object FractionalType { * ... * }}} */ - def unapply(a: Expression): Boolean = a match { - case e: Expression if e.dataType.isInstanceOf[FractionalType] => true - case _ => false - } + def unapply(e: Expression): Boolean = e.dataType.isInstanceOf[FractionalType] } |