rdblue commented on code in PR #8067:
URL: https://github.com/apache/iceberg/pull/8067#discussion_r1282314020
##########
python/dev/provision.py:
##########
@@ -185,3 +185,47 @@
all_types_dataframe.writeTo("default.test_all_types").tableProperty("format-version",
"2").partitionedBy(
"intCol"
).createOrReplace()
+
+for table_name, partition in [
+ ("test_partitioned_by_identity", "ts"),
+ ("test_partitioned_by_years", "years(dt)"),
+ ("test_partitioned_by_months", "months(dt)"),
+ ("test_partitioned_by_days", "days(ts)"),
+ ("test_partitioned_by_hours", "hours(ts)"),
+ ("test_partitioned_by_truncate", "truncate(1, letter)"),
+ ("test_partitioned_by_bucket", "bucket(16, number)"),
+]:
+ spark.sql(
+ f"""
+ CREATE OR REPLACE TABLE default.{table_name} (
+ dt date,
+ ts timestamp,
+ number integer,
+ letter string
+ )
+ USING iceberg;
+ """
+ )
+
+ # Partitioning is not really needed, but there is a bug:
+ # https://github.com/apache/iceberg/pull/7685
+ spark.sql(f"ALTER TABLE default.{table_name} ADD PARTITION FIELD
{partition} AS dt_years")
Review Comment:
`dt_years`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]