From 53aca97ca2149bbbeeb447e9ef760ecf719ede08 Mon Sep 17 00:00:00 2001 From: Bhargav Date: Mon, 4 May 2026 15:12:40 +0530 Subject: [PATCH] fix: default query change when user create schedule pipeline (#11579) --- .../pipeline/NodeForm/ScheduledPipeline.vue | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/web/src/components/pipeline/NodeForm/ScheduledPipeline.vue b/web/src/components/pipeline/NodeForm/ScheduledPipeline.vue index ea3fc36fce..eb501ab663 100644 --- a/web/src/components/pipeline/NodeForm/ScheduledPipeline.vue +++ b/web/src/components/pipeline/NodeForm/ScheduledPipeline.vue @@ -89,7 +89,11 @@ along with this program. If not, see . " > {{ t("search.runQuery") }} - + {{ t("search.selectStreamFirst") }} @@ -1184,7 +1188,8 @@ along with this program. If not, see . data-test="logs-search-no-stream-selected-text" class="text-center col-10 q-mx-none" > - + {{ t("search.noStreamSelectedMessage") }}
. data-test="logs-search-no-stream-selected-text" class="text-center col-10 q-mx-none" > - + {{ t("search.applySearch") }}
@@ -1553,14 +1559,13 @@ watch( ); // Watch for stream name changes and auto-generate query -// Fix for issue #9658: Auto-generate SELECT * query when stream changes watch( () => selectedStreamName.value, (newStreamName, oldStreamName) => { if (newStreamName && oldStreamName && oldStreamName !== newStreamName) { - // Stream changed: Generate new SELECT * query for the new stream + // Stream changed: Generate default query for the new stream if (tab.value === "sql") { - query.value = `SELECT * FROM "${newStreamName}"`; + query.value = `SELECT max(_timestamp) as _timestamp, count(_timestamp) as total_events\nFROM "${newStreamName}"\nGROUP BY histogram(_timestamp)`; updateQueryValue(query.value); } else if (tab.value === "promql") { query.value = `${newStreamName}{}`; @@ -1569,7 +1574,7 @@ watch( } else if (!oldStreamName && newStreamName) { // Initial stream selection: Generate default query if (tab.value === "sql" && !query.value.trim()) { - query.value = `SELECT * FROM "${newStreamName}"`; + query.value = `SELECT max(_timestamp) as _timestamp, count(_timestamp) as total_events\nFROM "${newStreamName}"\nGROUP BY histogram(_timestamp)`; updateQueryValue(query.value); } else if (tab.value === "promql" && !query.value.trim()) { query.value = `${newStreamName}{}`;