gene-db commented on code in PR #49234:
URL: https://github.com/apache/spark/pull/49234#discussion_r1894318392


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -4644,6 +4644,22 @@ object SQLConf {
       .booleanConf
       .createWithDefault(false)
 
+  val VARIANT_WRITE_SHREDDING_ENABLED =
+    buildConf("spark.sql.variant.writeShredding.enabled")
+      .internal()
+      .doc("When true, the Parquet reader is allowed to write shredded 
variant. ")

Review Comment:
   Does this mean Delta is controlled some other way?



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaConverter.scala:
##########
@@ -772,6 +780,13 @@ private[sql] object ParquetSchemaConverter {
   val EMPTY_MESSAGE: MessageType =
     
Types.buildMessage().named(ParquetSchemaConverter.SPARK_PARQUET_SCHEMA_NAME)
 
+  // Used to annotate as metadata on the struct that replaces a VariantType 
when shredding.
+  val VARIANT_WRITE_SHREDDING_KEY: String = "__VARIANT_WRITE_SHREDDING_KEY"
+
+  def isVariantShreddingStruct(s: StructType): Boolean = {
+    s.fields.length > 0 && 
s.fields.forall(_.metadata.contains(VARIANT_WRITE_SHREDDING_KEY))

Review Comment:
   Every field contains the shredding key? What happens only some have it?



-- 
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]

Reply via email to