获取 IllegalArgumentException
Posted
技术标签:
【中文标题】获取 IllegalArgumentException【英文标题】:Getting IllegalArgumentException 【发布时间】:2017-12-21 10:28:02 【问题描述】:我在提交 spark 作业时遇到 IllegalArgumentException
C:\spark\spark-2.2.1-bin-hadoop2.7\hadoop\bin>pyspark
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.hadoop.security.authentication.util.KerberosUtil (file:/C:/spark/spark-2.2.1-bin-hadoop2.7/jars/hadoop-auth-2.7.3.jar) to method sun.security.krb5.Config.getInstance()
WARNING: Please consider reporting this to the maintainers of org.apache.hadoop.security.authentication.util.KerberosUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
17/12/21 15:48:46 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Traceback (most recent call last):
File "C:\spark\spark-2.2.1-bin-hadoop2.7\python\pyspark\shell.py", line 45, in <module>
spark = SparkSession.builder\
File "C:\spark\spark-2.2.1-bin-hadoop2.7\python\pyspark\sql\session.py", line 183, in getOrCreate
session._jsparkSession.sessionState().conf().setConfString(key, value)
File "C:\spark\spark-2.2.1-bin-hadoop2.7\python\lib\py4j-0.10.4-src.zip\py4j\java_gateway.py", line 1133, in __call__
File "C:\spark\spark-2.2.1-bin-hadoop2.7\python\pyspark\sql\utils.py", line 79, in deco
raise IllegalArgumentException(s.split(': ', 1)[1], stackTrace)
pyspark.sql.utils.IllegalArgumentException: u"Error while instantiating 'org.apache.spark.sql.hive.HiveSessionStateBuilder':"
请告知如何解决这些错误
【问题讨论】:
考虑到例外情况,我很确定问题是您在某处有一些与 Hive/Hadoop 相关的配置,而 Spark 显然使用了它。请提供您的火花配置。并且,请格式化您的消息 【参考方案1】:检查您对/tmp/hive/
的权限。使用sudo chmod -R 777 /tmp/hive/
。另外,请检查您是否使用sqlContext
传递查询,否则您可以将其更改为sparkSession
。
【讨论】:
感谢 Subash 的响应,但我不确定在哪里使用上述命令,我已经在 windows 10 机器上配置了 spark,当我调用 pyspark 时,它给了我错误和许多 spark 动作不像 count() 那样工作会给出错误 py4j 错误。 您必须在 CLI 中发出命令。然后停止所有 spark 进程并重新开始,同时检查环境变量以上是关于获取 IllegalArgumentException的主要内容,如果未能解决你的问题,请参考以下文章
插件 [ingest-geoip] 是为 Elasticsearch 6.2.4 版构建的,但 6.5.0 版正在运行