Skip to content

Commit 8e66cdd

Browse files
Rename the EqualNSTo ==> EqualNullSafe
1 parent 7af4b0b commit 8e66cdd

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ trait HiveTypeCoercion {
236236
case e if !e.childrenResolved => e
237237
// No need to change EqualTo operators as that actually makes sense for boolean types.
238238
case e: EqualTo => e
239-
// No need to change the EqualNSTo operators
240-
case e: EqualNSTo => e
239+
// No need to change the EqualNullSafe operators, too
240+
case e: EqualNullSafe => e
241241
// Otherwise turn them to Byte types so that there exists and ordering.
242242
case p: BinaryComparison
243243
if p.left.dataType == BooleanType && p.right.dataType == BooleanType =>

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/dsl/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ package object dsl {
7777
def > (other: Expression) = GreaterThan(expr, other)
7878
def >= (other: Expression) = GreaterThanOrEqual(expr, other)
7979
def === (other: Expression) = EqualTo(expr, other)
80-
def <=> (other: Expression) = EqualNSTo(expr, other)
80+
def <=> (other: Expression) = EqualNullSafe(expr, other)
8181
def !== (other: Expression) = Not(EqualTo(expr, other))
8282

8383
def in(list: Expression*) = In(expr, list)

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ case class EqualTo(left: Expression, right: Expression) extends BinaryComparison
153153
}
154154
}
155155

156-
case class EqualNSTo(left: Expression, right: Expression) extends BinaryComparison {
156+
case class EqualNullSafe(left: Expression, right: Expression) extends BinaryComparison {
157157
def symbol = "<=>"
158158
override def nullable = false
159159
override def eval(input: Row): Any = {

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ object NullPropagation extends Rule[LogicalPlan] {
153153
case e @ GetItem(Literal(null, _), _) => Literal(null, e.dataType)
154154
case e @ GetItem(_, Literal(null, _)) => Literal(null, e.dataType)
155155
case e @ GetField(Literal(null, _), _) => Literal(null, e.dataType)
156-
case e @ EqualNSTo(Literal(null, _), r) => IsNull(r)
157-
case e @ EqualNSTo(l, Literal(null, _)) => IsNull(l)
156+
case e @ EqualNullSafe(Literal(null, _), r) => IsNull(r)
157+
case e @ EqualNullSafe(l, Literal(null, _)) => IsNull(l)
158158

159159
// For Coalesce, remove null literals.
160160
case e @ Coalesce(children) =>

sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ private[hive] object HiveQl {
931931
/* Comparisons */
932932
case Token("=", left :: right:: Nil) => EqualTo(nodeToExpr(left), nodeToExpr(right))
933933
case Token("==", left :: right:: Nil) => EqualTo(nodeToExpr(left), nodeToExpr(right))
934-
case Token("<=>", left :: right:: Nil) => EqualNSTo(nodeToExpr(left), nodeToExpr(right))
934+
case Token("<=>", left :: right:: Nil) => EqualNullSafe(nodeToExpr(left), nodeToExpr(right))
935935
case Token("!=", left :: right:: Nil) => Not(EqualTo(nodeToExpr(left), nodeToExpr(right)))
936936
case Token("<>", left :: right:: Nil) => Not(EqualTo(nodeToExpr(left), nodeToExpr(right)))
937937
case Token(">", left :: right:: Nil) => GreaterThan(nodeToExpr(left), nodeToExpr(right))

0 commit comments

Comments
 (0)