简体   繁体   中英

Hive: Read timeout exception

The problem is when I'm trying to query smth from hive using my application eg analyze table table_entity compute statistics or for example select count(*) from table_entity sometimes I got such exception: java.net.SocketTimeoutException: Read timed out

But when for example I query show tables or show tblproperties table_entity I didn't get such exception.

Has anyone faced with this problem?

Thank you in advance.

I know this is little late, but I was stuck with same sort of problem where we were not able to drop a table, we raised a case with Cloudera and following was the suggestion provided by them:

Upon investigating the logs and the stack of messages we have observed during the execution of the DROP query for the table "tableName", the query got failed due to "Read time out" in HiveServer2 from HiveMetastore. This means the drop operation of the table was not able to get complete at Metadata level. (In general - DROP operation deletes the metadata details of a table from HMS) We are suspecting that the metadata of this table is not up to date and might have more data which could have led to the timeout. Could you please perform the below steps and let us know your feedback?

  1. Login to Beeline-Hive.

  2. Update the partition level metadata in Hive Metastore: MSCK REPAIR TABLE db.table_name DROP PARTITIONS;

  3. Compute the statistics for the table: ANALYZE TABLE db.tableName partition(col1, col2) compute statistics noscan;

  4. Drop the partitions of the table first using the query: ALTER TABLE db.tableName DROP [IF EXISTS] PARTITION partition_spec[, PARTITION partition_spec, ...] Please replace the partition values in the above command accordingly as per the partitions of the table.

  5. Increase the Hive Metastore client socket timeout. set hive.metastore.client.socket.timeout=1500. This will give an increased socket time out only for this session. Hence run the next step #6 in the same session.

  6. Drop the table tableName; DROP TABLE db.tableName;

Although the question here is regarding Analyze table issue but this answer is intended to cover all the other issues related to Read Timeout Error.

I have shown my scenario(drop statement), however these steps will surely help across all sorts of queries which leads to the Read timeout Exception.

Cheers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM