Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/9659#discussion_r44648278
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
---
@@ -54,13 +55,21 @@ class ParquetFilterSuite extends QueryTest with
ParquetTest with SharedSQLContex
.select(output.map(e => Column(e)): _*)
.where(Column(predicate))
+ var maybeRelation: Option[BaseRelation] = None
val maybeAnalyzedPredicate =
query.queryExecution.optimizedPlan.collect {
- case PhysicalOperation(_, filters, LogicalRelation(_:
ParquetRelation, _)) => filters
+ case PhysicalOperation(_, filters,
LogicalRelation(parquetRelation: ParquetRelation, _)) =>
+ maybeRelation = Some(parquetRelation)
+ filters
}.flatten.reduceLeftOption(_ && _)
- assert(maybeAnalyzedPredicate.isDefined)
- val selectedFilters =
maybeAnalyzedPredicate.flatMap(DataSourceStrategy.translateFilter)
- assert(selectedFilters.nonEmpty)
+ assert(maybeRelation.exists(_.isInstanceOf[ParquetRelation]),
"Datasource is not Parquet")
--- End diff --
This assertion is redundant since we've already specified `ParquetRelation`
in the pattern match.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]