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

NullPointerException when writing to Iceberg table using Spark 3.4.0 #12037

Open
3 tasks done
Bhhsaurabh opened this issue Jan 22, 2025 · 2 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@Bhhsaurabh
Copy link

Apache Iceberg version

1.3.0

Query engine

Spark

Please describe the bug 🐞

When attempting to write data to an Iceberg table using the Spark write API, a NullPointerException is thrown. The job fails immediately after initiating the write operation.
The write operation should complete successfully, persisting the data to the Iceberg table without exceptions.
1. Set up an Iceberg catalog with the following configuration in Spark:
2. spark.sql.catalog.my_catalog = org.apache.iceberg.spark.SparkCatalog
spark.sql.catalog.my_catalog.type = hadoop
spark.sql.catalog.my_catalog.warehouse = s3://my-bucket/my-warehouse
CREATE TABLE my_catalog.default.sample_table (
id INT,
name STRING
) USING iceberg;

import spark.implicits._
val data = Seq((1, "Alice"), (2, "Bob")).toDF("id", "name")
data.writeTo("my_catalog.default.sample_table").append()

java.lang.NullPointerException
at org.apache.iceberg..(:)
at org.apache.spark.sql..(:)
...

Willingness to contribute

  • I can contribute a fix for this bug independently
  • I would be willing to contribute a fix for this bug with guidance from the Iceberg community
  • I cannot contribute a fix for this bug at this time
@Bhhsaurabh Bhhsaurabh added the bug Something isn't working label Jan 22, 2025
@nastra
Copy link
Contributor

nastra commented Jan 22, 2025

@Bhhsaurabh can you please add some additional details like the actual full stack trace so that it's clear where the error is coming from?

@RussellSpitzer
Copy link
Member

As @nastra said without the full trace we can't really say anything about what went wrong.

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

3 participants