Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Unable to fine the Hive location folder

avatar
Explorer

I installed Hive and create table.When i check the table properties using "describe extended recharge", then i found the table was created in below location

location:hdfs://localhost:9000/user/hive/warehouse/telecom.db/recharge

I try to find the location inside user folder, but i can't find the hive/warehouse folder ?

12 REPLIES 12

avatar
Master Mentor

@Aruna Sameera

Can you please check what value have you set for the "hive.metastore.warehouse.dir" ? In my cluster it is : "/apps/hive/warehouse" in my HDP based hive configs.

avatar
Explorer

when i am installing hive i set below in .bashrc file

export HIVE_HOME=/home/aruna/apache-hive-1.2.1-bin
export PATH=$PATH:/home/aruna/apache-hive-1.2.1-bin/bin

Create folders

hadoop fs -makedir -p /user/hive/warehouse   //create folder
hadoop fs -chmod  g+w /user/hive/warehouse   //add permission
hadoop fs -chmod  g+w /tmp   //add permission

and added hadoop path to hive-config.sh file.

export HADOOP_HOME=/home/aruna/hadoop-2.7.3

these are the things i have done.I don't remember that i set the "hive.metastore.warehouse.dir" value?

avatar
Master Mentor

@Aruna Sameera

You will find the value of "hive.metastore.warehouse.dir" parameter in the "hive-site.xml" . Can you please share what value do you have there for this parameter?

avatar
Explorer

I don't have hive-site.xml file in conf folder. There is a hive-default.xml.template file. It have hive.metastore.warehouse.dir value as below

<property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/user/hive/warehouse</value>
    <description>location of default database for the warehouse</description>
  </property>

avatar
Master Mentor

@Aruna Sameera

Do you see any output of the following? To see if the "recharge" table of "telecom" database has any data or not?

# hive shell
hive> use telecom;
hive> select * from recharge;

If you see no records then please insert some records there.

.

avatar
Explorer

@Jay SenSharma , below are the results for queries.

1) hive shell ;

hive> hive shell;
NoViableAltException(26@[])
    at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1071)
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:202)
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:396)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:308)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1122)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1170)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1059)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1049)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:213)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:736)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
FAILED: ParseException line 1:0 cannot recognize input near 'hive' 'shell' '<EOF>'

2) use telicom;

hive> use telecom;
OK
Time taken: 0.02 seconds

3) select * from recharge

hive> select * from recharge;
OK
9999999    ind    abc
6399    usa    mnb
9087    uk    sasadda
Time taken: 0.351 seconds, Fetched: 3 row(s)

avatar
Master Mentor

@Aruna Sameera

The first error that you got you can ignroe it. Because inside "hive>" shll if you will run that command "hive shell;" then you will get the same error. Because "hive shell" is a command to start the hive shell, But once you are inside the hive shell then there is no such command "hive> hive shell".

avatar
Explorer

Ok. even there is a database(telicome) and table(recharge) already created , but i can't fine the hive/warehouse folder.Since i didn't add them in hive-site.xml that folder may created in a default location ?So where can be that folder ?

when i am installing hive i created folders using below command and add permission.

hadoop fs -makedir -p /user/hive/warehouse //create folder 

hadoop fs -chmod  g+w /user/hive/warehouse   //add permission

hadoop fs -chmod  g+w /tmp   //add permission

avatar
@Aruna Sameera

Can you share the output of following?

hive> describe formatted telecom.recharge;

hadoop fs -ls /user/hive/warehouse

hadoop fs -ls /user/hive/warehouse/telecom.db