jackylee-ch commented on code in PR #13006:
URL: https://github.com/apache/gluten/pull/13006#discussion_r4003787359


##########
shims/common/src/main/scala/org/apache/gluten/sql/shims/SparkShims.scala:
##########
@@ -122,9 +122,20 @@ trait SparkShims {
       partitionValues: InternalRow,
       metadata: Map[String, Any] = Map.empty): Seq[PartitionedFile]
 
-  def structFromAttributes(attrs: Seq[Attribute]): StructType
+  def structFromAttributes(attrs: Seq[Attribute]): StructType =
+    StructType(attrs.map(a => StructField(a.name, a.dataType, a.nullable, 
a.metadata)))
 
-  def attributesFromStruct(structType: StructType): Seq[Attribute]
+  def attributesFromStruct(structType: StructType): Seq[Attribute] =
+    structType.fields.map {
+      field => AttributeReference(field.name, field.dataType, field.nullable, 
field.metadata)()
+    }
+
+  // https://issues.apache.org/jira/browse/SPARK-40400

Review Comment:
   Thanks for the clarification. Since `invalidBucketFile` is no longer 
version-specific, maybe we can move it out of `SparkShims` as well.
   
   How about putting it in `GlutenExceptionUtils` for now? It seems a better 
fit for shared exception construction logic.



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