diff --git a/src/containers/Tenant/Query/QueryResult/QueryResultViewer.tsx b/src/containers/Tenant/Query/QueryResult/QueryResultViewer.tsx index 475c4c366..68db21a22 100644 --- a/src/containers/Tenant/Query/QueryResult/QueryResultViewer.tsx +++ b/src/containers/Tenant/Query/QueryResult/QueryResultViewer.tsx @@ -107,7 +107,7 @@ export function QueryResultViewer({ }); const [useShowPlanToSvg] = useSetting(USE_SHOW_PLAN_SVG_KEY); - const {error, isLoading, queryId, data = {}, isStreaming} = result; + const {error, isLoading, queryId, data = {}} = result; const {preparedPlan, simplifiedPlan, stats, resultSets, ast} = data; React.useEffect(() => { @@ -321,7 +321,7 @@ export function QueryResultViewer({ {renderRightControls()} {isLoading || isQueryCancelledError(error) ? null : } - + {renderResultSection()} diff --git a/src/store/reducers/query/query.ts b/src/store/reducers/query/query.ts index 5c47df3fa..d6c0bd093 100644 --- a/src/store/reducers/query/query.ts +++ b/src/store/reducers/query/query.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-param-reassign */ import {createSlice} from '@reduxjs/toolkit'; import type {PayloadAction} from '@reduxjs/toolkit'; @@ -130,19 +131,15 @@ const slice = createSlice({ setQueryHistoryFilter: (state, action: PayloadAction) => { state.history.filter = action.payload; }, - setStreamingState: (state, action: PayloadAction) => { - if (state.result) { - state.result.isStreaming = action.payload; - if (action.payload) { - state.result.data = prepareQueryData(null); - } - } - }, addStreamingChunk: (state, action: PayloadAction) => { - if (!state.result?.isStreaming || !state.result.data) { + if (!state.result) { return; } + if (!state.result.data) { + state.result.data = prepareQueryData(null); + } + const chunk = action.payload; if (isSessionChunk(chunk)) { @@ -173,7 +170,6 @@ const slice = createSlice({ } } } else if (isQueryResponseChunk(chunk)) { - state.result.isStreaming = false; state.result.isLoading = false; if (state.result.data) { @@ -216,7 +212,6 @@ export const { goToNextQuery, setTenantPath, setQueryHistoryFilter, - setStreamingState, addStreamingChunk, } = slice.actions; @@ -251,7 +246,6 @@ export const queryApi = api.injectEndpoints({ {signal, dispatch}, ) => { dispatch(setQueryResult({type: 'execute', queryId, isLoading: true})); - dispatch(setStreamingState(true)); const {action, syntax} = getActionAndSyntaxFromQueryMode( 'execute', @@ -278,7 +272,7 @@ export const queryApi = api.injectEndpoints({ timeout: isNumeric(querySettings.timeout) ? Number(querySettings.timeout) * 1000 : undefined, - output_chunk_max_size: 10000, + output_chunk_max_size: 1000, }, { signal, diff --git a/src/store/reducers/query/types.ts b/src/store/reducers/query/types.ts index cc06e4f87..1e2acf319 100644 --- a/src/store/reducers/query/types.ts +++ b/src/store/reducers/query/types.ts @@ -55,7 +55,6 @@ export interface QueryResult { isTraceReady?: true; queryId: string; isLoading: boolean; - isStreaming?: boolean; } export interface QueryState {