[ https://issues.apache.org/jira/browse/HIVE-10636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14543883#comment-14543883 ]
Ashutosh Chauhan commented on HIVE-10636: ----------------------------------------- [~gopalv] Thanks for review. You are spot on. I also thought about this one and actually have this implemented in earlier version of this patch ( HIVE-10636.1.patch). If you look at that patch for fold_when.q.out changes amounts to exactly this. Thinking more on this, I retracted this change in later versions of patch. Reason being this folding is safe only in context of Filter Operator. If such a case expression appears in select clause, this is invalid, because there false != null. Currently, shortcutFunction() doesn't know whether its a part of select or filter operator. So, to achieve above needs more changes with passing the context of operator to function. So, to stop further growth of patch, I removed those changes. If you think this is a common enough case that we should fold, let me know I can take a look at this in a follow-up jira. Committed current patch to master. > CASE comparison operator rotation optimization > ---------------------------------------------- > > Key: HIVE-10636 > URL: https://issues.apache.org/jira/browse/HIVE-10636 > Project: Hive > Issue Type: New Feature > Components: Logical Optimizer > Affects Versions: 0.14.0, 1.0.0, 1.2.0, 1.1.0 > Reporter: Ashutosh Chauhan > Assignee: Ashutosh Chauhan > Attachments: HIVE-10636.1.patch, HIVE-10636.2.patch, > HIVE-10636.3.patch, HIVE-10636.patch > > > Step 1 as outlined in description of HIVE-9644 -- This message was sent by Atlassian JIRA (v6.3.4#6332)