feat: introduce json filter keys via dynamic column metadata#1260
feat: introduce json filter keys via dynamic column metadata#1260
Conversation
🦋 Changeset detectedLatest commit: 4d36473 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code Review: JSON Filter Keys via Dynamic Column MetadataThanks for this PR! This is an interesting approach to re-enable JSON filter keys by querying ClickHouse system tables instead of scanning the actual data. I've identified several issues and concerns that should be addressed: 🔴 Critical Issues1. Hardcoded Database Name Assumptionconst decodedKey = decodeURIComponent(row.encoded_key);
keys.push({
key: decodedKey.slice(
`${column}.`.length,
decodedKey.lastIndexOf('.dynamic_structure'),
),
chType: 'String',
});Problem: The code assumes the substream format is exactly Recommendation:
2. Incomplete Filter Key Escaping in Frontendkeys: [
key
.split('.')
.map(v => `\`${v}\``)
.join('.'),
],Problem: This escaping logic only handles dots in key names, but doesn't account for:
Recommendation: keys: [
key
.split('.')
.filter(v => v.length > 0) // Filter empty segments
.map(v => `\`${v.replace(/`/g, '\\`')}\``) // Escape existing backticks
.join('.'),
],3. Missing Test CoverageThe Recommendation: Add comprehensive tests covering:
|
E2E Test Results❌ 1 test failed • 23 passed • 3 skipped • 416s
|
|
Closed due to staleness. Please re-open with updates if needed. |
No description provided.