Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/1428#discussion_r14980864
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala
---
@@ -171,6 +171,9 @@ object NullPropagation extends Rule[LogicalPlan] {
case Literal(candidate, _) if candidate == v => true
case _ => false
})) => Literal(true, BooleanType)
+ case e @ Substring(Literal(null, _), _, _) => Literal(null,
e.dataType)
--- End diff --
Now I think about it more, this is probably ok to leave it here since in
constant folding we don't really special case for null literals. However, I
looked into other rules in NullPropagation and a lot of them don't really
belong there... (has nothing to do with your PR though)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---