Repository navigation
Fix geo columns reading in Arrow reader - #103032
Conversation
|
Workflow [PR], commit [14122ed] Summary: ✅ AI ReviewSummaryThis PR fixes geospatial metadata handling in the Arrow IPC reader path by using schema metadata (instead of footer metadata / Final Verdict
|
|
From MAKE_OBSOLETE(M, Bool, input_format_parquet_use_native_reader_v3, true) \The setting is obsolete. That means the code change is not exercised by the test file content. For sanity, I reran the test on master (that does not have this patch), it passed. |
|
Good, than we can close it |
|
Hmm, it may be still relevant for Arrow format, need to check and add a test |
…:ClickHouse/ClickHouse into fix-geo-parquet-2
Arrow IPC stores schema-level metadata in `schema->metadata()`, not in `file_reader->metadata()` (which returns IPC footer custom metadata). The Arrow reader was passing the wrong metadata to `ArrowColumnToCHColumn`, so the `geo` key was never found and geoparquet parsing never activated for Arrow IPC files. Fix `ArrowBlockInputFormat` to pass `schema->metadata()` in both the schema inference and data reading paths. Also fix `readColumnWithGeoData` to use `buffer->data()` instead of `buffer->mutable_data()`, since Arrow IPC buffers are immutable and the data is only read, not modified. Rewrite the test to use Arrow IPC format instead of the removed Arrow-based Parquet reader path. Co-Authored-By: Claude Opus 4.6 <[email protected]>
LLVM Coverage Report
Changed lines: 100.00% (29/29) · Uncovered code |
The test was failing on master (and many open PRs) under sanitizer and S3 builds with both `secret_user sees:` and `admin sees:` returning 0 — i.e. the queued async insert was no longer in `system.asynchronous_inserts` by the time the user-filter `SELECT` queries ran. PR ClickHouse#103032 dropped the `no-parallel` tag added in ClickHouse#100233 on the premise that all unscoped `SYSTEM FLUSH ASYNC INSERT QUEUE` callers were migrated to the table-scoped variant. The premise holds for the tests that *call* flush, but this test does not call flush at all — it relies on the opposite: a pending entry must remain in the queue between `INSERT` and the three subsequent `SELECT` queries. Any concurrent unscoped flush drains it, and even without that there is a residual race in slow CI environments where the entry's visibility through `system.asynchronous_inserts` can lag the client return. Re-add `no-parallel` with a comment that captures the real reason (the test consumes pending state, it does not produce it), disable `async_insert_use_adaptive_busy_timeout` so the per-query 10-minute deadline is honored exactly and `max_busy_timeout_exceeded` cannot force an early flush when the shard has been idle, and poll `system.asynchronous_inserts` for up to 30 seconds before running the user-filter checks so the test fails clean on a real visibility bug instead of racing the queue. CI history: https://play.clickhouse.com/play?user=play#V0lUSAogICAgOTAgQVMgaW50ZXJ2YWxfZGF5cwpTRUxFQ1QKICAgIHRvU3RhcnRPZkRheShjaGVja19zdGFydF90aW1lKSBBUyBkYXksCiAgICBjb3VudCgpIEFTIGZhaWx1cmVzLAogICAgZ3JvdXBVbmlxQXJyYXkocHVsbF9yZXF1ZXN0X251bWJlcikgQVMgcHJzLAogICAgYW55KHJlcG9ydF91cmwpIEFTIHJlcG9ydF91cmwKRlJPTSBjaGVja3MKV0hFUkUgKG5vdygpIC0gdG9JbnRlcnZhbERheShpbnRlcnZhbF9kYXlzKSkgPD0gY2hlY2tfc3RhcnRfdGltZQogICAgQU5EIHRlc3RfbmFtZSA9ICcwNDA0M19zeXN0ZW1fYXN5bmNocm9ub3VzX2luc2VydHNfdXNlcl9maWx0ZXInCiAgICBBTkQgdGVzdF9zdGF0dXMgSU4gKCdGQUlMJywgJ0VSUk9SJykKICAgIEFORCAocHVsbF9yZXF1ZXN0X251bWJlciA9IDAgT1IgYmFzZV9yZWYgSU4gKCdtYXN0ZXInKSkKICAgIEFORCB0ZXN0X2NvbnRleHRfcmF3IExJS0UgJyVyZXN1bHQgZGlmZmVycyB3aXRoIHJlZmVyZW5jZSUnCkdST1VQIEJZIGRheQpPUkRFUiBCWSBkYXkgREVTQwo=
Fix geo columns reading in Arrow reader
The test was failing on master (and many open PRs) under sanitizer and S3 builds with both `secret_user sees:` and `admin sees:` returning 0 — i.e. the queued async insert was no longer in `system.asynchronous_inserts` by the time the user-filter `SELECT` queries ran. PR ClickHouse#103032 dropped the `no-parallel` tag added in ClickHouse#100233 on the premise that all unscoped `SYSTEM FLUSH ASYNC INSERT QUEUE` callers were migrated to the table-scoped variant. The premise holds for the tests that *call* flush, but this test does not call flush at all — it relies on the opposite: a pending entry must remain in the queue between `INSERT` and the three subsequent `SELECT` queries. Any concurrent unscoped flush drains it, and even without that there is a residual race in slow CI environments where the entry's visibility through `system.asynchronous_inserts` can lag the client return. Re-add `no-parallel` with a comment that captures the real reason (the test consumes pending state, it does not produce it), disable `async_insert_use_adaptive_busy_timeout` so the per-query 10-minute deadline is honored exactly and `max_busy_timeout_exceeded` cannot force an early flush when the shard has been idle, and poll `system.asynchronous_inserts` for up to 30 seconds before running the user-filter checks so the test fails clean on a real visibility bug instead of racing the queue. CI history: https://play.clickhouse.com/play?user=play#V0lUSAogICAgOTAgQVMgaW50ZXJ2YWxfZGF5cwpTRUxFQ1QKICAgIHRvU3RhcnRPZkRheShjaGVja19zdGFydF90aW1lKSBBUyBkYXksCiAgICBjb3VudCgpIEFTIGZhaWx1cmVzLAogICAgZ3JvdXBVbmlxQXJyYXkocHVsbF9yZXF1ZXN0X251bWJlcikgQVMgcHJzLAogICAgYW55KHJlcG9ydF91cmwpIEFTIHJlcG9ydF91cmwKRlJPTSBjaGVja3MKV0hFUkUgKG5vdygpIC0gdG9JbnRlcnZhbERheShpbnRlcnZhbF9kYXlzKSkgPD0gY2hlY2tfc3RhcnRfdGltZQogICAgQU5EIHRlc3RfbmFtZSA9ICcwNDA0M19zeXN0ZW1fYXN5bmNocm9ub3VzX2luc2VydHNfdXNlcl9maWx0ZXInCiAgICBBTkQgdGVzdF9zdGF0dXMgSU4gKCdGQUlMJywgJ0VSUk9SJykKICAgIEFORCAocHVsbF9yZXF1ZXN0X251bWJlciA9IDAgT1IgYmFzZV9yZWYgSU4gKCdtYXN0ZXInKSkKICAgIEFORCB0ZXN0X2NvbnRleHRfcmF3IExJS0UgJyVyZXN1bHQgZGlmZmVycyB3aXRoIHJlZmVyZW5jZSUnCkdST1VQIEJZIGRheQpPUkRFUiBCWSBkYXkgREVTQwo=
An `ALTER TABLE ... ADD COLUMN ... ALIAS` (or a `DEFAULT`/`MODIFY` command) whose expression folds to a value that cannot be cast to the column type used to be accepted, but then failed when the table was re-attached, which could block server startup. This was fixed by validating default expressions across all columns at DDL time (PR ClickHouse#103032). Add a stateless test that locks in the fix: the broken `ALTER`/`CREATE` is now rejected up front, the table stays usable after a rejected `ALTER`, and a valid alias survives `DETACH`/`ATTACH`. Closes: ClickHouse#59949 Co-Authored-By: Claude Opus 4.8 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix nullable inference for geo columns in Arrow-based Parquet reader. Closes #101845
Documentation entry for user-facing changes
Version info
26.5.1.921