fix(common-utils): map NULL-literal SELECT aliases - #2881
Draft
teeohhem wants to merge 1 commit into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 56d0557 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Greptile SummaryThe PR preserves
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/common-utils/src/clickhouse/index.ts | Maps aliased NULL-literal AST expressions to the SQL literal NULL, covering both normal and fallback parsing through the shared helper. |
| packages/common-utils/src/tests/clickhouse.test.ts | Verifies that a NULL padding column and a normal column alias are both preserved in the alias map. |
| .changeset/null-literal-select-alias.md | Correctly records the common-utils behavior fix as a patch release. |
Reviews (2): Last reviewed commit: "fix(common-utils): map NULL-literal SELE..." | Re-trigger Greptile
Contributor
E2E Test Results✅ All tests passed • 281 passed • 1 skipped • 1129s
Tests ran across 4 shards in parallel. |
This was referenced Aug 12, 2026
`chSqlToAliasMap` walks the parsed SELECT and records each alias against the expression behind it. A NULL literal (`NULL AS "x"`) parses without a source location, so it fell through every branch and was dropped from the map. Callers then treated the alias as a real column: the row-identity WHERE builder, for instance, emitted `x = ...` against a column that does not exist rather than `isNull(NULL)`.
teeohhem
force-pushed
the
tom/n1-null-alias
branch
from
August 12, 2026 19:14
997b6b2 to
56d0557
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A column projected as
NULL AS "alias"was dropped from the SELECT alias map, because a NULL literal parses without a source location and fell through every branch. Callers that resolve a result column back to its source expression then treated the alias as a real table column — the row-identity WHERE builder emitted a predicate against a column that doesn't exist instead ofisNull(NULL).Found while building multi-source search, where a source that lacks a field projects it as NULL, but the bug is independent of that work and this fixes it on its own.