You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/09/17 07:42:45 UTC

[GitHub] [spark] viirya commented on a change in pull request #34001: [SPARK-36760][SQL] Add internal utils to convert between v1 and v2 filters

viirya commented on a change in pull request #34001:
URL: https://github.com/apache/spark/pull/34001#discussion_r710827740



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/csv/CSVScanBuilder.scala
##########
@@ -42,16 +42,18 @@ case class CSVScanBuilder(
       readDataSchema(),
       readPartitionSchema(),
       options,
-      pushedDataFilters,
+      pushedDataFilters.map(DataSourceUtils.convertV2FilterToV1),
       partitionFilters,
       dataFilters)
   }
 
-  override def pushDataFilters(dataFilters: Array[Filter]): Array[Filter] = {
+  override def pushDataFilters(dataFilters: Array[V2Filter]): Array[V2Filter] = {
     if (sparkSession.sessionState.conf.csvFilterPushDown) {
-      StructFilters.pushedFilters(dataFilters, dataSchema)
+      val pushedFilterInV1Format = StructFilters.pushedFilters(
+        dataFilters.map(DataSourceUtils.convertV2FilterToV1), dataSchema)
+      convertPushFilterFromV1ToV2(pushedFilterInV1Format, dataFilters)

Review comment:
       Why do we need to convert v2 filter to v1, then convert it back to v2?




-- 
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: reviews-unsubscribe@spark.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org