fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
import { useCallback, useState } from 'react';
|
2025-09-17 19:58:45 +00:00
|
|
|
import { useQueryState } from 'nuqs';
|
|
|
|
|
import { ClickHouseQueryError } from '@hyperdx/common-utils/dist/clickhouse';
|
|
|
|
|
import {
|
2026-03-05 20:30:58 +00:00
|
|
|
BuilderChartConfigWithDateRange,
|
2025-09-17 19:58:45 +00:00
|
|
|
TSource,
|
|
|
|
|
} from '@hyperdx/common-utils/dist/types';
|
2025-10-07 15:35:42 +00:00
|
|
|
import { SortingState } from '@tanstack/react-table';
|
2025-09-17 19:58:45 +00:00
|
|
|
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
import { RowWhereResult, WithClause } from '@/hooks/useRowWhere';
|
2025-09-17 19:58:45 +00:00
|
|
|
import { useSource } from '@/source';
|
|
|
|
|
import TabBar from '@/TabBar';
|
|
|
|
|
import { useLocalStorage } from '@/utils';
|
2026-03-04 20:34:56 +00:00
|
|
|
import { parseAsStringEncoded } from '@/utils/queryParsers';
|
2025-09-17 19:58:45 +00:00
|
|
|
|
2026-01-12 18:09:42 +00:00
|
|
|
import { useNestedPanelState } from './ContextSidePanel';
|
2025-09-17 19:58:45 +00:00
|
|
|
import { RowDataPanel } from './DBRowDataPanel';
|
|
|
|
|
import { RowOverviewPanel } from './DBRowOverviewPanel';
|
|
|
|
|
import DBRowSidePanel, {
|
|
|
|
|
RowSidePanelContext,
|
|
|
|
|
RowSidePanelContextProps,
|
|
|
|
|
} from './DBRowSidePanel';
|
|
|
|
|
import { BreadcrumbEntry } from './DBRowSidePanelHeader';
|
2026-01-14 17:23:21 +00:00
|
|
|
import { DBRowTableVariant, DBSqlRowTable } from './DBRowTable';
|
2025-09-17 19:58:45 +00:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
sourceId: string;
|
2026-03-05 20:30:58 +00:00
|
|
|
config: BuilderChartConfigWithDateRange;
|
2025-09-17 19:58:45 +00:00
|
|
|
onError?: (error: Error | ClickHouseQueryError) => void;
|
|
|
|
|
onScroll?: (scrollTop: number) => void;
|
|
|
|
|
onSidebarOpen?: (rowId: string) => void;
|
|
|
|
|
onExpandedRowsChange?: (hasExpandedRows: boolean) => void;
|
|
|
|
|
onPropertyAddClick?: (keyPath: string, value: string) => void;
|
|
|
|
|
context?: RowSidePanelContextProps;
|
|
|
|
|
enabled?: boolean;
|
|
|
|
|
isLive?: boolean;
|
|
|
|
|
queryKeyPrefix?: string;
|
|
|
|
|
denoiseResults?: boolean;
|
|
|
|
|
collapseAllRows?: boolean;
|
|
|
|
|
isNestedPanel?: boolean;
|
|
|
|
|
breadcrumbPath?: BreadcrumbEntry[];
|
2025-10-07 15:35:42 +00:00
|
|
|
onSortingChange?: (v: SortingState | null) => void;
|
|
|
|
|
initialSortBy?: SortingState;
|
2026-01-14 17:23:21 +00:00
|
|
|
variant?: DBRowTableVariant;
|
2025-09-17 19:58:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function DBSqlRowTableWithSideBar({
|
|
|
|
|
sourceId,
|
|
|
|
|
config,
|
|
|
|
|
onError,
|
|
|
|
|
onScroll,
|
|
|
|
|
context,
|
|
|
|
|
onExpandedRowsChange,
|
|
|
|
|
denoiseResults,
|
|
|
|
|
collapseAllRows,
|
|
|
|
|
isLive,
|
|
|
|
|
enabled,
|
|
|
|
|
isNestedPanel,
|
|
|
|
|
breadcrumbPath,
|
|
|
|
|
onSidebarOpen,
|
2025-10-07 15:35:42 +00:00
|
|
|
onSortingChange,
|
|
|
|
|
initialSortBy,
|
2026-01-14 17:23:21 +00:00
|
|
|
variant,
|
2025-09-17 19:58:45 +00:00
|
|
|
}: Props) {
|
|
|
|
|
const { data: sourceData } = useSource({ id: sourceId });
|
2026-03-04 20:34:56 +00:00
|
|
|
const [rowId, setRowId] = useQueryState('rowWhere', parseAsStringEncoded);
|
2025-12-12 21:52:10 +00:00
|
|
|
const [rowSource, setRowSource] = useQueryState('rowSource');
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
const [aliasWith, setAliasWith] = useState<WithClause[]>([]);
|
2026-01-12 18:09:42 +00:00
|
|
|
const { setContextRowId, setContextRowSource } = useNestedPanelState();
|
2025-09-17 19:58:45 +00:00
|
|
|
|
|
|
|
|
const onOpenSidebar = useCallback(
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
(rowWhere: RowWhereResult) => {
|
|
|
|
|
setRowId(rowWhere.where);
|
|
|
|
|
setAliasWith(rowWhere.aliasWith);
|
2025-09-17 19:58:45 +00:00
|
|
|
setRowSource(sourceId);
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
onSidebarOpen?.(rowWhere.where);
|
2025-09-17 19:58:45 +00:00
|
|
|
},
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
[setRowId, setAliasWith, setRowSource, sourceId, onSidebarOpen],
|
2025-09-17 19:58:45 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const onCloseSidebar = useCallback(() => {
|
|
|
|
|
setRowId(null);
|
|
|
|
|
setRowSource(null);
|
2026-01-12 18:09:42 +00:00
|
|
|
// When closing the main drawer, clear the nested panel state
|
|
|
|
|
// this ensures that re-opening the main drawer will not open the nested panel
|
|
|
|
|
if (!isNestedPanel) {
|
|
|
|
|
setContextRowId(null);
|
|
|
|
|
setContextRowSource(null);
|
|
|
|
|
}
|
|
|
|
|
}, [
|
|
|
|
|
setRowId,
|
|
|
|
|
setRowSource,
|
|
|
|
|
isNestedPanel,
|
|
|
|
|
setContextRowId,
|
|
|
|
|
setContextRowSource,
|
|
|
|
|
]);
|
2025-10-27 14:53:18 +00:00
|
|
|
const renderRowDetails = useCallback(
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
(r: { id: string; aliasWith?: WithClause[]; [key: string]: unknown }) => {
|
2025-10-27 14:53:18 +00:00
|
|
|
if (!sourceData) {
|
|
|
|
|
return <div className="p-3 text-muted">Loading...</div>;
|
|
|
|
|
}
|
|
|
|
|
return (
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
<RowOverviewPanelWrapper
|
|
|
|
|
source={sourceData}
|
|
|
|
|
rowId={r.id}
|
|
|
|
|
aliasWith={r.aliasWith}
|
|
|
|
|
/>
|
2025-10-27 14:53:18 +00:00
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
[sourceData],
|
|
|
|
|
);
|
2025-09-17 19:58:45 +00:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<RowSidePanelContext.Provider value={context ?? {}}>
|
2025-12-12 21:52:10 +00:00
|
|
|
{sourceData && (rowSource === sourceId || !rowSource) && (
|
2025-09-17 19:58:45 +00:00
|
|
|
<DBRowSidePanel
|
|
|
|
|
source={sourceData}
|
|
|
|
|
rowId={rowId ?? undefined}
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
aliasWith={aliasWith}
|
2025-09-17 19:58:45 +00:00
|
|
|
isNestedPanel={isNestedPanel}
|
|
|
|
|
breadcrumbPath={breadcrumbPath}
|
|
|
|
|
onClose={onCloseSidebar}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
<DBSqlRowTable
|
|
|
|
|
config={config}
|
|
|
|
|
sourceId={sourceId}
|
|
|
|
|
onRowDetailsClick={onOpenSidebar}
|
|
|
|
|
highlightedLineId={rowId ?? undefined}
|
|
|
|
|
enabled={enabled}
|
|
|
|
|
isLive={isLive ?? true}
|
|
|
|
|
queryKeyPrefix={'dbSqlRowTable'}
|
2025-10-07 15:35:42 +00:00
|
|
|
onSortingChange={onSortingChange}
|
2025-09-17 19:58:45 +00:00
|
|
|
denoiseResults={denoiseResults}
|
2025-10-07 15:35:42 +00:00
|
|
|
initialSortBy={initialSortBy}
|
2025-10-27 14:53:18 +00:00
|
|
|
renderRowDetails={renderRowDetails}
|
2025-09-17 19:58:45 +00:00
|
|
|
onScroll={onScroll}
|
|
|
|
|
onError={onError}
|
|
|
|
|
onExpandedRowsChange={onExpandedRowsChange}
|
|
|
|
|
collapseAllRows={collapseAllRows}
|
2026-01-14 17:23:21 +00:00
|
|
|
variant={variant}
|
2025-09-17 19:58:45 +00:00
|
|
|
/>
|
|
|
|
|
</RowSidePanelContext.Provider>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum InlineTab {
|
|
|
|
|
Overview = 'overview',
|
|
|
|
|
ColumnValues = 'columnValues',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function RowOverviewPanelWrapper({
|
|
|
|
|
source,
|
|
|
|
|
rowId,
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
aliasWith,
|
2025-09-17 19:58:45 +00:00
|
|
|
}: {
|
|
|
|
|
source: TSource;
|
|
|
|
|
rowId: string;
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
aliasWith?: WithClause[];
|
2025-09-17 19:58:45 +00:00
|
|
|
}) {
|
|
|
|
|
// Use localStorage to persist the selected tab
|
|
|
|
|
const [activeTab, setActiveTab] = useLocalStorage<InlineTab>(
|
|
|
|
|
'hdx-expanded-row-default-tab',
|
|
|
|
|
InlineTab.ColumnValues,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="position-relative">
|
2025-11-14 18:01:54 +00:00
|
|
|
<div className="px-3 pt-2 position-relative">
|
2025-09-17 19:58:45 +00:00
|
|
|
<TabBar
|
|
|
|
|
className="fs-8"
|
|
|
|
|
items={[
|
|
|
|
|
{
|
|
|
|
|
text: 'Overview',
|
|
|
|
|
value: InlineTab.Overview,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
text: 'Column Values',
|
|
|
|
|
value: InlineTab.ColumnValues,
|
|
|
|
|
},
|
|
|
|
|
]}
|
|
|
|
|
activeItem={activeTab}
|
|
|
|
|
onClick={setActiveTab}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-11-14 18:01:54 +00:00
|
|
|
<div>
|
2025-09-17 19:58:45 +00:00
|
|
|
{activeTab === InlineTab.Overview && (
|
|
|
|
|
<div className="inline-overview-panel">
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
<RowOverviewPanel
|
|
|
|
|
source={source}
|
|
|
|
|
rowId={rowId}
|
|
|
|
|
aliasWith={aliasWith}
|
|
|
|
|
/>
|
2025-09-17 19:58:45 +00:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
{activeTab === InlineTab.ColumnValues && (
|
fix: bypass aliasWith so that useRowWhere works correctly (#1623)
Revisit the bug fix for https://github.com/hyperdxio/hyperdx/pull/1614.
The alias map should be used in useRowWhere hook
Ref: HDX-3196
Example:
For select
```
Timestamp,ServiceName,SeverityText,Body AS b, concat(b, 'blabla')
```
The generated query from useRowWhere is
```
WITH (Body) AS b
SELECT
*,
Timestamp AS "__hdx_timestamp",
Body AS "__hdx_body",
TraceId AS "__hdx_trace_id",
SpanId AS "__hdx_span_id",
SeverityText AS "__hdx_severity_text",
ServiceName AS "__hdx_service_name",
ResourceAttributes AS "__hdx_resource_attributes",
LogAttributes AS "__hdx_event_attributes"
FROM
DEFAULT.otel_logs
WHERE
(
Timestamp = parseDateTime64BestEffort('2026-01-20T06:11:00.170000000Z', 9)
AND ServiceName = 'hdx-oss-dev-api'
AND SeverityText = 'info'
AND Body = 'Received alert metric [saved_search source]'
AND concat(b, 'blabla') = 'Received alert metric [saved_search source]blabla'
AND TimestampTime = parseDateTime64BestEffort('2026-01-20T06:11:00Z', 9)
)
LIMIT
1
```
2026-01-21 22:21:40 +00:00
|
|
|
<RowDataPanel source={source} rowId={rowId} aliasWith={aliasWith} />
|
2025-09-17 19:58:45 +00:00
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|