kevinjqliu commented on issue #2684:
URL:
https://github.com/apache/iceberg-python/issues/2684#issuecomment-3482701492
hm gotta dig into this a little deeper, like you mentioned, casting the
pa.Table with provided schema works
```
from pyiceberg.catalog import load_catalog
import pyarrow as pa
warehouse_path = "/tmp/warehouse"
catalog = load_catalog(
"default",
**{
'type': 'sql',
"uri": f"sqlite:///{warehouse_path}/pyiceberg_catalog.db",
"warehouse": f"file://{warehouse_path}",
},
)
catalog.create_namespace_if_not_exists("test")
schema = pa.schema({
"id": pa.int64(),
"text": pa.string(),
"map": pa.map_(pa.string(), pa.string())
})
table = catalog.create_table_if_not_exists("test.table", schema)
print("table schema:", table.schema())
print()
data = pa.Table.from_pylist([{"id": 1}], schema=schema)
print("data schema:", data.schema)
print()
table.append(data)
```
--
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]