HIVE-4142 [jira] Remove inferring partition specification behavior
(Harish Butani via Ashutosh Chauhan)

Summary:
remove behavior that infers partitioning

Remove behavior that:

	implicitly sets the partition specification of a UDAF

this interferes with:

	the user wanting to apply a UDAF on the entire dataset
	is ambiguous once we support multiple partitions in 1 query.

Test Plan: updated tests

Reviewers: JIRA, ashutoshc

Reviewed By: ashutoshc

Differential Revision: https://reviews.facebook.net/D9285

git-svn-id: https://svn.apache.org/repos/asf/hive/branches/ptf-windowing@1455417 13f79535-47bb-0310-9956-ffa450edef68
HIVE-4108 [jira] Allow over() clause to contain an order by with no partition by
(Harish Butani via Ashutosh Chauhan)

Summary:
allow over clause with only an order spec

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:

Ashutosh

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;

Harish

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

partitioningSpec
@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

Test Plan: added new tests with over clause containing only order spec.

Reviewers: JIRA, ashutoshc

Reviewed By: ashutoshc

Differential Revision: https://reviews.facebook.net/D9309

git-svn-id: https://svn.apache.org/repos/asf/hive/branches/ptf-windowing@1455421 13f79535-47bb-0310-9956-ffa450edef68
Merge remote-tracking branch 'hive/ptf-windowing' into ptf