java使用hive-jdbc查询超时:java.sql.SQLException: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out

 

java.sql.SQLException: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out

    at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:262)

    at org.apache.hive.jdbc.HivePreparedStatement.execute(HivePreparedStatement.java:98) at

 

 

如果超时时间是三十秒的话 那就是驱动的请求时间没设置 ,这个时间默认就是30s

在执行sql前执行

        // 设置连接超时时间为6000秒
        DriverManager.setLoginTimeout(6000);

 

增加请求的超时时间

posted @ 2023-11-30 19:45  yvioo  阅读(933)  评论(0)    收藏  举报