HonahX commented on PR #363:
URL: https://github.com/apache/iceberg-python/pull/363#issuecomment-2219814347
> Another test with commit.manifest.min-count-to-merge set to 100, and doing
500 append operations:
I think the observed behavior is correct, although far from optimal. Each
time we do one append, we add one manifest. At 100th append, when the number of
manifest reach 100, the merge manager merge all of them to a new manifest file
because they are all in the same "bin". This happens whenever the number of
manifest reach 100, thus leaving us with a large manifest and 4 small ones.
I use spark to do the similar thing and get a similar result
```python
@pytest.mark.integration
def test_spark_ref_behavior(spark: SparkSession, session_catalog: Catalog,
arrow_table_with_null: pa.Table) -> None:
identifier = "default.test_spark_ref_behavior"
tbl = _create_table(session_catalog, identifier,
{"commit.manifest-merge.enabled": "true",
"commit.manifest.min-count-to-merge": "10", "format-version": 2}, [])
spark_df = spark.createDataFrame(arrow_table_with_null.to_pandas())
for i in range(50):
spark_df.writeTo(f"integration.{identifier}").append()
tbl = session_catalog.load_table(identifier)
tbl_a_manifests = tbl.current_snapshot().manifests(tbl.io)
for manifest in tbl_a_manifests:
print(
f"Manifest: added: {manifest.added_files_count}, existing:
{manifest.existing_files_count}, deleted: {manifest.deleted_files_count}")
=====
Manifest: added: 3, existing: 0, deleted: 0
Manifest: added: 3, existing: 0, deleted: 0
Manifest: added: 3, existing: 0, deleted: 0
Manifest: added: 3, existing: 0, deleted: 0
Manifest: added: 3, existing: 135, deleted: 0
```
To distribute manifest entries among manifests, I think we need to adjust
the `commit.manifest.target-size-bytes` accordingly since this property
controls the size of the bin.
--
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]