Impala query fails with invalid query handle error

You encounter an "Invalid query handle" error when running Impala queries from the Hue web interface because the connection between Impala Thrift server and the Hue Load Balancer times out. This is governed by the server_conn_timeout property.

The default value of the server_conn_timeout property is 30 minutes. You can increase the timeout limit by updating the Hue configuration using Cloudera Manager.
  1. Log into Cloudera Manager as an Administrator.
  2. Go to Clusters > Hue service > Configuration > Hue Service Advanced Configuration Snippet (Safety Valve) for hue_safety_valve.ini.
  3. Increase the value of the server_conn_timeout property in the Impala section as follows:
    [impala]
       server_host=[***SERVER-HOST***]
       server_port=[***PORT***]
       server_conn_timeout=[***TIMEOUT-IN-SECONDS***]
    You can increase the value of the server_conn_timeout property to 2 hours (7200 seconds).
  4. Click Save Changes.
  5. Restart the Hue service.
You should be able to run Impala queries from the Hue web interface successfully.