LuciferYang commented on code in PR #13006:
URL: https://github.com/apache/gluten/pull/13006#discussion_r4003041030
##########
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:
I tried this and it doesn't compile from here: `QueryExecutionErrors` is
`private[sql]`, so `object QueryExecutionErrors ... cannot be accessed ... from
class Spark34Shims in package spark34`. Only Gluten classes placed under
`org.apache.spark.sql.*`, like `AbstractFileSourceScanExec`, can reach it,
which is the actual reason for the local copy; SPARK-40400 fixing the error
framework doesn't change the visibility. I did dedup the four copies into one
`protected def` on the trait.
--
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]