Repository navigation
fix(common-utils): apply Map KV items rewrite to SQL filters in $__filters - #3828
Draft
karl-power wants to merge 1 commit into
Draft
karl-power wants to merge 1 commit into
karl-power wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 7f66a72 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
Contributor
E2E Test Results✅ All tests passed • 478 passed • 1 skipped • 1062s
Tests ran across 4 shards in parallel. |
…lters Raw SQL tiles and SQL query dashboard filters expand $__filters through renderFiltersToSql, which never built the KV items lookup, so SQL filters on Map keys kept the Map subscript while Lucene filters got has().
karl-power
force-pushed
the
claude/raw-sql-filters-kv-rewrite
branch
from
November 25, 2026 11:15
1c579cd to
7f66a72
Compare
This branch was successfully deployed
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.
Summary
SQL filters expanded by
$__filtersnow use the KV items text index on Map keys, as Lucene filters in$__filtersand SQL filters on builder tiles already do. Stacked on #3826.renderFiltersToSqlbuilds the KV items lookup and passestype: 'sql'filters throughrewriteSqlFilterWithKvItems, likerenderWheredoes for builder tiles. This covers raw SQL tiles and SQL query dashboard filters (renderSourceFiltersToSql).has(LogAttributeItems, ...)instead oftoString(LogAttributes['k']) = 'v'.$__filtersmust be placed where the source table's columns are visible, since the rewrite references the items ALIAS column. ASELECT *subquery does not expose ALIAS columns, so... FROM (SELECT * FROM logs) WHERE $__filtersnow fails with an unknown identifier. Lucene filters in$__filtersalready have this constraint for exact Map matches, and the builder-to-SQL conversion places$__filterson the source table.How to reproduce
Starting point:
yarn dev, registered and logged in, on this branch's base (#3826) for "before".Before:
SELECT count() FROM $__sourceTable WHERE $__timeFilter(Timestamp) AND $__filters.LogAttributes['teamName'],=, and your team name.$__filterscontainstoString(LogAttributes['teamName']) = '<team>'.On this branch:
$__filterscontainshas(`LogAttributeItems`, concat('teamName', '=', '<team>')), and the tile count is unchanged.References
toString()-wrapped filter keys), fix: apply Map KV text-index rewrite to SQL where and aggCondition #2948 (rewrite for the SQLwhere)