cloud-fan commented on code in PR #53790:
URL: https://github.com/apache/spark/pull/53790#discussion_r2688937779
##########
sql/api/src/main/scala/org/apache/spark/sql/types/CharType.scala:
##########
@@ -62,4 +62,10 @@ object CharType {
def apply(length: Int, collationId: Int): CharType =
new CharType(length, Some(collationId))
+
+ /**
+ * Extractor for pattern matching that extracts the length. This maintains
backward
+ * compatibility with code using `case CharType(length)`.
+ */
+ def unapply(charType: CharType): Option[Int] = Some(charType.length)
Review Comment:
This is anti-pattern, can we fix Delta code instead?
--
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]