Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> hive 0.7.1 Error: Non-Partition column appears in the partition specification


Copy link to this message
-
hive 0.7.1 Error: Non-Partition column appears in the partition specification
Hello all!

I have a problem with dynamic partitions in hive 0.7.1.

For example I have 2 tables:

CREATE TABLE table1 (text STRING);
CREATE TABLE table2 (text STRING) PARTITIONED BY (author STRING);

And make insert into dynamic partition from table1 to table2
SET hive.exec.dynamic.partition = true;
SET hive.exec.dynamic.partition.mode = nonstrict;

Query
INSERT OVERWRITE TABLE table2 PARTITION (author)
SELECT text FROM (SELECT text, 'Tolstoy' AS author FROM table1) tmp;

failes with error:
FAILED: Error in semantic analysis: Line 1:23 Cannot insert into target
table because column number/types are different author: Table insclause-0
has 2 columns, but query has 1 columns.
Query:
INSERT OVERWRITE TABLE table2 PARTITION (new_author)
SELECT text FROM (SELECT text, 'Tolstoy' AS new_author FROM table1) tmp;

failes with error:
FAILED: Error in semantic analysis: Non-Partition column appears in the
partition specification:  new_author
What is happen? Is there any workaround for this problem?

I know that I can use static partition author = 'Tolsoy', but my real query
is more complex and dynamic partition calculates from several input fields.

Best regards
Mezentsev Pavel
Moscow.
+
Nitin Pawar 2012-11-15, 10:03
+
Павел Мезенцев 2012-11-15, 10:43
+
Nitin Pawar 2012-11-15, 10:56
+
Ruslan Al-Fakikh 2012-11-16, 16:23
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB