harshmotw-db commented on code in PR #53120:
URL: https://github.com/apache/spark/pull/53120#discussion_r2548281226


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaConverter.scala:
##########
@@ -373,9 +381,20 @@ class ParquetToSparkSchemaConverter(
 
     Option(field.getLogicalTypeAnnotation).fold(
       convertInternal(groupColumn, 
sparkReadType.map(_.asInstanceOf[StructType]))) {
-      // Temporary workaround to read Shredded variant data
-      case v: VariantLogicalTypeAnnotation if v.getSpecVersion == 1 && 
sparkReadType.isEmpty =>
-        convertInternal(groupColumn, None)
+      case v: VariantLogicalTypeAnnotation if v.getSpecVersion == 1 =>
+        if (ignoreVariantAnnotation) {
+          convertInternal(groupColumn)

Review Comment:
   [I have added a new 
test](https://github.com/apache/spark/pull/53120#discussion_r2548267850)



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaConverter.scala:
##########
@@ -373,9 +381,20 @@ class ParquetToSparkSchemaConverter(
 
     Option(field.getLogicalTypeAnnotation).fold(
       convertInternal(groupColumn, 
sparkReadType.map(_.asInstanceOf[StructType]))) {
-      // Temporary workaround to read Shredded variant data
-      case v: VariantLogicalTypeAnnotation if v.getSpecVersion == 1 && 
sparkReadType.isEmpty =>
-        convertInternal(groupColumn, None)
+      case v: VariantLogicalTypeAnnotation if v.getSpecVersion == 1 =>
+        if (ignoreVariantAnnotation) {
+          convertInternal(groupColumn)

Review Comment:
   https://github.com/apache/spark/pull/53120#discussion_r2548267850



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