jinchengchenghh commented on code in PR #9529:
URL: https://github.com/apache/incubator-gluten/pull/9529#discussion_r2077566170
##########
gluten-iceberg/src/main/scala/org/apache/gluten/execution/IcebergScanTransformer.scala:
##########
@@ -107,6 +111,39 @@ case class IcebergScanTransformer(
}
}
+ val readSchema: StructType = scan.readSchema()
+ val readFieldNames = readSchema.fieldNames.toSet
+
+ val schemasMap: Map[Int, Schema] = table match {
Review Comment:
Can you try
```
val isSchemaReAdd = scan.readSchema().fieldNames.exists(n => table match {
case t: SparkTable => t.table() match {
case t: BaseTable =>
val oldSchemas = t.schemas()
oldSchemas.remove(t.schema().schemaId())
val currentId = t.schema().findField(n).fieldId()
oldSchemas.values().stream().anyMatch{v => {
val oldField = v.findField(n)
oldField != null && oldField.fieldId() != currentId
}
}
}
})
if (isSchemaReAdd) {
return ValidationResult.failed("Contains re-added schema")
}
```
--
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]