Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/2561#discussion_r18317752
--- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala ---
@@ -977,7 +978,16 @@ private[hive] object HiveQl {
case Token("TOK_FUNCTION", Token("TOK_ISNULL", Nil) :: child :: Nil) =>
IsNull(nodeToExpr(child))
case Token("TOK_FUNCTION", Token(IN(), Nil) :: value :: list) =>
- In(nodeToExpr(value), list.map(nodeToExpr))
+ val valExpr = nodeToExpr(value)
--- End diff --
Instead of hardwiring this into the parser, lets create a rule in
`Optimizer.scala` that recognizes this pattern. That will allow this
optimization to be more general. For example it could then easily apply to
queries like `... WHERE x IN (1 + 1, 1 + 2, ...)` since it'll happen along with
`ConstantFolding`.
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]