fix: disable search around for aggregation query (#7441)

This commit is contained in:
Bhargav
2025-07-03 16:48:01 +05:30
committed by GitHub
parent ab5c296f50
commit 471f6ee7a0
2 changed files with 16 additions and 4 deletions
+7 -1
View File
@@ -2247,6 +2247,11 @@ const useLogs = () => {
}
}
}
if(searchObj.data.query.toLowerCase().includes("group by")) {
return true;
}
return false; // No aggregation function or non-null groupby property found
}
@@ -6621,7 +6626,8 @@ const useLogs = () => {
getStream,
initialLogsState,
clearSearchObj,
setCommunicationMethod
setCommunicationMethod,
hasAggregation,
};
};
+9 -3
View File
@@ -288,7 +288,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div
v-show="
streamType !== 'enrichment_tables' &&
searchObj.data.stream.selectedStream.length <= 1
searchObj.data.stream.selectedStream.length <= 1 &&
hasAggregationQuery == false
"
class="col-8 row justify-center align-center q-gutter-sm"
>
@@ -335,7 +336,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</template>
<script lang="ts">
import { defineComponent, ref, onBeforeMount } from "vue";
import { defineComponent, ref, onBeforeMount, computed } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { useStore } from "vuex";
@@ -414,9 +415,13 @@ export default defineComponent({
const selectedRelativeValue = ref("10");
const recordSizeOptions: any = ref([10, 20, 50, 100, 200, 500, 1000]);
const shouldWrapValues: any = ref(true);
const { searchObj } = useLogs();
const { searchObj, fnParsedSQL, hasAggregation } = useLogs();
const $q = useQuasar();
let multiStreamFields: any = ref([]);
let hasAggregationQuery: any = computed(() => {
let parsedSQL = fnParsedSQL();
return hasAggregation(parsedSQL?.columns);
});
onBeforeMount(() => {
if (window.localStorage.getItem("wrap-log-details") === null) {
@@ -493,6 +498,7 @@ export default defineComponent({
searchObj,
multiStreamFields,
viewTrace,
hasAggregationQuery,
};
},
async created() {