This is an automated email from the ASF dual-hosted git repository.
gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new d383fac0b69 Console: Show Dart sqlQueryId in details pane. (#19185)
d383fac0b69 is described below
commit d383fac0b692a04b20280891096dbf200594f38d
Author: Gian Merlino <[email protected]>
AuthorDate: Fri Mar 20 08:31:37 2026 -0700
Console: Show Dart sqlQueryId in details pane. (#19185)
Show both the unique execution ID (dartQueryId) and the potentially
sqlQueryId. This is useful when the sqlQueryId is user-provided and
meaningful, and is also useful for correlating with SQL query logs.
---
web-console/.editorconfig | 3 +++
web-console/src/druid-models/execution/execution.spec.ts | 3 +++
web-console/src/druid-models/execution/execution.ts | 12 ++++++++++++
.../execution-details-pane-loader.tsx | 4 +++-
.../__snapshots__/execution-details-pane.spec.tsx.snap | 5 ++++-
.../execution-details-pane/execution-details-pane.tsx | 8 +++++++-
6 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/web-console/.editorconfig b/web-console/.editorconfig
index 217a0a23608..6ee43ffa701 100644
--- a/web-console/.editorconfig
+++ b/web-console/.editorconfig
@@ -11,3 +11,6 @@ insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
insert_final_newline = false
+
+[*.snap]
+trim_trailing_whitespace = false
diff --git a/web-console/src/druid-models/execution/execution.spec.ts
b/web-console/src/druid-models/execution/execution.spec.ts
index 15dc15bf8eb..62ad7b3d8b1 100644
--- a/web-console/src/druid-models/execution/execution.spec.ts
+++ b/web-console/src/druid-models/execution/execution.spec.ts
@@ -295,6 +295,7 @@ describe('Execution', () => {
)
) EXTEND ("timestamp" VARCHAR, "agent_type" VARCHAR)
PARTITIONED BY ALL TIME",
+ "sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
@@ -672,6 +673,7 @@ describe('Execution', () => {
},
"segmentStatus": undefined,
"sqlQuery": undefined,
+ "sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
@@ -1156,6 +1158,7 @@ describe('Execution', () => {
"result": undefined,
"segmentStatus": undefined,
"sqlQuery": undefined,
+ "sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
diff --git a/web-console/src/druid-models/execution/execution.ts
b/web-console/src/druid-models/execution/execution.ts
index b4fc89fa025..148c3048c24 100644
--- a/web-console/src/druid-models/execution/execution.ts
+++ b/web-console/src/druid-models/execution/execution.ts
@@ -176,6 +176,7 @@ export interface ExecutionValue {
engine: DruidEngine;
id: string;
sqlQuery?: string;
+ sqlQueryId?: string;
nativeQuery?: any;
queryContext?: QueryContext;
status?: ExecutionStatus;
@@ -396,6 +397,7 @@ export class Execution {
public readonly engine: DruidEngine;
public readonly id: string;
public readonly sqlQuery?: string;
+ public readonly sqlQueryId?: string;
public readonly nativeQuery?: any;
public readonly queryContext?: QueryContext;
public readonly status?: ExecutionStatus;
@@ -419,6 +421,7 @@ export class Execution {
this.id = value.id;
if (!this.id) throw new Error('must have an id');
this.sqlQuery = value.sqlQuery;
+ this.sqlQueryId = value.sqlQueryId;
this.nativeQuery = value.nativeQuery;
this.queryContext = value.queryContext;
this.status = value.status;
@@ -443,6 +446,7 @@ export class Execution {
engine: this.engine,
id: this.id,
sqlQuery: this.sqlQuery,
+ sqlQueryId: this.sqlQueryId,
nativeQuery: this.nativeQuery,
queryContext: this.queryContext,
status: this.status,
@@ -486,6 +490,14 @@ export class Execution {
return new Execution(value);
}
+ public changeSqlQueryId(sqlQueryId: string | null | undefined): Execution {
+ if (!sqlQueryId) return this;
+ return new Execution({
+ ...this.valueOf(),
+ sqlQueryId,
+ });
+ }
+
public changeDestination(destination: ExecutionDestination): Execution {
return new Execution({
...this.valueOf(),
diff --git
a/web-console/src/views/workbench-view/execution-details-pane-loader/execution-details-pane-loader.tsx
b/web-console/src/views/workbench-view/execution-details-pane-loader/execution-details-pane-loader.tsx
index 21b48826f75..67bfa882c87 100644
---
a/web-console/src/views/workbench-view/execution-details-pane-loader/execution-details-pane-loader.tsx
+++
b/web-console/src/views/workbench-view/execution-details-pane-loader/execution-details-pane-loader.tsx
@@ -35,7 +35,9 @@ async function getDartExecution(sqlQueryId: string, signal:
AbortSignal): Promis
if (!data.report) throw new Error('Query not started yet');
- return Execution.fromDartReport(data.report).changeSqlQuery(data.query.sql);
+ return Execution.fromDartReport(data.report)
+ .changeSqlQuery(data.query.sql)
+ .changeSqlQueryId(data.query.sqlQueryId);
}
export interface ExecutionDetailsPaneLoaderProps {
diff --git
a/web-console/src/views/workbench-view/execution-details-pane/__snapshots__/execution-details-pane.spec.tsx.snap
b/web-console/src/views/workbench-view/execution-details-pane/__snapshots__/execution-details-pane.spec.tsx.snap
index eff030e9654..c4a61a71fb0 100644
---
a/web-console/src/views/workbench-view/execution-details-pane/__snapshots__/execution-details-pane.spec.tsx.snap
+++
b/web-console/src/views/workbench-view/execution-details-pane/__snapshots__/execution-details-pane.spec.tsx.snap
@@ -42,7 +42,7 @@ exports[`ExecutionDetailsPane matches snapshot no init tab
1`] = `
className="execution-details-pane-general"
>
<p>
- General info for
+ General info for execution ID:
<Blueprint5.Tag
active={false}
fill={false}
@@ -352,6 +352,7 @@ FROM TABLE(
)
) EXTEND ("timestamp" VARCHAR, "agent_type" VARCHAR)
PARTITIONED BY DAY",
+ "sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
@@ -994,6 +995,7 @@ FROM TABLE(
)
) EXTEND ("timestamp" VARCHAR, "agent_type" VARCHAR)
PARTITIONED BY DAY",
+ "sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
@@ -1681,6 +1683,7 @@ FROM TABLE(
)
) EXTEND ("timestamp" VARCHAR, "agent_type" VARCHAR)
PARTITIONED BY DAY",
+ "sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
diff --git
a/web-console/src/views/workbench-view/execution-details-pane/execution-details-pane.tsx
b/web-console/src/views/workbench-view/execution-details-pane/execution-details-pane.tsx
index 20e5f342eb3..23003eb83d4 100644
---
a/web-console/src/views/workbench-view/execution-details-pane/execution-details-pane.tsx
+++
b/web-console/src/views/workbench-view/execution-details-pane/execution-details-pane.tsx
@@ -70,7 +70,13 @@ export const ExecutionDetailsPane = React.memo(function
ExecutionDetailsPane(
return (
<div className="execution-details-pane-general">
<p>
- General info for <Tag minimal>{execution.id}</Tag>
+ General info for execution ID: <Tag minimal>{execution.id}</Tag>
+ {execution.sqlQueryId && (
+ <>
+ {' '}
+ (SQL ID <Tag minimal>{execution.sqlQueryId}</Tag>)
+ </>
+ )}
{ingestDatasource && (
<>
{' '}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]