Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions web-console/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
insert_final_newline = false

[*.snap]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions web-console/src/druid-models/execution/execution.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ describe('Execution', () => {
)
) EXTEND ("timestamp" VARCHAR, "agent_type" VARCHAR)
PARTITIONED BY ALL TIME",
"sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
Expand Down Expand Up @@ -672,6 +673,7 @@ describe('Execution', () => {
},
"segmentStatus": undefined,
"sqlQuery": undefined,
"sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
Expand Down Expand Up @@ -1156,6 +1158,7 @@ describe('Execution', () => {
"result": undefined,
"segmentStatus": undefined,
"sqlQuery": undefined,
"sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
Expand Down
12 changes: 12 additions & 0 deletions web-console/src/druid-models/execution/execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export interface ExecutionValue {
engine: DruidEngine;
id: string;
sqlQuery?: string;
sqlQueryId?: string;
nativeQuery?: any;
queryContext?: QueryContext;
status?: ExecutionStatus;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -352,6 +352,7 @@ FROM TABLE(
)
) EXTEND ("timestamp" VARCHAR, "agent_type" VARCHAR)
PARTITIONED BY DAY",
"sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
Expand Down Expand Up @@ -994,6 +995,7 @@ FROM TABLE(
)
) EXTEND ("timestamp" VARCHAR, "agent_type" VARCHAR)
PARTITIONED BY DAY",
"sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
Expand Down Expand Up @@ -1681,6 +1683,7 @@ FROM TABLE(
)
) EXTEND ("timestamp" VARCHAR, "agent_type" VARCHAR)
PARTITIONED BY DAY",
"sqlQueryId": undefined,
"stages": Stages {
"counters": {
"0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. I have no strong preference either way, but maybe keeping the "query" context would be good UX?

Suggested change
(SQL ID <Tag minimal>{execution.sqlQueryId}</Tag>)
(SQL QUERY ID <Tag minimal>{execution.sqlQueryId}</Tag>)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to keep the label short, hopefully it's clear enough.

</>
)}
{ingestDatasource && (
<>
{' '}
Expand Down
Loading