p1c2u commented on issue #1797:
URL:
https://github.com/apache/iceberg-python/issues/1797#issuecomment-2728701377
I had similar problem when trying to create table with pyarrow schema. You
need to covert the schema into iceberg schema and assign field ids first:
```python
schema_without_ids = _pyarrow_to_schema_without_ids(batches.get_schema())
schema_with_ids = assign_fresh_schema_ids(schema_without_ids)
```
Then you can grab ids to use inside partition spec
```python
event_time_field_id = schema_with_ids.find_field("event_time").field_id
partition_spec = PartitionSpec(PartitionField(
source_id = event_time_field_id,
field_id = 1000,
name="event_date",
transform=DayTransform(),
))
```
--
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]