amaliujia commented on code in PR #41757:
URL: https://github.com/apache/spark/pull/41757#discussion_r1243863637
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/types/DataTypeExpression.scala:
##########
@@ -65,3 +65,14 @@ object IntegralTypeExpression {
e.dataType.isInstanceOf[IntegralType]
}
}
+
+object DecimalExtractor {
+ def unapply(e: Expression): Option[(Int, Int)] = e.dataType match {
+ case t: DecimalType => Some((t.precision, t.scale))
+ case _ => None
+ }
+}
+
+object DecimalExpression {
+ def unapply(e: Expression): Boolean = e.dataType.isInstanceOf[DecimalType]
Review Comment:
We can keep this for the completeness of all data type unapply.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]