[ https://issues.apache.org/jira/browse/HIVE-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
caofangkun updated HIVE-4032: ----------------------------- Description: Inserting data into Hive table from a query , when the query is : select * from a_partitioned_table, will throw a SemanticException . It seems that "*" contains the virtual partition columns. drop table if exists zr_test; create table if not exists zr_test (key string, value string) partitioned by (dt string); drop table if exists zr_test_1; create table if not exists zr_test_1 (key string, value string) partitioned by (dt string); --Query One explain insert into table zr_test partition (dt='20130217') select key, value from zr_test_1 where dt='20130217'; --Query Two explain insert into table zr_test partition (dt='20130217') select * from zr_test_1 where dt='20130217'; Ouery One works well, bug Query Two failed with the following information: FAILED: SemanticException [Error 10044]: Line 2:18 Cannot insert into target table because column number/types are different ''20130217'': Table insclause-0 has 2 columns, but query has 3 columns. was: Inserting data into Hive table from a query , when the query is : select * from a_partitioned_table, will throw a SemanticException . It seems that "*" contains the virtual partition columns. drop table if exists zr_test; create table if not exists zr_test (key string, value string) partitioned by (dt string); drop table if exists zr_test_1; create table if not exists zr_test_1 (key string, value string) partitioned by (dt string); --Query One explain insert into table zr_test partition (dt='20130217') select key, value from zr_test_1 where dt='20130217'; --Query Two explain insert into table zr_test partition (dt='20130217') select * from zr_test_1 where dt='20130217'; Ouery One works well, bug Query Two failed with the following information: FAILED: SemanticException [Error 10044]: Line 2:18 Cannot insert into target table because column number/types are different ''20130217'': Table insclause-0 has 2 columns, but query has 3 columns. > Inserting data into Hive table from a query, when the query is a partitioned > table and select * ,will generate a SemanticException > ---------------------------------------------------------------------------------------------------------------------------------- > > Key: HIVE-4032 > URL: https://issues.apache.org/jira/browse/HIVE-4032 > Project: Hive > Issue Type: Bug > Components: Query Processor > Affects Versions: 0.10.0 > Reporter: caofangkun > Priority: Minor > > Inserting data into Hive table from a query , when the query is : select * > from a_partitioned_table, will throw a SemanticException . > It seems that "*" contains the virtual partition columns. > drop table if exists zr_test; > create table if not exists zr_test (key string, value string) partitioned by > (dt string); > drop table if exists zr_test_1; > create table if not exists zr_test_1 (key string, value string) partitioned > by (dt string); > --Query One > explain > insert into table zr_test partition (dt='20130217') select key, value from > zr_test_1 where dt='20130217'; > --Query Two > explain > insert into table zr_test partition (dt='20130217') select * from zr_test_1 > where dt='20130217'; > Ouery One works well, bug Query Two failed with the following information: > FAILED: SemanticException [Error 10044]: Line 2:18 Cannot insert into target > table because column number/types are different ''20130217'': Table > insclause-0 has 2 columns, but query has 3 columns. -- 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: http://www.atlassian.com/software/jira