如何使用hive on spark

使用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);
发布了483 篇原创文章 · 获赞 62 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/wwwzydcom/article/details/104603362