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


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/HoodieFileGroupReaderBasedFileFormat.scala:
##########
@@ -314,21 +315,42 @@ class HoodieFileGroupReaderBasedFileFormat(tablePath: 
String,
               } else {
                 0
               }
-              val reader = HoodieFileGroupReader.builder()
-                .withReaderContext(readerContext)
-                .withHoodieTableMetaClient(metaClient)
-                .withLatestCommitTime(queryTimestamp)
-                .withBaseFileOption(fileSlice.getBaseFile)
-                .withLogFiles(fileSlice.getLogFiles)
-                .withPartitionPath(fileSlice.getPartitionPath)
-                .withDataSchema(dataSchema)
-                .withRequestedSchema(requestedSchema)
-                .withInternalSchemaOpt(internalSchemaOpt)
-                .withProps(props)
-                .withStart(file.start)
-                .withLength(baseFileLength)
-                .withShouldUseRecordPosition(shouldUseRecordPosition)
-                .build()
+              val reader: HoodieRecordReader[InternalRow] =

Review Comment:
   🤖 nit: the two branches of this if/else share ~10 identical `.withX()` 
builder calls and diverge only on reader type and 
`withShouldUseRecordPosition`. Could you extract the shared builder setup into 
a small helper (e.g. `baseReaderBuilder(readerContext, ...)`) so a future 
option added to one branch isn't silently missed in the other? Same pattern 
appears in `HoodieMergeOnReadRDDV2.scala`.
   
   <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