Home > Back-end >  Cycle times in the program execution hive queries, often appear HiveSqlException and Socket closed a
Cycle times in the program execution hive queries, often appear HiveSqlException and Socket closed a

Time:11-01

situation is as follows:
in the program cycle hive queries, a loop has dozens of hive SQL query, loop 100 times or so, the dozens of SQL are my hive validated the shell, execute all have no problem, but the loop execution will appear the following exceptions:
Cause: Java. SQL. SQLException: org. Apache. Hive. Service. Cli. HiveSQLException: Error while processing the statement: FAILED: Execution Error, return code 2 from org.. Apache hadoop. Hive. Ql. Exec. Mr. MapRedTask
At org. Apache. Hive. Service. Cli. Operation. Operation. ToSQLException (380) operation. Java:
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation. RunQuery (SQLOperation. Java: 257)
At org. Apache. Hive. Service. Cli. Operation. SQLOperation. Access the $800 (91) SQLOperation. Java:
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation $BackgroundWork $1. Run (SQLOperation. Java: 348)
The at Java. Security. The AccessController. DoPrivileged (Native Method)
At javax.mail. Security. Auth. Subject. The doAs (422) Subject. Java:
At org, apache hadoop. Security. UserGroupInformation. DoAs (UserGroupInformation. Java: 1762)
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation $BackgroundWork. Run (SQLOperation. Java: 362)
The at Java. Util. Concurrent. Executors $RunnableAdapter. Call (511) Executors. Java:
The at Java. Util. Concurrent. FutureTask. Run (FutureTask. Java: 266)
The at Java. Util. Concurrent. ThreadPoolExecutor. RunWorker (ThreadPoolExecutor. Java: 1149)
The at Java. Util. Concurrent. ThreadPoolExecutor $Worker. The run (ThreadPoolExecutor. Java: 624)
The at Java. Lang. Thread. The run (Thread. Java: 748)

; [SQL]; Org. Apache. Hive. Service. Cli. HiveSQLException: Error while processing the statement: FAILED: Execution Error, return code 2 from org.. Apache hadoop. Hive. Ql. Exec. Mr. MapRedTask
At org. Apache. Hive. Service. Cli. Operation. Operation. ToSQLException (380) operation. Java:
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation. RunQuery (SQLOperation. Java: 257)
At org. Apache. Hive. Service. Cli. Operation. SQLOperation. Access the $800 (91) SQLOperation. Java:
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation $BackgroundWork $1. Run (SQLOperation. Java: 348)
The at Java. Security. The AccessController. DoPrivileged (Native Method)
At javax.mail. Security. Auth. Subject. The doAs (422) Subject. Java:
At org, apache hadoop. Security. UserGroupInformation. DoAs (UserGroupInformation. Java: 1762)
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation $BackgroundWork. Run (SQLOperation. Java: 362)
The at Java. Util. Concurrent. Executors $RunnableAdapter. Call (511) Executors. Java:
The at Java. Util. Concurrent. FutureTask. Run (FutureTask. Java: 266)
The at Java. Util. Concurrent. ThreadPoolExecutor. RunWorker (ThreadPoolExecutor. Java: 1149)
The at Java. Util. Concurrent. ThreadPoolExecutor $Worker. The run (ThreadPoolExecutor. Java: 624)
The at Java. Lang. Thread. The run (Thread. Java: 748)
; Nested exception is Java. SQL. SQLException: org. Apache. Hive. Service. The cli. HiveSQLException: Error while processing the statement: FAILED: Execution Error, return code 2 from org.. Apache hadoop. Hive. Ql. Exec. Mr. MapRedTask
At org. Apache. Hive. Service. Cli. Operation. Operation. ToSQLException (380) operation. Java:
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation. RunQuery (SQLOperation. Java: 257)
At org. Apache. Hive. Service. Cli. Operation. SQLOperation. Access the $800 (91) SQLOperation. Java:
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation $BackgroundWork $1. Run (SQLOperation. Java: 348)
The at Java. Security. The AccessController. DoPrivileged (Native Method)
At javax.mail. Security. Auth. Subject. The doAs (422) Subject. Java:
At org, apache hadoop. Security. UserGroupInformation. DoAs (UserGroupInformation. Java: 1762)
The at org. Apache. Hive. Service. Cli. Operation. SQLOperation $BackgroundWork. Run (SQLOperation. Java: 362)
The at Java. Util. Concurrent. Executors $RunnableAdapter. Call (511) Executors. Java:
The at Java. Util. Concurrent. FutureTask. Run (FutureTask. Java: 266)
The at Java. Util. Concurrent. ThreadPoolExecutor. RunWorker (ThreadPoolExecutor. Java: 1149)
The at Java. Util. Concurrent. ThreadPoolExecutor $Worker. The run (ThreadPoolExecutor. Java: 624)
The at Java. Lang. Thread. The run (Thread. Java: 748)

and the location is not sure, for example: sometimes appear in the third article 5 SQL cycle this exception, sometimes appear in the seventh circle of SQL 6 this exception,,
To view the hive log files, and this exception, don't know what reason is caused,
Usually also comes with a socket close exception: the following

17:25:06, 418 WARN ProxyConnection: 161 - HikariPool - 2 - Connection org. Apache. Hive. JDBC. HiveConnection @ 724 b7a33 marked as broken because of SQLSTATE (08 s01), ErrorCode (0)
Java. SQL. SQLException: org. Apache. Thrift. Transport. TTransportException: java.net.SocketException: Socket closed
The at org. Apache. Hive. JDBC. HiveStatement. WaitForOperationToComplete (HiveStatement. Java: 399)
The at org. Apache. Hive. JDBC. HiveStatement. Execute (HiveStatement. Java: 254)
The at org. Apache. Hive. JDBC. HivePreparedStatement. Execute (HivePreparedStatement. Java: 101)
At com. Zaxxer. Hikari. Pool. ProxyPreparedStatement. Execute (ProxyPreparedStatement. Java: 44)
At com. Zaxxer. Hikari. Pool. HikariProxyPreparedStatement. Execute (HikariProxyPreparedStatement. Java)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull