Support Questions
Find answers, ask questions, and share your expertise

Where are Hive queries stored? In HDFS or LInux file system?

Explorer

Hello,

A Sandbox we're running has become corrupted, with HDFS no longer accessible. If possible, I would like to recover the Hive queries I wrote on this Sandbox. Not the data itself, but the actual SQL like querying in format 'SELECT * FROM...'

Does anyone know where this text is stored? On HDFS or Linux file system?

Thanks

Aidan

6 REPLIES 6

Re: Where are Hive queries stored? In HDFS or LInux file system?

Rising Star

@Aidan,

Hive query log is located at the value of hive.query.log.location in hive-site.xml. By default it should be at /tmp/[user_name]. In that log, you can see hive queries.

Re: Where are Hive queries stored? In HDFS or LInux file system?

Explorer

Thanks Takahiko Saito I used the default ambari log in maria_dev, but at the moment I don't see a maria_dev folder under tmp. Do you know the location of hive-site.xml?

Re: Where are Hive queries stored? In HDFS or LInux file system?

Explorer

OK I looked it up, it's in /root/conf, but I don't see that either! Are these on HDFS or linux? If on HDFS, inaccessible to me unfortunately.

Thanks!

Re: Where are Hive queries stored? In HDFS or LInux file system?

@ Aidan Condron

you will get currrent used hive-site.sml file is following path:- /usr/hdp/hdp_version/hive.

And by default the location of the query log files (by default /tmp/user).

and you can change the directory with following property:- <property>

<name>hive.querylog.location</name>
<value>/Changed/Log/Directory</value>
</property>
<property>
<name>hive.querylog.enable.plan.progress</name>
<value>false</value>
</property>

If this will help you plz accept and close this so that it will help others.

Re: Where are Hive queries stored? In HDFS or LInux file system?

@Aidan Condron

Hive DDLs information gets stored in your hive Metastore DB, I think sandbox using default database which is PostgreSQL..

Re: Where are Hive queries stored? In HDFS or LInux file system?

Rising Star

@Aidan,

The file is on Linux, not HDFS.

hive-site.xml should be located on /etc/hive/conf/hive-site.xml. If hive.query.log.location is undefined in hive-site.xml. You can run 'set hive.query.log.location' via CLI to get the value of hive.query.log.location.

Hope this helps.