linliu-code commented on code in PR #9819:
URL: https://github.com/apache/hudi/pull/9819#discussion_r1348152653


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/NewHoodieParquetFileFormat.scala:
##########
@@ -155,9 +160,22 @@ class NewHoodieParquetFileFormat(tableState: 
Broadcast[HoodieTableState],
                   }
                 } else {
                   if (logFiles.nonEmpty) {
-                    val baseFile = createPartitionedFile(InternalRow.empty, 
hoodieBaseFile.getHadoopPath, 0, hoodieBaseFile.getFileLen)
-                    buildMergeOnReadIterator(preMergeBaseFileReader(baseFile), 
logFiles, filePath.getParent, requiredSchemaWithMandatory,
-                      requiredSchemaWithMandatory, outputSchema, 
partitionSchema, partitionValues, broadcastedHadoopConf.value.value)
+                    val hoodieReaderContext = new 
SparkFileFormatInternalRowReaderContext(
+                      sparkSession, this, broadcastedHadoopConf.value.value)
+                    val logFilesAsJava = logFiles.toStream.map(lf => 
lf.toString).toList.asJava
+                    val reader = new HoodieFileGroupReader[InternalRow](
+                      
hoodieReaderContext.asInstanceOf[HoodieReaderContext[InternalRow]],
+                      broadcastedHadoopConf.value.value,
+                      tableState.value.tablePath,
+                      FSUtils.getCommitTime(logFilesAsJava.get(0)),

Review Comment:
   Have changed the logic. Please check.



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