Last active
December 27, 2023 21:50
-
-
Save jzhuge/c213ecb0b798a6770c09aa26908bda8e to your computer and use it in GitHub Desktop.
Writing to iceberg table with sort order after coalesce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Parsed Logical Plan == | |
OverwriteByExpression RelationV2[id#61L] prodhive.jzhuge.wso_244_so_1633558130, true, Map(matchByName -> true), true | |
+- Repartition 4, false | |
+- Sort [id#3L ASC NULLS FIRST], true | |
+- Project [id#0L AS id#3L] | |
+- Range (0, 100000, step=1, splits=Some(6)) | |
== Analyzed Logical Plan == | |
OverwriteByExpression RelationV2[id#61L] prodhive.jzhuge.wso_244_so_1633558130, true, Map(matchByName -> true), true | |
+- Repartition 4, false | |
+- Sort [id#3L ASC NULLS FIRST], true | |
+- Project [id#0L AS id#3L] | |
+- Range (0, 100000, step=1, splits=Some(6)) | |
== Optimized Logical Plan == | |
OverwriteByExpression RelationV2[id#61L] prodhive.jzhuge.wso_244_so_1633558130, true, Map(matchByName -> true), true, IcebergWrite schema=struct<id: bigint not null>, format=parquet | |
+- Sort [id#0L ASC NULLS FIRST], false | |
+- RepartitionByExpression [id#0L ASC NULLS FIRST], 500 | |
+- Repartition 4, false | |
+- Range (0, 100000, step=1, splits=Some(6)) | |
== Physical Plan == | |
OverwriteByExpression prodhive.jzhuge.wso_244_so_1633558130, [AlwaysTrue()], org.apache.spark.sql.util.CaseInsensitiveStringMap@7bdc4108, true, IcebergOverwriteByFilter(table=prodhive.jzhuge.wso_244_so_1633558130, format=PARQUET, filter=true) | |
+- *(2) Sort [id#0L ASC NULLS FIRST], false, 0 | |
+- Exchange rangepartitioning(id#0L ASC NULLS FIRST, 500) | |
+- Coalesce 4 | |
+- *(1) Range (0, 100000, step=1, splits=6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Parsed Logical Plan == | |
OverwritePartitionsDynamic RelationV2[id#77L, part#78L] prodhive.jzhuge.wso_244_so_part_1633558130, Map(matchByName -> true), true | |
+- Repartition 4, false | |
+- Project [id#3L, (id#3L % cast(2 as bigint)) AS part#65L] | |
+- Sort [id#3L ASC NULLS FIRST], true | |
+- Project [id#0L AS id#3L] | |
+- Range (0, 100000, step=1, splits=Some(6)) | |
== Analyzed Logical Plan == | |
OverwritePartitionsDynamic RelationV2[id#77L, part#78L] prodhive.jzhuge.wso_244_so_part_1633558130, Map(matchByName -> true), true | |
+- Repartition 4, false | |
+- Project [id#3L, (id#3L % cast(2 as bigint)) AS part#65L] | |
+- Sort [id#3L ASC NULLS FIRST], true | |
+- Project [id#0L AS id#3L] | |
+- Range (0, 100000, step=1, splits=Some(6)) | |
== Optimized Logical Plan == | |
OverwritePartitionsDynamic RelationV2[id#77L, part#78L] prodhive.jzhuge.wso_244_so_part_1633558130, Map(matchByName -> true), true, IcebergWrite schema=struct<id: bigint not null,part: bigint>, format=parquet | |
+- Sort [part#65L ASC NULLS FIRST, id#0L ASC NULLS FIRST], false | |
+- RepartitionByExpression [part#65L ASC NULLS FIRST, id#0L ASC NULLS FIRST], 500 | |
+- Repartition 4, false | |
+- Project [id#0L, (id#0L % 2) AS part#65L] | |
+- Range (0, 100000, step=1, splits=Some(6)) | |
== Physical Plan == | |
OverwritePartitionsDynamic prodhive.jzhuge.wso_244_so_part_1633558130, org.apache.spark.sql.util.CaseInsensitiveStringMap@7bdc4108, IcebergDynamicOverwrite(table=prodhive.jzhuge.wso_244_so_part_1633558130, format=PARQUET) | |
+- *(2) Sort [part#65L ASC NULLS FIRST, id#0L ASC NULLS FIRST], false, 0 | |
+- Exchange rangepartitioning(part#65L ASC NULLS FIRST, id#0L ASC NULLS FIRST, 500) | |
+- Coalesce 4 | |
+- *(1) Project [id#0L, (id#0L % 2) AS part#65L] | |
+- *(1) Range (0, 100000, step=1, splits=6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spark-sql> SHOW TBLPROPERTIES jzhuge.wso_244_so_1633558130; | |
sort-order id ASC NULLS FIRST | |
format iceberg/parquet | |
current-snapshot-id 1949824784145854272 | |
provider iceberg | |
write.distribution-mode none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spark-sql> SHOW TBLPROPERTIES jzhuge.wso_244_so_part_1633558130; | |
current-snapshot-id 6079782482913875055 | |
format iceberg/parquet | |
sort-order part ASC NULLS FIRST, id ASC NULLS FIRST | |
provider iceberg | |
write.distribution-mode none |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment