Closed sanyogitaranade closed 4 months ago
ResponseJSON is defined as
export interface ResponseJSON<T = unknown> { data: Array<T>; query_id?: string; totals?: Record<string, number>; ... }
But, during our testing we observed that totals values can be "string/boolean" (possibly other data types) too. Here is one such response fragment.
{ "meta": [ { "name": "totalCount", "type": "UInt64" }, { "name": "seqID", "type": "UInt32" }, { "name": "eventHref", "type": "String" }, { "name": "ip", "type": "String" }, { "name": "userID", "type": "String" }, { "name": "userName", "type": "String" }, { "name": "userEmail", "type": "String" }, { "name": "userIsAnonymous", "type": "Nullable(Bool)" }, ], "data": [ { "totalCount": "1", "seqID": 6, "eventHref": "href1", "ip": "::1", "userID": "1", "userName": "Jane Doe", "userEmail": "", "userIsAnonymous": false, } ], "totals": { "totalCount": "1", "seqID": 6, "eventHref": "href1", "ip": "::1", "userID": "1", "userName": "Jane Doe", "userEmail": "", "userIsAnonymous": false, }, "rows": 1, "rows_before_limit_at_least": 1, "statistics": { "elapsed": 0.1502299, "rows_read": 69487, "bytes_read": 6324936 } }
data: Array<T>; query_id?: string; totals?: T;
const { stream, query_id } = await this.client.exec({ query: finalQuery, }); const rs = new ResultSet<'JSON'>(stream, 'JSON', query_id); const decoded = await rs.json<Result>();
CREATE TABLE
Fixed in 1.1.0.
Describe the bug
ResponseJSON is defined as
But, during our testing we observed that totals values can be "string/boolean" (possibly other data types) too. Here is one such response fragment.
Expected behaviour
Code example
Error log
Configuration
Environment
ClickHouse server
CREATE TABLE
statements for tables involved: