mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
ensure that only one limit is used on query (#1221)
This commit is contained in:
parent
62eddcf20a
commit
b68a4c9b16
4 changed files with 32 additions and 18 deletions
6
.changeset/famous-yaks-cough.md
Normal file
6
.changeset/famous-yaks-cough.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
"@hyperdx/common-utils": patch
|
||||
"@hyperdx/app": patch
|
||||
---
|
||||
|
||||
Tweak getMapKeys to leverage one row limiting implementation
|
||||
|
|
@ -559,10 +559,16 @@ const DBSearchPageFiltersComponent = ({
|
|||
usePinnedFilters(sourceId ?? null);
|
||||
const { width, startResize } = useResizable(16, 'left');
|
||||
|
||||
const { data: jsonColumns } = useJsonColumns(tcFromChartConfig(chartConfig));
|
||||
const { data, isLoading, error } = useAllFields(
|
||||
tcFromChartConfig(chartConfig),
|
||||
);
|
||||
const { data: jsonColumns } = useJsonColumns({
|
||||
databaseName: chartConfig.from.databaseName,
|
||||
tableName: chartConfig.from.tableName,
|
||||
connectionId: chartConfig.connection,
|
||||
});
|
||||
const { data, isLoading, error } = useAllFields({
|
||||
databaseName: chartConfig.from.databaseName,
|
||||
tableName: chartConfig.from.tableName,
|
||||
connectionId: chartConfig.connection,
|
||||
});
|
||||
|
||||
const { data: source } = useSource({ id: sourceId });
|
||||
const { data: tableMetadata } = useTableMetadata(tcFromSource(source));
|
||||
|
|
|
|||
|
|
@ -280,8 +280,9 @@ describe('Metadata', () => {
|
|||
expect(mockClickhouseClient.query).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
clickhouse_settings: {
|
||||
max_rows_to_read: String(3e6),
|
||||
read_overflow_mode: 'break',
|
||||
max_rows_to_read: '0',
|
||||
timeout_overflow_mode: 'break',
|
||||
max_execution_time: 15,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
|
@ -312,8 +313,9 @@ describe('Metadata', () => {
|
|||
expect(mockClickhouseClient.query).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
clickhouse_settings: {
|
||||
max_rows_to_read: String(3e6),
|
||||
read_overflow_mode: 'break',
|
||||
max_rows_to_read: '0',
|
||||
timeout_overflow_mode: 'break',
|
||||
max_execution_time: 15,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -313,12 +313,12 @@ export class Metadata {
|
|||
query_params: sql.params,
|
||||
connectionId,
|
||||
clickhouse_settings: {
|
||||
max_rows_to_read: String(
|
||||
this.getClickHouseSettings().max_rows_to_read ??
|
||||
DEFAULT_METADATA_MAX_ROWS_TO_READ,
|
||||
),
|
||||
read_overflow_mode: 'break',
|
||||
...this.getClickHouseSettings(),
|
||||
// Max 15 seconds to get keys
|
||||
timeout_overflow_mode: 'break',
|
||||
max_execution_time: 15,
|
||||
// Set the value to 0 (unlimited) so that the LIMIT is used instead
|
||||
max_rows_to_read: '0',
|
||||
},
|
||||
})
|
||||
.then(res => res.json<Record<string, unknown>>())
|
||||
|
|
@ -642,12 +642,12 @@ export class Metadata {
|
|||
connectionId: chartConfig.connection,
|
||||
clickhouse_settings: !disableRowLimit
|
||||
? {
|
||||
max_rows_to_read: String(
|
||||
this.getClickHouseSettings().max_rows_to_read ??
|
||||
DEFAULT_METADATA_MAX_ROWS_TO_READ,
|
||||
),
|
||||
read_overflow_mode: 'break',
|
||||
...this.getClickHouseSettings(),
|
||||
// Max 15 seconds to get keys
|
||||
timeout_overflow_mode: 'break',
|
||||
max_execution_time: 15,
|
||||
// Set the value to 0 (unlimited) so that the LIMIT is used instead
|
||||
max_rows_to_read: '0',
|
||||
}
|
||||
: undefined,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue