@@ -108,12 +108,23 @@ object DataSourceV2Strategy extends Strategy with PredicateHelper {
108
108
case PhysicalOperation (project, filters, relation : DataSourceV2Relation ) =>
109
109
val scanBuilder = relation.newScanBuilder()
110
110
111
+ <<<<<<< HEAD
111
112
val normalizedFilters = DataSourceStrategy .normalizeFilters(filters, relation.output)
113
+ ||||||| parent of 601fac2cb3... [SPARK - 27411 ][SQL ] DataSourceV2Strategy should not eliminate subquery
114
+ val normalizedFilters = DataSourceStrategy .normalizeFilters(
115
+ filters.filterNot(SubqueryExpression .hasSubquery), relation.output)
116
+ =======
117
+ val (withSubquery, withoutSubquery) = filters.partition(SubqueryExpression .hasSubquery)
118
+ val normalizedFilters = DataSourceStrategy .normalizeFilters(
119
+ withoutSubquery, relation.output)
120
+ >>>>>>> 601fac2cb3... [SPARK - 27411 ][SQL ] DataSourceV2Strategy should not eliminate subquery
112
121
113
122
// `pushedFilters` will be pushed down and evaluated in the underlying data sources.
114
123
// `postScanFilters` need to be evaluated after the scan.
115
124
// `postScanFilters` and `pushedFilters` can overlap, e.g. the parquet row group filter.
116
- val (pushedFilters, postScanFilters) = pushFilters(scanBuilder, normalizedFilters)
125
+ val (pushedFilters, postScanFiltersWithoutSubquery) =
126
+ pushFilters(scanBuilder, normalizedFilters)
127
+ val postScanFilters = postScanFiltersWithoutSubquery ++ withSubquery
117
128
val (scan, output) = pruneColumns(scanBuilder, relation, project ++ postScanFilters)
118
129
logInfo(
119
130
s """
0 commit comments