Skip to content
Snippets Groups Projects
Commit 831504cf authored by Wenchen Fan's avatar Wenchen Fan Committed by Reynold Xin
Browse files

[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
parent d86ce845
No related branches found
No related tags found
No related merge requests found
......@@ -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]
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment