[HADOOP] Hive2 & JDBC-필수 필드 'serverProtocolVersion'이 설정되지 않았습니다.
HADOOPHive2 & JDBC-필수 필드 'serverProtocolVersion'이 설정되지 않았습니다.
사용하여 하이브에 연결하려고합니다. 드라이버 org.apache.hive.jdbc.HiveDriver
private static String driverName = "org.apache.hive.jdbc.HiveDriver";
public void (String query)throws SQLException {
try {
Class.forName(driverName);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.exit(1);
}
Connection con = DriverManager.getConnection("jdbc:hive2://localhost:10000/default", "", "");
Statement stmt = con.createStatement();
String tableName = "testHiveTable";
stmt.executeQuery("drop table " + tableName);
ResultSet res = stmt.executeQuery("create table " + tableName + " as "+query);
다음 오류가 발생합니다
java.sql.SQLException: Could not establish connection to jdbc:hive2://localhost:10000/default: Required field 'serverProtocolVersion' is unset! Struct:TOpenSessionResp(status:TStatus(statusCode:SUCCESS_STATUS), serverProtocolVersion:null, sessionHandle:TSessionHandle(sessionId:THandleIdentifier(guid:4A D8 C1 6F 82 54 49 05 80 77 24 7D A2 3A 1D 9A, secret:21 9B BF EA 37 B6 49 60 BE 5F D2 13 98 E3 17 0B)), configuration:{})
해결법
-
==============================
1.나는 같은 문제가 있었다. getConnection 메소드에서 username을 설정하면 문제가 해결되었습니다. 자세한 내용은 HiveServer2 설명서를 참조하십시오.
나는 같은 문제가 있었다. getConnection 메소드에서 username을 설정하면 문제가 해결되었습니다. 자세한 내용은 HiveServer2 설명서를 참조하십시오.
from https://stackoverflow.com/questions/27614723/hive2-jdbc-required-field-serverprotocolversion-is-unset by cc-by-sa and MIT license
'HADOOP' 카테고리의 다른 글
[HADOOP] Hadoop MapReduce 스크립트에서 외부 라이브러리 가져 오기 (0) | 2019.09.09 |
---|---|
[HADOOP] 하둡 의도 된 메모리 사용량 (0) | 2019.09.09 |
[HADOOP] 기본 디렉토리가 변경 될 때 Hive 테이블이 자동으로 업데이트 될 수 있습니까 (0) | 2019.09.09 |
[HADOOP] HBase 단일 행 트랜잭션 지원에서의 행 잠금 (0) | 2019.09.09 |
[HADOOP] Pig에서 여러 맵의 튜플을 다른 행으로 분할하는 방법 (0) | 2019.09.09 |