Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] java.lang.NoSuchMethodError: org.apache.spark.sql.catalyst.TableIdentifier.copy(Ljava/lang/String;Lscala/Option;)Lorg/apache/spark/sql/catalyst/TableIdentifier #3409

Closed
4 tasks
Kosta404 opened this issue Jul 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Kosta404
Copy link

Kosta404 commented Jul 23, 2024

Bug java.lang.NoSuchMethodError: org.apache.spark.sql.catalyst.TableIdentifier.copy(Ljava/lang/String;Lscala/Option;)Lorg/apache/spark/sql/catalyst/TableIdentifier

Which Delta project/connector is this regarding?

  • Spark 3.5.1
  • Hadoop 3.3.5
  • Pyspark 3.5.1
  • Delta lake 3.2.0

Describe the problem

While performing prod_dataframe.write.saveAsTable(PROD_TABLE_NAME, format="delta", mode="overwrite", path=str(PROD_TABLE_PATH))
The following error occurs:
java.lang.NoSuchMethodError: org.apache.spark.sql.catalyst.TableIdentifier.copy(Ljava/lang/String;Lscala/Option;)Lorg/apache/spark/sql/catalyst/TableIdentifier

Steps to reproduce

spark: SparkSession = (
SparkSession.builder.config("spark.sql.extensions", "io.delta.sql.DeltaSparkSessionExtension")
.config("spark.sql.catalog.spark_catalog", "org.apache.spark.sql.delta.catalog.DeltaCatalog")
.config("spark.jars.packages", "io.delta:delta-spark_2.12:3.1.0")
.config("spark.sql.warehouse.dir", f"file:{tmp_dir}/spark-warehouse")
.config("spark.driver.extraJavaOptions", f"-Dderby.system.home={tmp_dir}/derby")
.enableHiveSupport()
.getOrCreate()
)
prod_timestamp = 1625309472.357246
prod_timestamp = datetime.fromtimestamp(prod_timestamp)
prod_timestamp = prod_timestamp.strftime("%d-%m-%Y, %H:%M:%S")
prod_dataframe: DataFrame = spark.createDataFrame(
[
{"id": 1, "name": "Alice", "timestamp": prod_timestamp},
{"id": 3, "name": "Bob", "timestamp": prod_timestamp},
]
)
prod_dataframe.write.saveAsTable(PROD_TABLE_NAME, format="delta", mode="overwrite", path=str(PROD_TABLE_PATH))

Observed results

The error happens during the run of a pytest.

Expected results

Created table.

@Kosta404 Kosta404 added the bug Something isn't working label Jul 23, 2024
@Kosta404 Kosta404 changed the title [BUG] [BUG] java.lang.NoSuchMethodError: org.apache.spark.sql.catalyst.TableIdentifier.copy(Ljava/lang/String;Lscala/Option;)Lorg/apache/spark/sql/catalyst/TableIdentifier Jul 23, 2024
@Kosta404
Copy link
Author

The error wat in the "delta-spark.jar" file.
The correct version for this config is "delta-spark_2.12-3.2.0.jar"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant