apache / iceberg-rust

Apache Iceberg
https://rust.iceberg.apache.org/
Apache License 2.0
675 stars 159 forks source link

support create partition table for non REST catalog #578

Open FANNG1 opened 3 months ago

FANNG1 commented 3 months ago

The type of partition_spec in TableCreation is UnboundPartitionSpec, it's more dedicated to REST catalog, for non REST catalog seems more general to use PartitionSpec type. like

    let p = PartitionSpecBuilder::new(&table_schema)
        .add_partition_field("a", "bucket_a", Transform::Bucket(16))
        .add_partition_field("b", "b", Transform::Identity)
        .build()

    TableCreation::builder()
         .name(table_id.name.clone())
         .schema(table_schema.clone())
         .partition_spec(p).build()
liurenjie1024 commented 2 months ago

Thanks @FANNG1 for contribution. I've left comments in your pr.