java.sql.SQLException: [Cloudera]ImpalaJDBCDriver Communication link failure. Failed to connect to server. Reason: java.net.SocketException: Broken pipe.
at com.cloudera.impala.hivecommon.api.HS2Client.executeStatementInternal(Unknown Source)
at com.cloudera.impala.hivecommon.api.HS2Client.executeStatement(Unknown Source)
at com.cloudera.impala.hivecommon.dataengine.HiveJDBCNativeQueryExecutor.executeHelper(Unknown Source)
at com.cloudera.impala.hivecommon.dataengine.HiveJDBCNativeQueryExecutor.execute(Unknown Source)
at com.cloudera.impala.jdbc.common.SPreparedStatement.executeWithParams(Unknown Source)
at com.cloudera.impala.jdbc.common.SPreparedStatement.execute(Unknown Source)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
……
Caused by: com.cloudera.impala.support.exceptions.ErrorException: [Cloudera]ImpalaJDBCDriver Communication link failure. Failed to connect to server. Reason: java.net.SocketException: Broken pipe.
… 12 more
Caused by: com.cloudera.impala.jdbc4.internal.apache.thrift.transport.TTransportException: java.net.SocketException: Broken pipe
at com.cloudera.impala.jdbc4.internal.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:147)
at com.cloudera.impala.jdbc4.internal.apache.thrift.protocol.TBinaryProtocol.writeString(TBinaryProtocol.java:187)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TExecuteStatementReq$TExecuteStatementReqStandardScheme.write(TExecuteStatementReq.java:672)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TExecuteStatementReq$TExecuteStatementReqStandardScheme.write(TExecuteStatementReq.java:595)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TExecuteStatementReq.write(TExecuteStatementReq.java:512)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$ExecuteStatement_args$ExecuteStatement_argsStandardScheme.write(TCLIService.java:4117)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$ExecuteStatement_args$ExecuteStatement_argsStandardScheme.write(TCLIService.java:4081)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$ExecuteStatement_args.write(TCLIService.java:4032)
at com.cloudera.impala.jdbc4.internal.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$Client.send_ExecuteStatement(TCLIService.java:219)
at com.cloudera.impala.hivecommon.api.HS2ClientWrapper.send_ExecuteStatement(Unknown Source)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$Client.ExecuteStatement(TCLIService.java:211)
at com.cloudera.impala.hivecommon.api.HS2ClientWrapper.ExecuteStatement(Unknown Source)
… 12 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:121)
at com.cloudera.impala.jdbc4.internal.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:145)
… 24 more
2019-08-12 06:35:05.828 com.baijiahulian.bi.dao.NewOrderDao:130 [ERROR] - batchUpsertCustomer {}
java.sql.SQLException: [Cloudera]ImpalaJDBCDriver Communication link failure. Failed to connect to server. Reason: java.net.SocketException: Broken pipe.
at com.cloudera.impala.hivecommon.api.HS2Client.executeStatementInternal(Unknown Source)
at com.cloudera.impala.hivecommon.api.HS2Client.executeStatement(Unknown Source)
at com.cloudera.impala.hivecommon.dataengine.HiveJDBCNativeQueryExecutor.executeHelper(Unknown Source)
at com.cloudera.impala.hivecommon.dataengine.HiveJDBCNativeQueryExecutor.execute(Unknown Source)
at com.cloudera.impala.jdbc.common.SPreparedStatement.executeWithParams(Unknown Source)
at com.cloudera.impala.jdbc.common.SPreparedStatement.execute(Unknown Source)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
…..
Caused by: com.cloudera.impala.support.exceptions.ErrorException: [Cloudera]ImpalaJDBCDriver Communication link failure. Failed to connect to server. Reason: java.net.SocketException: Broken pipe.
… 12 more
Caused by: com.cloudera.impala.jdbc4.internal.apache.thrift.transport.TTransportException: java.net.SocketException: Broken pipe
at com.cloudera.impala.jdbc4.internal.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:147)
at com.cloudera.impala.jdbc4.internal.apache.thrift.protocol.TBinaryProtocol.writeString(TBinaryProtocol.java:187)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TExecuteStatementReq$TExecuteStatementReqStandardScheme.write(TExecuteStatementReq.java:672)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TExecuteStatementReq$TExecuteStatementReqStandardScheme.write(TExecuteStatementReq.java:595)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TExecuteStatementReq.write(TExecuteStatementReq.java:512)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$ExecuteStatement_args$ExecuteStatement_argsStandardScheme.write(TCLIService.java:4117)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$ExecuteStatement_args$ExecuteStatement_argsStandardScheme.write(TCLIService.java:4081)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$ExecuteStatement_args.write(TCLIService.java:4032)
at com.cloudera.impala.jdbc4.internal.apache.thrift.TServiceClient.sendBase(TServiceClient.java:63)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$Client.send_ExecuteStatement(TCLIService.java:219)
at com.cloudera.impala.hivecommon.api.HS2ClientWrapper.send_ExecuteStatement(Unknown Source)
at com.cloudera.impala.jdbc4.internal.apache.hive.service.cli.thrift.TCLIService$Client.ExecuteStatement(TCLIService.java:211)
at com.cloudera.impala.hivecommon.api.HS2ClientWrapper.ExecuteStatement(Unknown Source)
… 12 more
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:121)
at com.cloudera.impala.jdbc4.internal.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:145)
… 24 more
解决: 本程序执行的时间较长,过程中其他任务也户籍执行,因为之前程序正常执行,而到出错之间只是跑的任务增加了,因此,确认代码没有问题后,增加连接池的大小,经过测试解决了问题.