Support Questions

Find answers, ask questions, and share your expertise

Managing Hive Query Log Files

avatar
Contributor

I want to see want to see Hive CLI log all SQL queries that are issued to MySQL.

6 REPLIES 6

avatar

@Stinger

You can check all query logs of Hive session from log file under /tmp as,

/tmp/<Username>/hive.log

Please check.

avatar
Expert Contributor
@nshelke
  • /tmp/${user.name} in Hive 0.2.0 through 0.8.0
  • /tmp/hive-${user.name} in Hive 0.8.1 through 0.14.0
  • /tmp/hive in Hive 0.14.0 and later

avatar
Contributor

Nope.. I can't see anything @nshelke

avatar
Master Guru

avatar
Contributor

@Timothy Spann cannot find the patterns in mysql log

avatar

Hive uses the MySQL jdbc connector for issuing queries to MySQL. You can turn on logging through the jdbc connection url (append &profileSQL=true&logger=com.mysql.jdbc.log.StandardLogger) you are using to connect to mysql db in hive-site.xml.

To turn it on the MySQL server you need to set the following in the my.cnf.

general_log      = 1
general_log_file = /path/to/query.log

See more information here.