Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix OrcFilterSuite
  • Loading branch information
sameeragarwal committed Mar 3, 2016
commit 0b1520c6ec38e2c505335e70e248abc27efccd6f
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class OrcFilterSuite extends QueryTest with OrcTest {
(predicate: Predicate, filterOperator: PredicateLeaf.Operator)
(implicit df: DataFrame): Unit = {
def checkComparisonOperator(filter: SearchArgument) = {
val operator = filter.getLeaves.asScala.head.getOperator
assert(operator === filterOperator)
val operator = filter.getLeaves.asScala
assert(operator.map(_.getOperator).contains(filterOperator))
}
checkFilterPredicate(df, predicate, checkComparisonOperator)
}
Expand Down Expand Up @@ -216,8 +216,9 @@ class OrcFilterSuite extends QueryTest with OrcTest {
)
checkFilterPredicate(
!('_1 < 4),
"""leaf-0 = (LESS_THAN _1 4)
|expr = (not leaf-0)""".stripMargin.trim
"""leaf-0 = (IS_NULL _1)
|leaf-1 = (LESS_THAN _1 4)
|expr = (and (not leaf-0) (not leaf-1))""".stripMargin.trim
)
checkFilterPredicate(
'_1 < 2 || '_1 > 3,
Expand All @@ -227,9 +228,10 @@ class OrcFilterSuite extends QueryTest with OrcTest {
)
checkFilterPredicate(
'_1 < 2 && '_1 > 3,
"""leaf-0 = (LESS_THAN _1 2)
|leaf-1 = (LESS_THAN_EQUALS _1 3)
|expr = (and leaf-0 (not leaf-1))""".stripMargin.trim
"""leaf-0 = (IS_NULL _1)
|leaf-1 = (LESS_THAN _1 2)
|leaf-2 = (LESS_THAN_EQUALS _1 3)
|expr = (and (not leaf-0) leaf-1 (not leaf-2))""".stripMargin.trim
)
}
}
Expand Down