From c13a0e672c6976d48bdcd8455f8b92dd9078b27d Mon Sep 17 00:00:00 2001 From: LXW <1264174498@qq.com> Date: Thu, 1 Feb 2024 22:02:37 +0800 Subject: [PATCH] (improvement)(chat) fix HeuristicViewResolver choosing view (#710) Co-authored-by: jolunoluo --- .../chat/core/parser/sql/llm/HeuristicViewResolver.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chat/core/src/main/java/com/tencent/supersonic/chat/core/parser/sql/llm/HeuristicViewResolver.java b/chat/core/src/main/java/com/tencent/supersonic/chat/core/parser/sql/llm/HeuristicViewResolver.java index 591511fa2..ecffef4bd 100644 --- a/chat/core/src/main/java/com/tencent/supersonic/chat/core/parser/sql/llm/HeuristicViewResolver.java +++ b/chat/core/src/main/java/com/tencent/supersonic/chat/core/parser/sql/llm/HeuristicViewResolver.java @@ -122,7 +122,9 @@ public class HeuristicViewResolver implements ViewResolver { } return null; } - matchedViews.retainAll(agentViewIds); + if (CollectionUtils.isNotEmpty(agentViewIds)) { + matchedViews.retainAll(agentViewIds); + } Map viewQueryModes = new HashMap<>(); for (Long viewIds : matchedViews) { viewQueryModes.put(viewIds, null);