Skip to content

Commit e7d7c81

Browse files
Merge branch 'main' into drew/show-pinned-filters-while-loading
2 parents 8a8fe18 + d5a38c3 commit e7d7c81

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.changeset/blue-hairs-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
fix: Fix pattern sample query for sources with multi-column timestamp expressions

packages/app/src/components/PatternSidePanel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
TIMESTAMP_COLUMN_ALIAS,
1414
} from '@/hooks/usePatterns';
1515
import useRowWhere from '@/hooks/useRowWhere';
16+
import { getFirstTimestampValueExpression } from '@/source';
1617
import { useZIndex, ZIndexContext } from '@/zIndex';
1718

1819
import styles from '../../styles/LogSidePanel.module.scss';
@@ -74,7 +75,7 @@ export default function PatternSidePanel({
7475
],
7576
aliasMap: {
7677
body: bodyValueExpression,
77-
ts: source.timestampValueExpression,
78+
ts: getFirstTimestampValueExpression(source.timestampValueExpression),
7879
},
7980
});
8081

packages/app/src/hooks/usePatterns.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
useConfigWithPrimaryAndPartitionKey,
1414
} from '@/components/DBRowTable';
1515
import { useQueriedChartConfig } from '@/hooks/useChartConfig';
16+
import { getFirstTimestampValueExpression } from '@/source';
1617

1718
// We don't want to load pyodide over and over again, use react query to cache the async instance
1819
function usePyodide(options: { enabled: boolean }) {
@@ -131,7 +132,7 @@ function usePatterns({
131132
// TODO: User-configurable pattern columns and non-pattern/group by columns
132133
select: [
133134
`${bodyValueExpression} as ${PATTERN_COLUMN_ALIAS}`,
134-
`${config.timestampValueExpression} as ${TIMESTAMP_COLUMN_ALIAS}`,
135+
`${getFirstTimestampValueExpression(config.timestampValueExpression)} as ${TIMESTAMP_COLUMN_ALIAS}`,
135136
...(severityTextExpression
136137
? [`${severityTextExpression} as ${SEVERITY_TEXT_COLUMN_ALIAS}`]
137138
: []),

0 commit comments

Comments
 (0)