Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ case class And(left: Expression, right: Expression) extends BinaryOperator with

override def sqlOperator: String = "AND"

final override val nodePatterns: Seq[TreePattern] = Seq(AND_OR)
final override val nodePatterns: Seq[TreePattern] = Seq(AND)

// +---------+---------+---------+---------+
// | AND | TRUE | FALSE | UNKNOWN |
Expand Down Expand Up @@ -841,7 +841,7 @@ case class Or(left: Expression, right: Expression) extends BinaryOperator with P

override def sqlOperator: String = "OR"

final override val nodePatterns: Seq[TreePattern] = Seq(AND_OR)
final override val nodePatterns: Seq[TreePattern] = Seq(OR)

// +---------+---------+---------+---------+
// | OR | TRUE | FALSE | UNKNOWN |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ object OptimizeIn extends Rule[LogicalPlan] {
*/
object BooleanSimplification extends Rule[LogicalPlan] with PredicateHelper {
def apply(plan: LogicalPlan): LogicalPlan = plan.transformWithPruning(
_.containsAnyPattern(AND_OR, NOT), ruleId) {
_.containsAnyPattern(AND, OR, NOT), ruleId) {
case q: LogicalPlan => q.transformExpressionsUpWithPruning(
_.containsAnyPattern(AND_OR, NOT), ruleId) {
_.containsAnyPattern(AND, OR, NOT), ruleId) {
case TrueLiteral And e => e
case e And TrueLiteral => e
case FalseLiteral Or e => e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ object TreePattern extends Enumeration {
// Expression patterns (alphabetically ordered)
val AGGREGATE_EXPRESSION = Value(0)
val ALIAS: Value = Value
val AND_OR: Value = Value
val AND: Value = Value
val ARRAYS_ZIP: Value = Value
val ATTRIBUTE_REFERENCE: Value = Value
val APPEND_COLUMNS: Value = Value
Expand Down Expand Up @@ -70,6 +70,7 @@ object TreePattern extends Enumeration {
val NULL_CHECK: Value = Value
val NULL_LITERAL: Value = Value
val SERIALIZE_FROM_OBJECT: Value = Value
val OR: Value = Value
val OUTER_REFERENCE: Value = Value
val PIVOT: Value = Value
val PLAN_EXPRESSION: Value = Value
Expand Down