[jira] [Commented] (HIVE-10636) CASE comparison operator rotation optimization

2015-05-18 Thread Julian Hyde (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-10636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14549594#comment-14549594
 ] 

Julian Hyde commented on HIVE-10636:


If you wrap every WHERE clause predicate (and other predicates such as HAVING) 
in "... IS TRUE" you don't need to pass context.

> 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
> Fix For: 1.2.0
>
> 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)


[jira] [Commented] (HIVE-10636) CASE comparison operator rotation optimization

2015-05-14 Thread Ashutosh Chauhan (JIRA)

[ 
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)


[jira] [Commented] (HIVE-10636) CASE comparison operator rotation optimization

2015-05-13 Thread Gopal V (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-10636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14543221#comment-14543221
 ] 

Gopal V commented on HIVE-10636:


[~ashutoshc]: +1 on the case rotation.

But it misses out on one of the CASE when folds, so HIVE-9644 wasn't 
comprehensive for the NULL and TRUE branch cases.

{code}
hive> explain select count(1) from store_sales where (case ss_sold_date_sk when 
2 then true else null end);
...
Vertices:
Map 1 
Map Operator Tree:
TableScan
  alias: store_sales
  filterExpr: CASE (ss_sold_date_sk) WHEN (2) THEN (true) ELSE 
(null) END (type: boolean)
{code}

the (true) / (null) WHEN is not getting folded, which is the last case (and the 
very first).

Would be nice to get that one is as well (as well as the no-else, which 
defaults to NULL).

{code}
hive> explain select count(1) from store_sales where (case ss_sold_date_sk when 
2 then true end);
OK
...
  Vertices:
Map 1 
Map Operator Tree:
TableScan
  alias: store_sales
  filterExpr: CASE (ss_sold_date_sk) WHEN (2) THEN (true) END 
(type: boolean)
{code}

Other than those two cases, everything seems to work fine.

> 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)


[jira] [Commented] (HIVE-10636) CASE comparison operator rotation optimization

2015-05-13 Thread Hive QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-10636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14542200#comment-14542200
 ] 

Hive QA commented on HIVE-10636:




{color:red}Overall{color}: -1 at least one tests failed

Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12732486/HIVE-10636.3.patch

{color:red}ERROR:{color} -1 due to 2 failed/errored test(s), 8921 tests executed
*Failed tests:*
{noformat}
TestCustomAuthentication - did not produce a TEST-*.xml file
org.apache.hadoop.hive.cli.TestEncryptedHDFSCliDriver.testCliDriver_encryption_insert_partition_static
{noformat}

Test results: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/3877/testReport
Console output: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/3877/console
Test logs: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-3877/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 2 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12732486 - PreCommit-HIVE-TRUNK-Build

> 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)


[jira] [Commented] (HIVE-10636) CASE comparison operator rotation optimization

2015-05-12 Thread Hive QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-10636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14539640#comment-14539640
 ] 

Hive QA commented on HIVE-10636:




{color:red}Overall{color}: -1 at least one tests failed

Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12732145/HIVE-10636.1.patch

{color:red}ERROR:{color} -1 due to 1 failed/errored test(s), 8922 tests executed
*Failed tests:*
{noformat}
org.apache.hadoop.hive.cli.TestEncryptedHDFSCliDriver.testCliDriver_encryption_insert_partition_static
{noformat}

Test results: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/3859/testReport
Console output: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/3859/console
Test logs: 
http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-3859/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 1 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12732145 - PreCommit-HIVE-TRUNK-Build

> 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.patch
>
>
> Step 1 as outlined in description of HIVE-9644



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)