EqualTo Predicate Expression¶
EqualTo
is a BinaryComparison and NullIntolerant
predicate expression that represents the following high-level operators in a logical plan:
=
,==
,<>
,!=
SQL operatorsColumn.===
,Column.=!=
andColumn.notEqual
operators
Creating Instance¶
EqualTo
takes the following to be created:
- Left Expression
- Right Expression
EqualTo
is created when:
AstBuilder
is requested to parse a comparison (for=
,==
,<>
,!=
operators) and visitSimpleCaseColumn.===
,Column.=!=
andColumn.notEqual
operators are used- others
Symbol¶
symbol: String
symbol
is part of the BinaryOperator
abstraction.
symbol
is =
(equal sign).
Catalyst DSL¶
Catalyst DSL defines === operator to create an EqualTo
expression.
import org.apache.spark.sql.catalyst.dsl.expressions._
val right = 'right
val left = 'left
val e = right === left
scala> e.explain(extended = true)
('right = 'left)
scala> println(e.expr.sql)
(`right` = `left`)
import org.apache.spark.sql.catalyst.expressions.EqualTo
assert(e.expr.isInstanceOf[EqualTo])