Repository navigation
fix cast issues - #2474
fix cast issues#2474
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 800a572 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 |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Greptile SummaryThis PR fixes a ClickHouse CAST issue (#2163) where parametric aggregate functions (
Confidence Score: 4/5Safe to merge — the CAST fix is narrowly scoped, the UNSAFE_RAW_SQL escape hatch is gated behind a whitelist-style validator, and the test suite is thorough. The core fix is correct and well-tested. The only concern is the unexplained ORDER BY addition for The ORDER BY change in Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Caller
participant Metadata
participant inlineNonNegativeInt
participant chSql
participant ClickHouse
Caller->>Metadata: "getAllFieldsAndValues({ maxValuesPerKey })"
Metadata->>inlineNonNegativeInt: validate(maxValuesPerKey, 'maxValuesPerKey')
alt invalid (non-int, negative, NaN, etc.)
inlineNonNegativeInt-->>Caller: throws Error (no query fired)
else "valid integer >= 0"
inlineNonNegativeInt-->>chSql: returns "20" (decimal string)
chSql-->>Metadata: SQL with literal groupUniqArray(20)(Value)
Metadata->>ClickHouse: query with inlined literal (no CAST wrapper)
ClickHouse-->>Caller: results
end
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Caller
participant Metadata
participant inlineNonNegativeInt
participant chSql
participant ClickHouse
Caller->>Metadata: "getAllFieldsAndValues({ maxValuesPerKey })"
Metadata->>inlineNonNegativeInt: validate(maxValuesPerKey, 'maxValuesPerKey')
alt invalid (non-int, negative, NaN, etc.)
inlineNonNegativeInt-->>Caller: throws Error (no query fired)
else "valid integer >= 0"
inlineNonNegativeInt-->>chSql: returns "20" (decimal string)
chSql-->>Metadata: SQL with literal groupUniqArray(20)(Value)
Metadata->>ClickHouse: query with inlined literal (no CAST wrapper)
ClickHouse-->>Caller: results
end
Reviews (1): Last reviewed commit: "fix cast issues" | Re-trigger Greptile |
E2E Test Results✅ All tests passed • 198 passed • 3 skipped • 1342s
Tests ran across 4 shards in parallel. |
| AND ${timeFilter} | ||
| GROUP BY ColumnIdentifier, Key | ||
| ORDER BY ColumnIdentifier = 'NativeColumn' DESC, ColumnIdentifier, Key | ||
| ORDER BY ColumnIdentifier = 'NativeColumn' DESC, ColumnIdentifier = 'ResourceAttributes' DESC, ColumnIdentifier, Key |
There was a problem hiding this comment.
Is this change just to surface ResourceAttributes before other columns before hitting the limit?
There was a problem hiding this comment.
Yes, it's not super related to the other changes here but one I keep noticing
Summary
Fixes cast issue reported in #2163
References
Closes #2163