Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-16 Thread Vikram Dixit Kumaraswamy

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

Review request for hive and Ashutosh Chauhan.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 2ece97e 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ca667d4 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/parititon_type_check.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-16 Thread Sergey Shelukhin

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



common/src/java/org/apache/hadoop/hive/conf/HiveConf.java


why false by default?



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


nit: the return seems pointless, it always returns the same map that caller 
already has



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


wouldn't it re-put the entire map into itself as it stands now



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


not really familiar with this flavor of trees; is val guaranteed to be the 
2nd argument? Can it be reverse.
Also nit above - checks for 0 children but not for 1.



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


nit: use entrySet?



ql/src/test/queries/clientnegative/illegal_partition_type.q


local path, also below in other q files


- Sergey Shelukhin


On Sept. 16, 2013, 9:05 p.m., Vikram Dixit Kumaraswamy wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14155/
> ---
> 
> (Updated Sept. 16, 2013, 9:05 p.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-5297
> https://issues.apache.org/jira/browse/HIVE-5297
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> Hive does not consider the type of the partition column while writing 
> partitions. Consider for example the query:
> 
> create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
> row format delimited fields terminated by ',';
> alter table tab1 add partition (month='June', day='second');
> 
> Hive accepts this query. However if you try to select from this table and 
> insert into another expecting schema match, it will insert nulls instead.
> 
> 
> Diffs
> -
> 
>   common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
>   ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 2ece97e 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java 
> a704462 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ca667d4 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 
> 767f545 
>   ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
>   ql/src/test/results/clientnegative/illegal_partition_type.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientnegative/illegal_partition_type2.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/parititon_type_check.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/14155/diff/
> 
> 
> Testing
> ---
> 
> Ran all tests.
> 
> 
> Thanks,
> 
> Vikram Dixit Kumaraswamy
> 
>



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-16 Thread Vikram Dixit Kumaraswamy

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

(Updated Sept. 17, 2013, 1:14 a.m.)


Review request for hive and Ashutosh Chauhan.


Changes
---

Addressed Sergey's comments.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 2ece97e 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java fb79823 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ca667d4 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/parititon_type_check.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-17 Thread Vikram Dixit Kumaraswamy

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

(Updated Sept. 17, 2013, 9:08 a.m.)


Review request for hive and Ashutosh Chauhan.


Changes
---

Updated test results.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 2ece97e 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java fb79823 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ca667d4 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
  ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/parititon_type_check.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-17 Thread Vikram Dixit Kumaraswamy

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

(Updated Sept. 17, 2013, 8:55 p.m.)


Review request for hive and Ashutosh Chauhan.


Changes
---

Fixed a minor nit.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 2ece97e 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java fb79823 
  ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ca667d4 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
  ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/parititon_type_check.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-17 Thread Vikram Dixit Kumaraswamy

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



common/src/java/org/apache/hadoop/hive/conf/HiveConf.java


Folks may be depending on this 'feature'. Debatable, open to others 
opinions.



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


Yes. 

Updated the check as well.



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


Cannot as I need to look up the key in different maps and the ordering 
cannot be guaranteed.


- Vikram Dixit Kumaraswamy


On Sept. 17, 2013, 9:08 a.m., Vikram Dixit Kumaraswamy wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14155/
> ---
> 
> (Updated Sept. 17, 2013, 9:08 a.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-5297
> https://issues.apache.org/jira/browse/HIVE-5297
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> Hive does not consider the type of the partition column while writing 
> partitions. Consider for example the query:
> 
> create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
> row format delimited fields terminated by ',';
> alter table tab1 add partition (month='June', day='second');
> 
> Hive accepts this query. However if you try to select from this table and 
> insert into another expecting schema match, it will insert nulls instead.
> 
> 
> Diffs
> -
> 
>   common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
>   ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 2ece97e 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java 
> a704462 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> fb79823 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ca667d4 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 
> 767f545 
>   ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
>   ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
>   ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
>   ql/src/test/results/clientnegative/illegal_partition_type.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientnegative/illegal_partition_type2.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/parititon_type_check.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/14155/diff/
> 
> 
> Testing
> ---
> 
> Ran all tests.
> 
> 
> Thanks,
> 
> Vikram Dixit Kumaraswamy
> 
>



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-18 Thread Harish Butani

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



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


This will add a dependency to antlr. 
Try not to introduce this dependency in the exec package.
I suggest you move the 2 new functions here to BaseSemanticAnalyzer



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


after you convert successfully.
Use the converted value.
See comment on date below.



ql/src/test/queries/clientpositive/partition_type_check.q


remove ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
The data file has default delimiters; your results show nulls for data 
columns.



ql/src/test/queries/clientpositive/partition_type_check.q


the value stored for day should be 'start of epoch'; but your output shows 
'second'. Storing the converted value hopefully fixes this.


- Harish Butani


On Sept. 17, 2013, 8:55 p.m., Vikram Dixit Kumaraswamy wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14155/
> ---
> 
> (Updated Sept. 17, 2013, 8:55 p.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-5297
> https://issues.apache.org/jira/browse/HIVE-5297
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> Hive does not consider the type of the partition column while writing 
> partitions. Consider for example the query:
> 
> create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
> row format delimited fields terminated by ',';
> alter table tab1 add partition (month='June', day='second');
> 
> Hive accepts this query. However if you try to select from this table and 
> insert into another expecting schema match, it will insert nulls instead.
> 
> 
> Diffs
> -
> 
>   common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
>   ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 2ece97e 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java 
> a704462 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> fb79823 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ca667d4 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 
> 767f545 
>   ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
>   ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
>   ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
>   ql/src/test/results/clientnegative/illegal_partition_type.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientnegative/illegal_partition_type2.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/parititon_type_check.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/14155/diff/
> 
> 
> Testing
> ---
> 
> Ran all tests.
> 
> 
> Thanks,
> 
> Vikram Dixit Kumaraswamy
> 
>



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-19 Thread Ashutosh Chauhan

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



ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java


I am not sure if we want to do this, ASTNode can only contain strings, so 
than we have to get string representation of the converted object which may not 
faithfully reproduce, eg float. converting 0.1f into float and than back to 
string may not give you back 0.1 which will be deviation from what user 
expected. So, continue to use original string seems like a right thing to do. 
What do you think? 


- Ashutosh Chauhan


On Sept. 17, 2013, 8:55 p.m., Vikram Dixit Kumaraswamy wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/14155/
> ---
> 
> (Updated Sept. 17, 2013, 8:55 p.m.)
> 
> 
> Review request for hive and Ashutosh Chauhan.
> 
> 
> Bugs: HIVE-5297
> https://issues.apache.org/jira/browse/HIVE-5297
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> Hive does not consider the type of the partition column while writing 
> partitions. Consider for example the query:
> 
> create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
> row format delimited fields terminated by ',';
> alter table tab1 add partition (month='June', day='second');
> 
> Hive accepts this query. However if you try to select from this table and 
> insert into another expecting schema match, it will insert nulls instead.
> 
> 
> Diffs
> -
> 
>   common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
>   ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java 2ece97e 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java 
> a704462 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 
> fb79823 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g ca667d4 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 
> 767f545 
>   ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
>   ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
>   ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
>   ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
>   ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
>   ql/src/test/results/clientnegative/illegal_partition_type.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientnegative/illegal_partition_type2.q.out 
> PRE-CREATION 
>   ql/src/test/results/clientpositive/parititon_type_check.q.out PRE-CREATION 
>   ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/14155/diff/
> 
> 
> Testing
> ---
> 
> Ran all tests.
> 
> 
> Thanks,
> 
> Vikram Dixit Kumaraswamy
> 
>



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-19 Thread Vikram Dixit Kumaraswamy

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

(Updated Sept. 20, 2013, 1:49 a.m.)


Review request for hive and Ashutosh Chauhan.


Changes
---

Addressed Harish and Ashutosh's comments. Took the approach of not updating 
with converted value because of Ashutosh's comments.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java fb79823 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
  ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-23 Thread Vikram Dixit Kumaraswamy

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

(Updated Sept. 23, 2013, 9:51 p.m.)


Review request for hive and Ashutosh Chauhan.


Changes
---

Refreshed against latest trunk and enabled check by default. Passes my tests.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 1af68a6 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java fb79823 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
  ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-23 Thread Vikram Dixit Kumaraswamy

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

(Updated Sept. 23, 2013, 9:57 p.m.)


Review request for hive and Ashutosh Chauhan.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java e971644 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 07b271c 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
  ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-25 Thread Vikram Dixit Kumaraswamy

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

(Updated Sept. 25, 2013, 8:22 p.m.)


Review request for hive and Ashutosh Chauhan.


Changes
---

Fix unit test failures when enabling type check by default.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 350c348 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 0c01749 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java 6c354d3 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/alter_partition_coltype.q 4d2e02f 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
  ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/alter_partition_coltype.q.out fe16fdd 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy



Re: Review Request 14155: HIVE-5297 Hive does not honor type for partition columns

2013-09-26 Thread Vikram Dixit Kumaraswamy

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

(Updated Sept. 26, 2013, 6:55 p.m.)


Review request for hive and Ashutosh Chauhan.


Changes
---

Fix failing test.


Bugs: HIVE-5297
https://issues.apache.org/jira/browse/HIVE-5297


Repository: hive-git


Description
---

Hive does not consider the type of the partition column while writing 
partitions. Consider for example the query:

create table tab1 (id1 int, id2 string) PARTITIONED BY(month string,day int) 
row format delimited fields terminated by ',';
alter table tab1 add partition (month='June', day='second');

Hive accepts this query. However if you try to select from this table and 
insert into another expecting schema match, it will insert nulls instead.


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 350c348 
  ql/src/java/org/apache/hadoop/hive/ql/ErrorMsg.java 393ef57 
  ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java a704462 
  ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 0c01749 
  ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 767f545 
  ql/src/test/queries/clientnegative/illegal_partition_type.q PRE-CREATION 
  ql/src/test/queries/clientnegative/illegal_partition_type2.q PRE-CREATION 
  ql/src/test/queries/clientpositive/alter_partition_coltype.q 4d2e02f 
  ql/src/test/queries/clientpositive/partition_type_check.q PRE-CREATION 
  ql/src/test/results/clientnegative/alter_table_add_partition.q.out bd9c148 
  ql/src/test/results/clientnegative/alter_view_failure5.q.out 4edb82c 
  ql/src/test/results/clientnegative/illegal_partition_type.q.out PRE-CREATION 
  ql/src/test/results/clientnegative/illegal_partition_type2.q.out PRE-CREATION 
  ql/src/test/results/clientpositive/alter_partition_coltype.q.out fe16fdd 
  ql/src/test/results/clientpositive/partition_type_check.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/14155/diff/


Testing
---

Ran all tests.


Thanks,

Vikram Dixit Kumaraswamy