Fokko opened a new issue, #1567:
URL: https://github.com/apache/iceberg-rust/issues/1567
### Apache Iceberg Rust version
0.5.1 (latest version)
### Describe the bug
When creating a partitioned table:
```rust
let schema = Schema::builder()
.with_schema_id(1)
.with_fields(vec![
NestedField::optional(1, "ts",
Type::Primitive(PrimitiveType::Timestamp)).into(),
])
.build()
.unwrap();
let partition_spec = UnboundPartitionSpec::builder()
.add_partition_field(1, "day", Transform::Day)
.unwrap()
.with_spec_id(0)
.build();
let table_creation = TableCreation::builder()
.name("test_append_date_partition_data_file".to_string())
.schema(schema.clone())
.partition_spec_opt(Some(partition_spec))
.build();
let table = rest_catalog
.create_table(ns.name(), table_creation)
.await
.unwrap();
```
I get the following error from the [`iceberg-rest-fixture` docker
container](https://github.com/apache/iceberg/blob/main/docker/iceberg-rest-fixture/README.md):
```
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 com.fasterxml.jackson.databind.JsonMappingException: Cannot
parse to an integer value: field-id: null (through reference chain:
org.apache.iceberg.rest.requests.CreateTableRequest["partition-spec"])</title>
</head>
<body><h2>HTTP ERROR 500
com.fasterxml.jackson.databind.JsonMappingException: Cannot parse to an integer
value: field-id: null (through reference chain:
org.apache.iceberg.rest.requests.CreateTableRequest["partition-spec"])</h2>
<table>
<tr><th>URI:</th><td>/v1/namespaces/591d3547-d420-426d-8f5a-6d9966b90a44/tables</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>com.fasterxml.jackson.databind.JsonMappingException:
Cannot parse to an integer value: field-id: null (through reference chain:
org.apache.iceberg.rest.requests.CreateTableRequest["partition-spec"])</td></tr>
<tr><th>SERVLET:</th><td>org.apache.iceberg.rest.RESTCatalogServlet-5c30a9b0</td></tr>
```
I noticed that by default the field-IDs are `None`:
https://github.com/apache/iceberg-rust/blob/195fb739da1a01e028a537e8a8b9e4e07ee144fa/crates/iceberg/src/spec/partition.rs#L296-L310
Should we assign them from `1000` and then increment?
I think the current API is confusing and will require users to assign
field-IDs which is not super friendly. Thoughts @Xuanwo @liurenjie1024 @c-thiel
?
### To Reproduce
_No response_
### Expected behavior
_No response_
### Willingness to contribute
None
--
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]