cloud-fan commented on a change in pull request #31666:
URL: https://github.com/apache/spark/pull/31666#discussion_r587667381
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala
##########
@@ -193,4 +193,29 @@ package object util extends Logging {
def truncatedString[T](seq: Seq[T], sep: String, maxFields: Int): String = {
truncatedString(seq, "", sep, "", maxFields)
}
+
+ val METADATA_COL_ATTR_KEY = "__metadata_col"
+ implicit class MetadataColumnHelper(attr: Attribute) {
+ def isMetadataCol: Boolean = attr.metadata.contains(METADATA_COL_ATTR_KEY)
&&
+ attr.metadata.getBoolean(METADATA_COL_ATTR_KEY)
+ }
+
+ /**
+ * Hidden columns are a type of metadata column that are not propagated
through subquery aliases,
+ * and are candidates during qualified star expansions.
+ */
+ val HIDDEN_COL_ATTR_KEY = "__hidden_col"
+ implicit class HiddenColumnHelper(attr: Attribute) {
Review comment:
how about using only one implicit class?
```
implicit class SpecialColumnHelper(attr: Attribute) {
def isMetadataCol: Boolean = attr.metadata.contains(METADATA_COL_ATTR_KEY)
&&
attr.metadata.getBoolean(METADATA_COL_ATTR_KEY)
def isHiddenCol: Boolean = ...
}
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]