cloud-fan commented on code in PR #41757:
URL: https://github.com/apache/spark/pull/41757#discussion_r1244363695
##########
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:
Can we only have one `DecimalExpression` that extracts precision and scale?
If people only want to match decimal expression, they can do
```
case expr @ DecimalExpression(_, _) => ...
```
--
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]