File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,12 +14,20 @@ pub struct QueryResponse {
1414
1515/// Convert the SDK's inline `QueryResponse` (200 path) into the CLI's display
1616/// model. The async path decodes Arrow instead (see `fetch_arrow_result`).
17+ ///
18+ /// `row_count` is derived from `rows.len()` — the rows actually carried in this
19+ /// body — rather than the deprecated SDK `row_count` field. This path only ever
20+ /// renders the rows it holds: a non-truncated response carries the whole result,
21+ /// and the truncated-without-`result_id` fallback keeps just the preview (with a
22+ /// warning). A truncated result that *can* be fetched never reaches here — it's
23+ /// followed to the full set via Arrow in `resolve_inline`. So counting the held
24+ /// rows can never overstate or understate what the user sees.
1725fn query_response_from_sdk ( resp : hotdata:: models:: QueryResponse ) -> QueryResponse {
1826 QueryResponse {
1927 result_id : resp. result_id . flatten ( ) ,
2028 columns : resp. columns ,
29+ row_count : resp. rows . len ( ) as u64 ,
2130 rows : resp. rows ,
22- row_count : resp. row_count . max ( 0 ) as u64 ,
2331 execution_time_ms : Some ( resp. execution_time_ms . max ( 0 ) as u64 ) ,
2432 warning : resp. warning . flatten ( ) ,
2533 }
You can’t perform that action at this time.
0 commit comments