Skip to content

Commit 84a2128

Browse files
committed
remove unapply
1 parent 6a37c12 commit 84a2128

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@ object ExtractValue {
7878
}
7979
}
8080

81-
def unapply(g: Expression): Option[(Expression, Expression)] = g match {
82-
case o: GetArrayItem => Some((o.child, o.ordinal))
83-
case o: GetMapValue => Some((o.child, o.key))
84-
case o: GetStructField => Some((o.child, null))
85-
case o: GetArrayStructFields => Some((o.child, null))
86-
case _ => None
87-
}
88-
8981
/**
9082
* Find the ordinal of StructField, report error if no desired field or over one
9183
* desired fields are found.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,12 @@ object NullPropagation extends Rule[LogicalPlan] {
275275
case e @ Count(Literal(null, _)) => Cast(Literal(0L), e.dataType)
276276
case e @ IsNull(c) if !c.nullable => Literal.create(false, BooleanType)
277277
case e @ IsNotNull(c) if !c.nullable => Literal.create(true, BooleanType)
278-
case e @ ExtractValue(Literal(null, _), _) => Literal.create(null, e.dataType)
279-
case e @ ExtractValue(_, Literal(null, _)) => Literal.create(null, e.dataType)
278+
case e @ GetArrayItem(Literal(null, _), _) => Literal.create(null, e.dataType)
279+
case e @ GetArrayItem(_, Literal(null, _)) => Literal.create(null, e.dataType)
280+
case e @ GetMapValue(Literal(null, _), _) => Literal.create(null, e.dataType)
281+
case e @ GetMapValue(_, Literal(null, _)) => Literal.create(null, e.dataType)
282+
case e @ GetStructField(Literal(null, _), _, _) => Literal.create(null, e.dataType)
283+
case e @ GetArrayStructFields(Literal(null, _), _, _, _) => Literal.create(null, e.dataType)
280284
case e @ EqualNullSafe(Literal(null, _), r) => IsNull(r)
281285
case e @ EqualNullSafe(l, Literal(null, _)) => IsNull(l)
282286
case e @ Count(expr) if !expr.nullable => Count(Literal(1))

0 commit comments

Comments
 (0)