title: How to fix 'org.apache.hadoop.hive.ql.metadata.HiveException' in Hive-Spark, when using simple query?
body: <p>I am trying to perform a simple query on Hive - Spark engine:</p>
  
  <pre><code>SELECT count(*) FROM classification_output GROUP BY model_id;
  </code></pre>
  
  <p>I keep receiving the below error:</p>
  
  <pre><code>Error: Error while compiling statement: FAILED: SemanticException Failed to get a spark session: org.apache.hadoop.hive.ql.metadata.HiveException: Failed to create spark client. (state=42000,code=40000)
  </code></pre>
  
  <p>Only ONT time it worked after 12 minutes</p>
  
  <p>The number of records on the table are around ~7K, I suspect a configuration issue, but I am not sure which parameter. </p>
  
  <p>I tried to:</p>
  
  <ul>
  <li>Restart HIVE server</li>
  <li>Increased the timeout for Hive server</li>
  </ul>
  
  <p>Note:</p>
  
  <p>Using:</p>
  
  <pre><code>SELECT count(*) FROM classification_output;
  </code></pre>
  
  <p>With no <code>group by....</code> works just fine and return the below:</p>
  
  <pre><code>+-------+
  |  _c0  |
  +-------+
  | 7164  |
  +-------+
  1 row selected (0.092 seconds)
  </code></pre>