I want to have a table that’s partitioned by the following, in order:

  *   Low-cardinality identity
  *   Day
  *   Bucketed long ID, 16 buckets

Is this possible? If so, how should I do the dataframe write? This is what I’ve 
tried so far:


  1.  df.orderBy(“identity”, 
“day”).sortWithinPartitions(expr(“iceberg_bucket16(id)”))
  2.  df.orderBy(“identity”, “day”, expr(“iceberg_bucket16(id)”))
  3.  df.repartition(“identity”, “day”).sortWithinPartitions(“identity”, “day”, 
expr(“iceberg_bucket16(id)”))
  4.  df.repartition(“identity”,  “day”, “id”).sortWithinPartitions(“identity”, 
“day”, expr(“iceberg_bucket16(id)”))
  5.  df.repartitionByRange(“identity”, “day”).sortWithinPartitions(“identity”, 
“day”, expr(“iceberg_bucket16(id)”))
  6.  df.repartitionByRange(“identity”,  “day”, 
“id”).sortWithinPartitions(“identity”, “day”, expr(“iceberg_bucket16(id)”))

But I keep getting the error indicating that a partition has already been 
closed.

Reply via email to