You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "gengliangwang (via GitHub)" <gi...@apache.org> on 2023/04/14 03:41:49 UTC

[GitHub] [spark] gengliangwang commented on a diff in pull request #40776: [SPARK-43123][SQL] Internal field metadata should not be leaked to catalogs

gengliangwang commented on code in PR #40776:
URL: https://github.com/apache/spark/pull/40776#discussion_r1166247807


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/package.scala:
##########
@@ -225,4 +226,20 @@ package object util extends Logging {
       }
     }
   }
+
+  val AUTO_GENERATED_ALIAS = "__autoGeneratedAlias"
+
+  def removeInternalMetadata(schema: StructType): StructType = {
+    StructType(schema.map { field =>
+      val newMetadata = new MetadataBuilder().withMetadata(field.metadata)
+        .remove(METADATA_COL_ATTR_KEY)

Review Comment:
   Nit: shalll we define an array for all the internal metadata
   E.g.
   ```
   val internalMetaData = Seq(
     METADATA_COL_ATTR_KEY,
     QUALIFIED_ACCESS_ONLY,
     ...
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org