> On Sept. 12, 2014, 6:58 p.m., Gunther Hagleitner wrote:
> > ql/src/test/queries/clientpositive/alter_partition_change_col.q, line 7
> > <https://reviews.apache.org/r/25320/diff/1/?file=676166#file676166line7>
> >
> >     it'd be good to test:
> >     
> >     - dynamic partition case (no value for one partition specs, multiple 
> > partition specs). does this work? If it does, what happens if there are 
> > some partitions that cannot be changed? (some partitions already have a 
> > column x others don't)
> >     - tables with multiple partitions
> >     - reordering columns
> >     - null/default partition
> >     - negative cases (name clash, column doesn't exist, etc)
> 
> Jason Dere wrote:
>     - Dynamic partition spec does not work for alter table statement, looks 
> like the syntax only supports specifying one partition at a time.
>     - I've updated alter_partition_change_col.q to have multiple partitions
>     - Reordering the columns in a partition does not look very effective 
> since it appears that the partition column names are ignored when reading 
> data from the table. The 1st column from the partition is treated as if it is 
> the 1st column of the table, and so on.
>     - Are null/default partitions possible? Tried to test this but I didn't 
> get it working
>     - Adding negative test cases
> 
> Gunther Hagleitner wrote:
>     - Reordering: Sounds like this is broken then? You're changing the first 
> column in the partition, if that's the 5th column in the table hive should 
> map, no? Is hive broken or is this patch not updating this?
>     - Are you saying you couldn't write an alter table statement that accepts 
> the default value?
> 
> Gunther Hagleitner wrote:
>     - what's the behavior of the dynamic partition pruning case? it just 
> fails on the parser level? did you turn on dynamic pruning?

* Reordering: I don't think this ever worked properly.  I can change the table 
definition rather than the partition and it still looks the same:
  1. create table with columns as (c1, c2)
  2. create partition 1
  3. alter table with columns as (c2, c1)
  4. create partition 2
  5. selecting from the table looks like it's just displaying the data in the 
order the columns were defined.
Looks like there would need to be some kind of column mapping that would need 
to take place to shuffle the older partition values to match the order of the 
current table definition.

* Ok was doing the default values wrong, looks like the test needed to be done 
with dynamic partitioning. It looks like this case works fine as long as the 
specified default partition value is set in the partition spec in the alter 
statement.

* When trying to use the dynamic partitioning syntax with alter table, just 
specifying the partition column with no value looks like it's getting 
interpreted as the partition column being null. But then you're not actually 
able to create partitions with null partition columns - they end up using the 
default partition value. So that's a bit of oddness that seems to be part of 
the existing partition spec behavior. Tried this while setting 
hive.exec.dynamic.partition=true, hive.exec.dynamic.partition.mode=nonstrict.


- Jason


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/25320/#review53197
-----------------------------------------------------------


On Sept. 15, 2014, 6:21 p.m., Jason Dere wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/25320/
> -----------------------------------------------------------
> 
> (Updated Sept. 15, 2014, 6:21 p.m.)
> 
> 
> Review request for hive and Gunther Hagleitner.
> 
> 
> Bugs: HIVE-7971
>     https://issues.apache.org/jira/browse/HIVE-7971
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Allow change/replace/add column to work on partitions
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 020943f 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> 05cde3e 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g 25cd3a5 
>   ql/src/java/org/apache/hadoop/hive/ql/plan/AlterTableDesc.java 8517319 
>   ql/src/test/queries/clientnegative/alter_partition_change_col_dup_col.q 
> PRE-CREATION 
>   ql/src/test/queries/clientnegative/alter_partition_change_col_nonexist.q 
> PRE-CREATION 
>   ql/src/test/queries/clientpositive/alter_partition_change_col.q 
> PRE-CREATION 
>   ql/src/test/results/clientnegative/alter_partition_change_col_dup_col.q.out 
> PRE-CREATION 
>   
> ql/src/test/results/clientnegative/alter_partition_change_col_nonexist.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/alter_partition_change_col.q.out 
> PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/25320/diff/
> 
> 
> Testing
> -------
> 
> New qfile test added
> 
> 
> Thanks,
> 
> Jason Dere
> 
>

Reply via email to