Skip to content

Support geotypes for iceberg - #103113

Merged
scanhex12 merged 9 commits into
ClickHouse:masterfrom
scanhex12:iceberg_geo_types
May 3, 2026
Merged

scanhex12 merged 9 commits into
ClickHouse:masterfrom
scanhex12:iceberg_geo_types

Conversation

@scanhex12

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Experimental Feature

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Support geotypes for iceberg

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh

clickhouse-gh Bot commented Apr 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c794a22]

Summary: ❌

job_name test_name status info comment
Upgrade check (amd_release) FAIL
Error message in clickhouse-server.log (see upgrade_error_messages.txt) FAIL
Performance Comparison (arm_release, master_head, 5/6) FAIL
logical_functions_medium #0::old FAIL query history
logical_functions_medium #0::new FAIL query history
logical_functions_small #9::old FAIL query history
logical_functions_small #9::new FAIL query history
logical_functions_small #11::old FAIL query history
logical_functions_small #11::new FAIL query history
logical_functions_small #12::old FAIL query history
logical_functions_small #12::new FAIL query history
logical_functions_small #13::old FAIL query history
logical_functions_small #13::new FAIL query history
2 more test cases not shown
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/check_report_messages.py FAIL

AI Review

Summary

This PR adds geometry/geography support for Iceberg by mapping them to ClickHouse Geometry, updating Iceberg/Parquet read-write paths, and adding integration coverage. The implementation is close, but there are still gate-consistency regressions across DataLake entry points that must be fixed before merge.

Findings
  • ❌ Blockers
    • [src/Databases/DataLake/RestCatalog.cpp:913] RestCatalog still constructs IcebergSchemaProcessor without threading allow_experimental_geo_types_in_iceberg. As a result, REST-catalog Iceberg tables reject geo types even when the setting is enabled, creating inconsistent behavior across Iceberg access paths.
    • [src/Storages/ObjectStorage/DataLakes/Iceberg/SchemaProcessor.h:98, src/Databases/DataLake/Common.cpp:109-110] getSimpleType still defaults allow_geo_parser to true, and DataLake::getType calls it without passing the setting. This bypasses the experimental gate and allows geo type parsing where it should remain gated.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ⚠️ Iceberg schema/type parsing paths remain inconsistent across entry points due incomplete setting threading.
No test removal ✅
Experimental gate ❌ allow_experimental_geo_types_in_iceberg is not enforced consistently (RestCatalog and DataLake::getType path).
No magic constants ✅
Backward compatibility ⚠️ Behavior differs by access path for the same table depending on how schema is loaded.
SettingsChangesHistory.cpp ✅
PR metadata quality ✅
Safe rollout ⚠️ Inconsistent gating makes rollout behavior unpredictable in mixed catalog usage.
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    1. Thread allow_experimental_geo_types_in_iceberg into RestCatalog when constructing IcebergSchemaProcessor.
    2. Remove the permissive default from IcebergSchemaProcessor::getSimpleType (or set it to false) and pass the gate explicitly from DataLake::getType call sites.

@clickhouse-gh clickhouse-gh Bot added the pr-experimental Experimental Feature label Apr 19, 2026
bool hasClickhouseTableSchemaById(Int32 id) const;

static DataTypePtr getSimpleType(const String & type_name);
static DataTypePtr getSimpleType(const String & type_name, bool allow_geo_parser = true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSimpleType still defaults allow_geo_parser to true, so any call site that does not thread the new setting will parse geometry/geography as Geometry even when allow_experimental_geo_types_in_iceberg=0. One concrete path is DataLake::getType in src/Databases/DataLake/Common.cpp, which calls IcebergSchemaProcessor::getSimpleType(name) without the flag.

Please make the default false (or remove the default and require explicit opt-in at every call site) so the experimental gate is enforced consistently.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, maybe set default to false. @scanhex12 wdyt?

@SmitaRKulkarni SmitaRKulkarni self-assigned this Apr 22, 2026

@SmitaRKulkarni SmitaRKulkarni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI fails looks relevant, rest all LGTM

Comment thread src/Core/Settings.cpp Resolved
auto table_path = configuration->getPathForRead().path;
return PersistentTableComponents{
.schema_processor = std::make_shared<IcebergSchemaProcessor>(),
.schema_processor = std::make_shared<IcebergSchemaProcessor>(context_->getSettingsRef()[Setting::allow_experimental_geo_types_in_iceberg]),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wires allow_experimental_geo_types_in_iceberg for the IcebergMetadata path, but RestCatalog still constructs IcebergSchemaProcessor() without threading the same setting (src/Databases/DataLake/RestCatalog.cpp, around line 913).

As a result, Iceberg tables reached via REST catalog ignore the session setting and keep rejecting geometry/geography even when the feature is explicitly enabled. Please pass context->getSettingsRef()[Setting::allow_experimental_geo_types_in_iceberg] there as well so behavior is consistent across Iceberg entry points.

@scanhex12
scanhex12 enabled auto-merge May 3, 2026 04:48
@clickhouse-gh

clickhouse-gh Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.00% 84.00% +0.00%
Functions 91.10% 91.10% +0.00%
Branches 76.60% 76.50% -0.10%

Changed lines: 43.23% (83/192) | lost baseline coverage: 7 line(s) · Uncovered code

Full report · Diff report

@scanhex12
scanhex12 added this pull request to the merge queue May 3, 2026
Merged via the queue into ClickHouse:master with commit e7d46c6 May 3, 2026
161 of 165 checks passed
@scanhex12
scanhex12 deleted the iceberg_geo_types branch May 3, 2026 06:47
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 3, 2026
@subkanthi subkanthi mentioned this pull request Sep 16, 2026
11 of 17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-experimental Experimental Feature pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants