Created 02-22-2017 05:34 AM
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 ?
Created 02-22-2017 05:40 AM
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.
Created 02-22-2017 05:54 AM
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?
Created 02-22-2017 05:56 AM
Created 02-22-2017 06:05 AM
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>
Created 02-22-2017 06:16 AM
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.
.
Created 02-22-2017 06:34 AM
@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)
Created 02-22-2017 06:40 AM
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".
Created 02-22-2017 06:46 AM
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
Created 02-22-2017 06:07 PM
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