Skip to content

Can not create table with Spark 2.4 DataFrame #1372

Closed

Description

@jiegzhan

Started spark-shell on EMR (Spark 2.4) with this command:

spark-shell \
  --jars /usr/lib/iceberg/iceberg-spark-runtime-0.9.1.jar \
  --conf spark.sql.catalog.spark_catalog=org.apache.iceberg.spark.SparkSessionCatalog \
  --conf spark.sql.catalog.spark_catalog.type=hive

Create table script failed:

scala> df.
     |   write.
     |   format("iceberg").
     |   mode("overwrite").
     |   save("default.iceberg_test")
org.apache.iceberg.exceptions.NoSuchTableException: Table does not exist: default.iceberg_test
  at org.apache.iceberg.BaseMetastoreCatalog.loadTable(BaseMetastoreCatalog.java:141)
  at org.apache.iceberg.spark.source.IcebergSource.findTable(IcebergSource.java:142)
  at org.apache.iceberg.spark.source.IcebergSource.getTableAndResolveHadoopConfiguration(IcebergSource.java:171)
  at org.apache.iceberg.spark.source.IcebergSource.createWriter(IcebergSource.java:95)
  at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:254)
  at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:228)
  ... 53 elided

On iceberg document website, there's appending and overwriting data with Spark 2.4 DataFrame, but there's no creating table with Spark 2.4 DataFrame.
Screen Shot 2020-08-24 at 2 19 42 PM

Activity

  1. zhangdove commented on Aug 25, 2020

    @zhangdove
    Contributor

    If I understand correctly, Spark 2.4 does not support creating tables in SQL spark guide.

    Maybe you can use the Iceberg API to build table and then write data createTable.

  2. fmouaffo commented on Apr 12, 2022

    @fmouaffo

    If I understand correctly, Spark 2.4 does not support creating tables in SQL spark guide.

    Maybe you can use the Iceberg API to build table and then write data createTable.

    Were you able to use the Iceberg API to build table in a spark 2.4 configuration?

  3. Fokko commented on Sep 27, 2023

    @Fokko
    Contributor

    Thanks for raising this. Closing this since Spark 2.4 has been deprecated a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions