[ https://issues.apache.org/jira/browse/HIVE-2742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13606859#comment-13606859 ]
Tim Goodman commented on HIVE-2742: ----------------------------------- I had a similar issue using INSERT OVERWRITE TABLE [mySchema].[myTable] PARTITION([myPartition]) SELECT ... It works the first time, and then fails the second time, presumably because in the latter case it has to alter the existing partition. But as a workaround, do USE [mySchema]; before the overwrite, and then it works. It is similar to the fact that you can't do ALTER TABLE [mySchema].[myTable] ... but instead must do USE [mySchema]; ALTER TABLE [myTable] ... > InvalidOperationException "alter table is not possible" when using LOAD DATA > INPATH OVERWRITE with database and partition > ------------------------------------------------------------------------------------------------------------------------- > > Key: HIVE-2742 > URL: https://issues.apache.org/jira/browse/HIVE-2742 > Project: Hive > Issue Type: Bug > Components: Database/Schema, Metastore, Query Processor > Affects Versions: 0.7.1 > Environment: reproduced on cdh3u2 (haven't tried other versions) > Reporter: Maxime Brugidou > > Here is a repeatable procedure: > {code} > $ echo "test" | hadoop fs -put - test.txt > $ echo "test2" | hadoop fs -put - test2.txt > {code} > Then in hive: > {code} > > create database catalog; > > use catalog; > > create table test_load (t string) partitioned by (p string); > > use default; > {code} > Then the problem arises: > {code} > > load data inpath 'test.txt' overwrite into table catalog.test_load > > partition (p='test'); > Loading data to table catalog.test_load partition (p=test) > OK > Time taken: 0.175 seconds > > load data inpath 'test2.txt' overwrite into table catalog.test_load > > partition (p='test'); > Loading data to table catalog.test_load partition (p=test) > Moved to trash: > hdfs://mycluster/user/hive/warehouse/catalog.db/test_load/p=test > Failed with exception InvalidOperationException(message:alter is not possible) > FAILED: Execution Error, return code 1 from > org.apache.hadoop.hive.ql.exec.MoveTask > {code} -- 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