Home / Companies / PostHog / Blog / Post Details
Content Deep Dive

Adventures in null handling: Null money, null problems

Blog post from PostHog

Post Details
Company
Date Published
Author
Marius Andra
Word Count
966
Company Posts That Month
2
Language
-
Hacker News Points
-
Post removed?
No
Summary

Null values posed challenges during the development of HogQL, a tool providing direct SQL access to data, as they resulted in inaccurate results and customer confusion due to ClickHouse's strict handling of nulls, where any expression containing a null value becomes null. Existing solutions for handling nulls in PostHog were inadequate for HogQL's capabilities, as they required users to manually handle nulls, leading to a cumbersome user experience. To address this, the developers implemented several solutions: modifying how the concat function works to be null-tolerant by converting null values to strings, introducing nullish coalescing to simplify expressions, and adding a nullable property on all fields to enable special null handling without disrupting ClickHouse's optimization processes. These changes improved the user experience by abstracting complex SQL modifications away from users, making direct SQL access more user-friendly while preserving the power and flexibility of HogQL.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.