Support Questions

Find answers, ask questions, and share your expertise

getting issue after run the command in Hive

avatar

I am using HDP 2.4.2-258.

I ran the command on hive terminal but getting following error:-

hive> show create table hive_table;

FAILED: SemanticException Unable to fetch table hive_table. java.io.IOException: Incomplete HDFS URI, no host: hdfs://hdptest:8020:8020/

hive> show create table hive_table;

FAILED: SemanticException Unable to fetch table hive_table. java.io.IOException: Incomplete HDFS URI, no host: hdfs://hdptest:8020:8020

Dont know from where this path is taking because I updated the path with following command:-

hive --service metatool -updateLocation hdfs://hdptest1:8020 hdfs://localhost:8020

It's urgent.

Thanks in advance.

1 ACCEPTED SOLUTION

avatar
Super Collaborator

@Ashnee Sharm

You dont need to specify 8020 port when updating with metatool for updating nameservice ID

Try below command to set FS path

#hive --service metatool -updateLocation hdfs://hdptest1 hdfs://hdptest1:8020

View solution in original post

8 REPLIES 8

avatar
Super Collaborator

@Ashnee Sharm

You dont need to specify 8020 port when updating with metatool for updating nameservice ID

Try below command to set FS path

#hive --service metatool -updateLocation hdfs://hdptest1 hdfs://hdptest1:8020

avatar
Super Collaborator

Connect to db and verify if it has updated the location in tables SDS.

mysql> use hive;

mysql> select LOCATION from SDS;

avatar

I truncate the SDS table now getting null exception.

hive> show create table hive_table;

FAILED: SemanticException Unable to fetch table hive_table. null

avatar

Thanks for the reply issue is resolved.

avatar

I have tried this command and the command ran successfully. But still facing same issue:-

hive> select * from hive_table;

FAILED: SemanticException Unable to fetch table hive_table. java.io.IOException: Incomplete HDFS URI, no host: hdfs://hdptest1:8020:8020/

avatar

@Ashnee Sharma

Issue seems to be related to the incorrect HDFS URI at the time of table creation. Try creating new sample table and try.

avatar

@Sindhu

The issue is with location tables are created in corrrect way. As per the comment of @rguruvannagari issue with SDS table after truncate the table that issue is resolved now getting new error:

hive> show create table hive_table;

FAILED: SemanticException Unable to fetch table hive_table. null

avatar

This issue may happen when Hive Metastore's 'DBS' table contains a location which doesn't have port.

For example, 'hdfs://sandbox-hdp.hortonworks.com/apps/hive/warehouse/dummies.db'

I think above is a valid location path, but when HS2 is restarted from Ambari, Ambari replaces not only this 'DBS' location, but also all 'SDS' locations with, for example, like below:

old location: hdfs://sandbox-hdp.hortonworks.com:8020/apps/hive/warehouse/dummies.db/emp_part_bckt/department=A new location: hdfs://sandbox-hdp.hortonworks.com:8020:8020/apps/hive/warehouse/dummies.db/emp_part_bckt/department=A

So that next time hiveserver2 is restarted, you don't see this behaviour, but you still need to correct SDS location.