使用jdbc连接hive时,加上参数set hive.execution.engine=spark
Class.forName(hiveDriver);
Connection conn = null;
Statement pstmt = null;
ResultSet rs = null;
conn = DriverManager.getConnection(beelineURL);
pstmt = conn.createStatement();
pstmt.execute("set hive.execution.engine=spark");
rs = pstmt.executeQuery(context);