spark3因py4j.protocol.py4jjavaerror而崩溃

ecbunoof  于 2021-07-14  发布在  Spark
关注(0)|答案(1)|浏览(539)

我正在尝试从emr-5.28.0(spark2.4.4)迁移到emr-6.2.0(spark3.0.1),并且spark崩溃的最基本用法无论我做什么。
这是my test\u pyspark.py文件:

from pyspark.sql import SparkSession

spark = SparkSession.builder.getOrCreate()

df = spark.createDataFrame(
    [
        (1, "foo"),  # create your data here, be consistent in the types.
        (2, "bar"),
    ],
    ["id", "label"]  # add your column names here
)

df.printSchema()

我把它上传到s3并使用

spark-submit --deploy-mode cluster s3://<my-s3-bucket>/test_pyspark.py

它崩溃了。
这是容器日志:

Traceback (most recent call last):
  File "test_pyspark.py", line 10, in <module>
    ["id", "label"]  # add your column names here
  File "/mnt/yarn/usercache/hadoop/appcache/application_1618321478998_0009/container_1618321478998_0009_02_000001/pyspark.zip/pyspark/sql/session.py", line 602, in createDataFrame
  File "/mnt/yarn/usercache/hadoop/appcache/application_1618321478998_0009/container_1618321478998_0009_02_000001/pyspark.zip/pyspark/sql/session.py", line 629, in _create_dataframe
  File "/mnt/yarn/usercache/hadoop/appcache/application_1618321478998_0009/container_1618321478998_0009_02_000001/py4j-0.10.9-src.zip/py4j/java_gateway.py", line 1305, in __call__
  File "/mnt/yarn/usercache/hadoop/appcache/application_1618321478998_0009/container_1618321478998_0009_02_000001/pyspark.zip/pyspark/sql/utils.py", line 131, in deco
  File "/mnt/yarn/usercache/hadoop/appcache/application_1618321478998_0009/container_1618321478998_0009_02_000001/py4j-0.10.9-src.zip/py4j/protocol.py", line 328, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o64.applySchemaToPythonRDD.
: java.lang.VerifyError: class org.apache.spark.sql.catalyst.plans.logical.UpdateAction overrides final method children.()Lscala/collection/Seq;
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    at org.apache.spark.sql.execution.SparkSqlParser.<init>(SparkSqlParser.scala:43)
    at org.apache.spark.sql.internal.BaseSessionStateBuilder.sqlParser$lzycompute(BaseSessionStateBuilder.scala:129)
    at org.apache.spark.sql.internal.BaseSessionStateBuilder.sqlParser(BaseSessionStateBuilder.scala:128)
    at org.apache.spark.sql.internal.BaseSessionStateBuilder.build(BaseSessionStateBuilder.scala:329)
    at org.apache.spark.sql.SparkSession$.org$apache$spark$sql$SparkSession$$instantiateSessionState(SparkSession.scala:1107)
    at org.apache.spark.sql.SparkSession.$anonfun$sessionState$2(SparkSession.scala:157)
    at scala.Option.getOrElse(Option.scala:189)
    at org.apache.spark.sql.SparkSession.sessionState$lzycompute(SparkSession.scala:155)
    at org.apache.spark.sql.SparkSession.sessionState(SparkSession.scala:152)
    at org.apache.spark.sql.Dataset$.$anonfun$ofRows$1(Dataset.scala:91)
    at org.apache.spark.sql.SparkSession.withActive(SparkSession.scala:763)
    at org.apache.spark.sql.Dataset$.ofRows(Dataset.scala:90)
    at org.apache.spark.sql.SparkSession.internalCreateDataFrame(SparkSession.scala:553)
    at org.apache.spark.sql.SparkSession.applySchemaToPythonRDD(SparkSession.scala:740)
    at org.apache.spark.sql.SparkSession.applySchemaToPythonRDD(SparkSession.scala:725)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
    at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
    at py4j.Gateway.invoke(Gateway.java:282)
    at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
    at py4j.commands.CallCommand.execute(CallCommand.java:79)
    at py4j.GatewayConnection.run(GatewayConnection.java:238)
    at java.lang.Thread.run(Thread.java:748)

找不到任何关于

class org.apache.spark.sql.catalyst.plans.logical.UpdateAction overrides final method children

所以任何帮助都将非常感激。

bzzcjhmw

bzzcjhmw1#

原来我们有一个旧版本的deltalake核心jar导致了这个问题。
谢谢@stevel,你的评论真的为我指明了正确的方向

相关问题