You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/01/26 00:41:39 UTC

[GitHub] [iceberg] kbendick edited a comment on issue #3585: Spark 3.2.0 java.lang.IncompatibleClassChangeError when using IcebergSparkSessionExtensions

kbendick edited a comment on issue #3585:
URL: https://github.com/apache/iceberg/issues/3585#issuecomment-1021743093


   From Spark 3.2, I also used a partitioned table to test dynamic partition overwrite in Spark 3.2
   
   Bash start up script from spark-3.2.0-bin-hadoop3.2:
   ```bash
   mkdir -p /tmp/iceberg/warehouse && ./bin/spark-shell \
   --packages 'org.apache.iceberg:iceberg-spark-runtime-3.2_2.12:0.13.0' \
   --repositories https://repository.apache.org/content/repositories/orgapacheiceberg-1079/  \
   --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \
   --conf spark.sql.catalog.local=org.apache.iceberg.spark.SparkCatalog  \
   --conf spark.sql.catalog.local.type=hadoop \
   --conf spark.sql.catalog.local.warehouse=/tmp/iceberg/warehouse \
   --conf spark.sql.sources.partitionOverwriteMode=dynamic
   ```
   
   Spark Shell:
   ```scala
   scala> spark.sql("CREATE TABLE local.db.table_partitioned (id bigint, data string) USING iceberg partitioned by (id)")
   res6: org.apache.spark.sql.DataFrame = []
   
   scala> spark.sql("show tables in local.db").show
   +---------+-----------------+-----------+
   |namespace|        tableName|isTemporary|
   +---------+-----------------+-----------+
   |       db|table_partitioned|      false|
   |       db|            table|      false|
   +---------+-----------------+-----------+
   
   scala> spark.sql("INSERT INTO local.db.table_partitioned(id, data) VALUES (1, 'Hank'), (2, 'Kyle'), (3, 'Jethro'), (4, 'Russell'), (5, 'Maggie')")
   
   scala> spark.sql("select * from local.db.table_partitioned").show
   +---+-------+
   | id|   data|
   +---+-------+
   |  1|   Hank|
   |  2|   Kyle|
   |  3| Jethro|
   |  4|Russell|
   |  5| Maggie|
   +---+-------+
   
   scala> spark.createDataFrame(Seq((3, "Burt"))).toDF("id", "data").write.mode("overwrite").insertInto("local.db.table_partitioned")
   
   scala> spark.sql("select * from local.db.table_partitioned order by id").show
   +---+-------+
   | id|   data|
   +---+-------+
   |  1|   Hank|
   |  2|   Kyle|
   |  3|   Burt|
   |  4|Russell|
   |  5| Maggie|
   +---+-------+
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org