Skip to content

Commit 73d9014

Browse files
committed
fix: truncated
1 parent d23d7ea commit 73d9014

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/store/reducers/query/streamingReducers.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,16 @@ export const addStreamingChunks = (state: QueryState, action: PayloadAction<Stre
9595

9696
if (currentMergedChunk) {
9797
currentMergedChunk.result.rows?.push(...(chunk.result.rows || []));
98+
currentMergedChunk.result.truncated =
99+
currentMergedChunk.result.truncated || chunk.result.truncated;
98100
} else {
99101
acc.set(resultIndex, {
100102
...chunk,
101-
result: {...chunk.result, rows: chunk.result.rows || []},
103+
result: {
104+
...chunk.result,
105+
rows: chunk.result.rows || [],
106+
truncated: chunk.result.truncated,
107+
},
102108
});
103109
}
104110
return acc;
@@ -117,6 +123,7 @@ export const addStreamingChunks = (state: QueryState, action: PayloadAction<Stre
117123
] || {
118124
columns: [],
119125
result: [],
126+
truncated: false,
120127
speedMetrics: {
121128
rowsPerSecond: 0,
122129
lastUpdateTime: Date.now(),
@@ -130,7 +137,11 @@ export const addStreamingChunks = (state: QueryState, action: PayloadAction<Stre
130137

131138
const safeRows = rows || [];
132139
const formattedRows = parseResult(safeRows, resultSet.columns || []);
133-
resultSet.result?.push(...formattedRows);
140+
141+
formattedRows.forEach((row) => {
142+
resultSet.result?.push(row);
143+
});
144+
resultSet.truncated = chunk.result.truncated;
134145

135146
if (resultSet.speedMetrics) {
136147
updateSpeedMetrics(resultSet.speedMetrics, totalNewRows);

src/types/store/streaming.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface StreamDataChunk {
2828
result: {
2929
columns?: ColumnType[];
3030
rows: ArrayRow[] | null;
31+
truncated?: boolean;
3132
};
3233
}
3334

0 commit comments

Comments
 (0)