Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

CREATE TABLE AS SELECT returns error 'Failed to open HDFS file for writing'

Solved Go to solution
Highlighted

Re: CREATE TABLE AS SELECT returns error 'Failed to open HDFS file for writing'

Contributor

1. Can you check the value of "fs.defaultFS" in core-site.xml file in impalad process directory

 

a. impalad process directory -- 

/var/run/cloudera-scm-agent/process/<num>-impala-IMPALAD

 

Replace <num> with the latest number under process directory

 

Then you can run 

grep -Rn 8020 * -b1

 

Please let me know if the hostname in the value tag matches the current namenode

Re: CREATE TABLE AS SELECT returns error 'Failed to open HDFS file for writing'

Explorer
@mbigelow
If the test table exists before I run the CTAS statement, I receive an error that the test table already exists.

@venkatsambath

The hostname in the value tag *does* match the current namenode.

Re: CREATE TABLE AS SELECT returns error 'Failed to open HDFS file for writing'

Contributor

@ski309

 

Was the below action performed after moving the namenode?

 

https://www.cloudera.com/documentation/enterprise/5-7-x/topics/admin_nn_migrate_roles.html#concept_f...

 

The HiveMetastoreDatabase maintains the location of tables and databases. So once after moving the namenode, it is necessary to perform the above step to update the locations in HMS.

Re: CREATE TABLE AS SELECT returns error 'Failed to open HDFS file for writing'

Explorer
@venkatsambath
I did not do those actions! Must have missed that, thank you for pointing it out. Everything is working as expected now.

Re: CREATE TABLE AS SELECT returns error 'Failed to open HDFS file for writing'

Contributor

You're welcome!