hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brock Noland (JIRA)" <>
Subject [jira] [Created] (HIVE-4108) Allow over() clause to contain an order by with no partition by
Date Sat, 02 Mar 2013 15:47:12 GMT
Brock Noland created HIVE-4108:

             Summary: Allow over() clause to contain an order by with no partition by
                 Key: HIVE-4108
             Project: Hive
          Issue Type: Bug
          Components: PTF-Windowing
            Reporter: Brock Noland

HIVE-4073 allows over() to be called with no partition by and no order by. We should allow
only an order by.

>From the review of HIVE-4073:

Can you also add following test. This should also work.

select p_name, p_retailprice,
avg(p_retailprice) over(order by p_name)
from part
partition by p_name;

This test will not work (:
The grammar needs to be changed so:

@init { msgs.push("partitioningSpec clause"); }
@after { msgs.pop(); } 
partitionByClause orderByClause? -> ^(TOK_PARTITIONINGSPEC partitionByClause orderByClause?)
orderByClause -> ^(TOK_PARTITIONINGSPEC orderByClause) |
distributeByClause sortByClause? -> ^(TOK_PARTITIONINGSPEC distributeByClause sortByClause?)
sortByClause? -> ^(TOK_PARTITIONINGSPEC sortByClause) |
clusterByClause -> ^(TOK_PARTITIONINGSPEC clusterByClause)

And the SemanticAnalyzer::processPTFPartitionSpec has to handle this shape of the AST Tree.
The PTFTranslator also needs changes. Do this as another Jira

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message