hudi-agent commented on code in PR #20033:
URL: https://github.com/apache/hudi/pull/20033#discussion_r4081266474


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/HoodieFileGroupReaderBasedFileFormat.scala:
##########
@@ -291,6 +291,9 @@ class HoodieFileGroupReaderBasedFileFormat(tablePath: 
String,
                                               filters: Seq[Filter],
                                               options: Map[String, String],
                                               hadoopConf: Configuration): 
PartitionedFile => Iterator[InternalRow] = {
+    // Driver side, once per scan: Spark 4.0 cannot read a PushVariantIntoScan 
projection struct and
+    // has to fail here rather than in the schema-change path (#20032).
+    sparkAdapter.validateVariantProjectionReadable(requiredSchema)

Review Comment:
   🤖 Moving `isVariantProjectionStruct` into `BaseSpark4Adapter` also flips it 
to `true` on 4.0 for the other consumers (`isDataTypeEqualForPhysicalSchema`, 
`SparkSchemaTransformUtils.addMissingFields`, `overlayVariantProjections`), 
which now report "compatible" instead of a schema change there. That looks safe 
because every `HadoopFsRelation` read goes through this one hook — could you 
confirm no 4.0 entry point reaches those consumers without passing through 
`buildReaderWithPartitionValues` first, so the fallthrough is an error rather 
than silently-wrong rows?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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

Reply via email to