Support Questions

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

Can I set a maximum query time with Hive JDBC?

avatar
Rising Star

I recently had a hive query (executed via a JDBC connection) hang for several hours due to a metastore issue. Is there a way that I set a maximum query time with my JDBC connection? This query should take just a few seconds, so I'd rather kill it after a few minutes than let it block for hours.

Some searching of the Hive JIRA suggests that this isn't possible, but asking here if anyone has advice.

1 ACCEPTED SOLUTION

avatar
Master Guru

I have not tried this

  • hive.server2.idle.operation.timeoutWith hive.server2.session.check.interval set to a positive time value, operation will be closed when it's not accessed for this duration of time, which can be disabled by setting to zero value. With positive value, it's checked for operations in terminal state only (FINISHED, CANCELED, CLOSED, ERROR). With negative value, it's checked for all of the operations regardless of state.
  • hive.server2.idle.session.timeoutWith hive.server2.session.check.interval set to a positive time value, session will be closed when it's not accessed for this duration of time, which can be disabled by setting to zero or negative value.

and if it was metastore issue, did you try:

  • hive.metastore.client.socket.timeoutMetaStore Client socket timeout in seconds.

View solution in original post

1 REPLY 1

avatar
Master Guru

I have not tried this

  • hive.server2.idle.operation.timeoutWith hive.server2.session.check.interval set to a positive time value, operation will be closed when it's not accessed for this duration of time, which can be disabled by setting to zero value. With positive value, it's checked for operations in terminal state only (FINISHED, CANCELED, CLOSED, ERROR). With negative value, it's checked for all of the operations regardless of state.
  • hive.server2.idle.session.timeoutWith hive.server2.session.check.interval set to a positive time value, session will be closed when it's not accessed for this duration of time, which can be disabled by setting to zero or negative value.

and if it was metastore issue, did you try:

  • hive.metastore.client.socket.timeoutMetaStore Client socket timeout in seconds.