Spark2 Scala代码连接到经过Kerberos身份验证的配置单元

时间:2018-06-27 06:48:32

标签: scala hive apache-spark-sql kerberos apache-spark-2.0

从spark scala代码连接到配置单元时,出现面向错误。下面是错误:     用户类引发异常:java.lang.IllegalArgumentException:实例化“ org.apache.spark.sql.hive.HiveSessionState”时出错:

    Below java code which is working fine: 

      public static void main(String[] args) throws Exception {

            UserGroupInformation.getLoginUser().doAs(new PrivilegedExceptionAction() {
                public Void run() throws Exception {
                    SparkTest.runJob();
                    return null;
                }
            });
        }

    Can someone tell me the scala equivalent code to connect.

0 个答案:

没有答案