0

我正在尝试从 emr-5.28.0(spark 2.4.4) 迁移到 emr-6.2.0(spark 3.0.1),无论我做什么,spark 的最基本用法都会崩溃。

这是我的 test_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

因此,任何帮助将不胜感激。

4

1 回答 1

0

原来我们有一个导致问题的旧版本的 DeltaLake-core jar。

谢谢@stevel,您的评论确实为我指明了正确的方向

于 2021-04-14T17:50:35.703 回答