There are two options.
Increase the below timeouts before executing the problematic query (in the beeline session). Check the following settings:
And then increase their values, example as below:
<...then submit HoS query...>
Please consider also to decrease the memory or executor requirement for Spark application (in the beeline session):
SET spark.dynamicAllocation.maxExecutors=<number of maximum executors>;
SET spark.executor.memory=<memory in bytes>;
SET spark.driver.memory=<memory in bytes>;
For more details, please refer to below document for tuning Hive on Spark.
For option 1, if you also want to apply the same setting for other queries and other users, take in consideration to set it globally:
on Cloudera Manager Home Page > Hive > Configuration > Hive Service Advanced Configuration Snippet (Safety Valve) for hive-site.xml > put in the following XML for this field:
Restart Hive Services to make the changes in effect.