Skip to content

Commit

Permalink
fix return bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AngersZhuuuu committed Jun 12, 2020
1 parent 69f1763 commit 2f576fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ object PushCNFPredicateThroughFileScan extends Rule[LogicalPlan] with PredicateH
def apply(plan: LogicalPlan): LogicalPlan = {
var resolved = false
plan resolveOperatorsDown {
case ScanOperation(projectList, conditions, relation: LogicalRelation)
case op @ ScanOperation(projectList, conditions, relation: LogicalRelation)
if conditions.nonEmpty && !resolved =>
resolved = true
val predicates = conjunctiveNormalFormAndGroupExpsByReference(conditions.reduceLeft(And))
if (predicates.isEmpty) {
plan
op
} else {
Project(projectList, Filter(predicates.reduceLeft(And), relation))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ object PushCNFPredicateThroughHiveTableScan extends Rule[LogicalPlan] with Predi
def apply(plan: LogicalPlan): LogicalPlan = {
var resolved = false
plan resolveOperatorsDown {
case ScanOperation(projectList, conditions, relation: HiveTableRelation)
case op @ ScanOperation(projectList, conditions, relation: HiveTableRelation)
if conditions.nonEmpty && !resolved =>
resolved = true
val predicates = conjunctiveNormalFormAndGroupExpsByReference(conditions.reduceLeft(And))
if (predicates.isEmpty) {
plan
op
} else {
Project(projectList, Filter(predicates.reduceLeft(And), relation))
}
Expand Down

0 comments on commit 2f576fa

Please sign in to comment.