Insurance · Reinsurance · Banking · Telecom · Retail · Agriculture — Per-Object API Calls to Per-Cell Scoring with H3 and Native Spatial SQL
By @Phani_sannala, in collaboration with @sridharplv
Your lakehouse already holds the geometry. Why are you shipping it, one object at a time, to someone else's server?
Every data platform I've built has the same embarrassing bottleneck, and it is never the lakehouse.
The ingestion is solved. The Delta tables are clustered. The gold layer refreshes on time. Then somewhere in the middle of the pipeline sits a loop that takes each record, serialises it to JSON, posts it to an external API, waits a quarter of a second, parses the answer, and moves on to the next record. That loop is where the hours go. It is where the 2 AM pages come from. And in most cases, it is doing work your cluster could do faster without leaving the building.
This article is about deleting that loop — or, where you genuinely can't, shrinking it by orders of magnitude. I'll use geospatial hazard scoring as the worked example, because that's where I hit it hardest, but the pattern applies anywhere a pipeline calls an external service once per record.
The problem: one object in, hundreds of rows out
Strip away the industry and the pattern looks like this. You hold a large set of objects with a location — a point, or a polygon. For each one, you call an external service that knows something about that location and returns a block of enriched records. You land those records and aggregate them back to the object.
It shows up everywhere:
• Insurance and reinsurance — scoring buildings, factories, schools and public assets for flood, wildfire, windstorm and earthquake exposure under several climate scenarios.
• Banking — physical climate-risk disclosure on lending portfolios and secured assets.
• Telecom — coverage and signal-propagation scoring for every planned tower site.
• Retail and property — catchment demographics, visitor traffic and competitor density per store or parcel.
• Agriculture — soil, yield and drought indices per field boundary.
• Logistics — risk and ETA enrichment per route segment or depot.
The worked example
I'll use the case I know best: climate and catastrophe hazard scoring for an insurance portfolio. Each risk object is a building, a plant, a school, a hospital — anything that can be insured. It arrives as either a point (an address) or a polygon (a site footprint).
The hazard API takes a coordinate and returns a full hazard cube for it: every peril (flood, coastal surge, wildfire, windstorm, earthquake, heat, drought, hail…) crossed with every climate scenario (the SSP pathways — SSP1-2.6, SSP2-4.5, SSP5-8.5 and friends) crossed with every forecast horizon. In our case that was roughly 400 records per coordinate.
Points are manageable. Polygons are where it detonates. The service doesn't score a polygon as one thing; it resolves the footprint into the coordinates inside it — often 1,000 to 3,000 of them for a large site — and returns 400 records for each.
Do the multiplication
| Input | Coordinates sent | Records returned |
| 1,000 point objects | 1,000 | 400,000 |
| 1,000 polygon objects × 2,000 coords | 2,000,000 | 800,000,000 |