yihua commented on code in PR #13503:
URL: https://github.com/apache/hudi/pull/13503#discussion_r2233034620


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/FileFormatUtilsForFileGroupReader.scala:
##########
@@ -124,4 +124,11 @@ object FileFormatUtilsForFileGroupReader extends 
SparkAdapterSupport {
       plan
     }
   }
+
+  def createStreamingDataFrame(sqlContext: SQLContext, relation: 
HadoopFsRelation, requiredSchema: StructType): DataFrame = {
+    val logRel = LogicalRelation(relation, isStreaming = true)

Review Comment:
   nit: use English words to avoid abbreviation and confusion
   ```suggestion
       val logicalRelation = LogicalRelation(relation, isStreaming = true)
   ```



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/FileFormatUtilsForFileGroupReader.scala:
##########
@@ -124,4 +124,11 @@ object FileFormatUtilsForFileGroupReader extends 
SparkAdapterSupport {
       plan
     }
   }
+
+  def createStreamingDataFrame(sqlContext: SQLContext, relation: 
HadoopFsRelation, requiredSchema: StructType): DataFrame = {
+    val logRel = LogicalRelation(relation, isStreaming = true)
+    val resolvedSchema = logRel.resolve(requiredSchema, 
sqlContext.sparkSession.sessionState.analyzer.resolver)
+    Dataset.ofRows(sqlContext.sparkSession, applyFiltersToPlan(logRel, 
requiredSchema, resolvedSchema,
+      relation.fileFormat.asInstanceOf[HoodieFormatTrait].getRequiredFilters))

Review Comment:
   Could the filters be passed when constructing `relation: HadoopFsRelation` 
instead of the post-processing here?



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/FileFormatUtilsForFileGroupReader.scala:
##########
@@ -124,4 +124,11 @@ object FileFormatUtilsForFileGroupReader extends 
SparkAdapterSupport {
       plan
     }
   }
+
+  def createStreamingDataFrame(sqlContext: SQLContext, relation: 
HadoopFsRelation, requiredSchema: StructType): DataFrame = {
+    val logRel = LogicalRelation(relation, isStreaming = true)
+    val resolvedSchema = logRel.resolve(requiredSchema, 
sqlContext.sparkSession.sessionState.analyzer.resolver)
+    Dataset.ofRows(sqlContext.sparkSession, applyFiltersToPlan(logRel, 
requiredSchema, resolvedSchema,

Review Comment:
   As a separate follow-up, could you check if the 
`DataSourceReadOptions.PUSH_DOWN_INCR_FILTERS` is applied in the new stream 
source read path?  I found that the 
`HoodieCopyOnWriteIncrementalHadoopFsRelationFactory` does not seem take 
filters from the this config.



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