- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
FileAlreadyExistsException when inserting in to Hive table
- Labels:
-
Apache Hive
-
Apache Spark
Created 08-24-2017 09:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Py4JJavaError: An error occurred while calling o64.sql.
: org.apache.spark.SparkException: Job aborted due to stage failure: Task 2 in stage 222.1 failed 4 times, most recent failure: Lost task 2.3 in stage 222.1
org.apache.hadoop.fs.FileAlreadyExistsException: /apps/hive/warehouse/.hive-staging_hive_2017-08-24_13-19-26_363_3818389113915853615-3/-ext-10000/_temporary/0/_temporary/attempt_20170824131928_0222_m_000052_0/part-00052 for client 10.64.66.157 already exists
When Creating the Hive table as below
try:
hive.sql("drop table tablename")
except:
pass
hive.sql("CREATE TABLE tablename STORED AS ORC AS SELECT * from temptable")
Created 08-25-2017 05:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Log states that there is already file contained in the place where you are trying to create a hive table. You may need to delete that file and try to re-create it or create the new hive table pointing to different location. Hope It Help!!
Created 08-25-2017 05:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Vivekanandan Gunasekaran What version of spark are you using? From the error, it looks like issue is similar to https://issues.apache.org/jira/browse/HIVE-14137. How temptable was created?
