Skip to content

Implement h3PolygonToCellsWithContainment function - #104455

Merged
alexey-milovidov merged 31 commits into
ClickHouse:masterfrom
yousefQadry:feat/h3-polygon-to-cells-experimental
May 30, 2026
Merged

alexey-milovidov merged 31 commits into
ClickHouse:masterfrom
yousefQadry:feat/h3-polygon-to-cells-experimental

Conversation

@yousefQadry

@yousefQadry yousefQadry commented May 9, 2026 •

Copy link
Copy Markdown
Contributor

Implements #98981

Changelog category (leave one):

  • New Feature

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

You can now use h3PolygonToCellsWithContainment function from h3 to use their new algorithm which supports center-based, fully-contained, and overlapping containment modes.
...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.6.1.267

@CLAassistant

CLAassistant commented May 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@yousefQadry yousefQadry changed the title #98981 Implement h3ToPolygonExperimental function Implement h3ToPolygonExperimental function May 9, 2026
@yousefQadry
yousefQadry force-pushed the feat/h3-polygon-to-cells-experimental branch from f4df459 to bd8b028 Compare May 10, 2026 09:27
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label May 10, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

We will need to come up with a better name than "experimental". While it reflects the current h3 API one-to-one, it will be a problem for us, because the function name will be cemented forever.

@clickhouse-gh

clickhouse-gh Bot commented May 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2ed8e50]

Summary: ✅


AI Review

Summary

This PR adds h3PolygonToCellsWithContainment, exposing H3 containment modes for polygon-to-cell conversion, with docs and focused stateless coverage for mode mapping, invalid flags, empty MultiPolygon, and unsupported geometry kinds. The current code addresses the prior inline issues I rechecked, and I did not find a remaining code-level blocker.

PR Metadata

The New Feature category is appropriate and a changelog entry is required. The entry is present, but it should format the SQL function name as code and describe the user-facing containment behavior more directly.

Suggested replacement:

You can now use h3PolygonToCellsWithContainment to return H3 cells for a polygon using selectable containment modes, including center-based, fully contained, overlapping, and bounding-box overlapping modes.

Findings

💡 Nits

  • [PR description] The changelog entry names h3PolygonToCellsWithContainment without backticks and says "function from h3 to use their new algorithm", which is less clear than the user-facing behavior. Use the replacement text above.
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label May 10, 2026
@yousefQadry

Copy link
Copy Markdown
Contributor Author

We will need to come up with a better name than "experimental". While it reflects the current h3 API one-to-one, it will be a problem for us, because the function name will be cemented forever.

I changed its name to h3PolygonToCellsWithContainment.

@alexey-milovidov

Copy link
Copy Markdown
Member

This was fixed by #105146. Let's update the branch.

@yousefQadry

Copy link
Copy Markdown
Contributor Author

There were some bugs that I fixed after your comment. The PR is ready now.

yousefQadry and others added 5 commits May 20, 2026 15:23
@clickhouse-gh

clickhouse-gh Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.40% 84.40% +0.00%
Functions 91.40% 91.40% +0.00%
Branches 77.00% 76.90% -0.10%

Changed lines: Changed C/C++ lines covered by tests: 145/194 (74.74%) | Lost baseline coverage: none · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov self-assigned this May 30, 2026
@alexey-milovidov alexey-milovidov changed the title Implement h3ToPolygonExperimental function Implement h3PolygonToCellsWithContainment function May 30, 2026
@alexey-milovidov
alexey-milovidov merged commit 803e6ee into ClickHouse:master May 30, 2026
165 of 166 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-feature Pull request with new product 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.

4 participants