-1

I am trying to perform a simple query on Hive - Spark engine:

SELECT count(*) FROM classification_output GROUP BY model_id;

I keep receiving the below error:

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)

Only ONT time it worked after 12 minutes

The number of records on the table are around ~7K, I suspect a configuration issue, but I am not sure which parameter.

I tried to:

  • Restart HIVE server
  • Increased the timeout for Hive server

Note:

Using:

SELECT count(*) FROM classification_output;

With no group by.... works just fine and return the below:

+-------+
|  _c0  |
+-------+
| 7164  |
+-------+
1 row selected (0.092 seconds)
MMSA
  • 810
  • 8
  • 22
  • Query is logically incorrect, why "group by" used if total count is required. If include groupped field into "select", all have to work fine, smth. like: SELECT model_id, count(*) FROM classification_output GROUP BY model_id – pasha701 Mar 31 '19 at 19:33
  • That exactly what I am looking for? To group by model_id not to get the count. However, if I removed the group by it works fine. – MMSA Mar 31 '19 at 19:34

2 Answers2

0

After spending some time around this issue, I managed to find the solution. It has nothing to do with the query. There was another SparkClient process running, once I stopped it and executed the query it works fine.

MMSA
  • 810
  • 8
  • 22
0

For anyone that lands here with the error

Syntax or semantic analysis error thrown in server while executing query. Error message from server: Error while compiling statement:FAILED: SemanticException Got exception though getTableObjectByName method should ignore it

check your authentication.

Taran
  • 12,822
  • 3
  • 43
  • 47