You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/04/18 08:18:31 UTC

[GitHub] [hudi] xiarixiaoyao commented on a diff in pull request #5343: fallback to HadoopFsRelation

xiarixiaoyao commented on code in PR #5343:
URL: https://github.com/apache/hudi/pull/5343#discussion_r851966494


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/BaseFileOnlyRelation.scala:
##########
@@ -101,4 +102,17 @@ class BaseFileOnlyRelation(sqlContext: SQLContext,
 
     sparkAdapter.getFilePartitions(sparkSession, fileSplits, maxSplitBytes).map(HoodieBaseFileSplit.apply)
   }
+
+  def toHadoopFsRelation: HadoopFsRelation = {
+    HadoopFsRelation(
+      fileIndex,
+      fileIndex.partitionSchema,
+      fileIndex.dataSchema,
+      bucketSpec = None,
+      fileFormat = metaClient.getTableConfig.getBaseFileFormat match {
+        case HoodieFileFormat.PARQUET => new ParquetFileFormat
+        case HoodieFileFormat.ORC => new OrcFileFormat
+      },
+      optParams)(sparkSession)

Review Comment:
   maybe we need HoodieFileIndex or  HoodieROTablePathFilter to filter old parquet file.
   how about fallabck to the implement of 0.10.0     https://github.com/apache/hudi/blob/cc3896be2a023f8819883d745178503286ac2ab1/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/hudi/DefaultSource.scala#L182



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org