This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch kylin5
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 9cadd4bccd48af4c4ceaf514497d53ad3c1ccdcc
Author: Qian Xia <lauraxiaq...@gmail.com>
AuthorDate: Mon Jun 5 16:26:07 2023 +0800

    KYLIN-5543 validate dimensions
---
 .../common/RecognizeAggregateModal/RecognizeAggregateModal.vue        | 4 ++--
 kystudio/src/components/common/RecognizeAggregateModal/handler.js     | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/kystudio/src/components/common/RecognizeAggregateModal/RecognizeAggregateModal.vue
 
b/kystudio/src/components/common/RecognizeAggregateModal/RecognizeAggregateModal.vue
index c3ab6ac753..8f0928880d 100644
--- 
a/kystudio/src/components/common/RecognizeAggregateModal/RecognizeAggregateModal.vue
+++ 
b/kystudio/src/components/common/RecognizeAggregateModal/RecognizeAggregateModal.vue
@@ -301,8 +301,8 @@
       const dimensions = []
       this.clearupErrors()
       let formattedText = ''
-      for (const text of form.text.replace(/^\n|\n$/g, '').split(/,\n*/g)) {
-        const columnText = text.trim()
+      for (const text of form.text.replace(/\n*/g, '').split(/,\n*/g)) {
+        const columnText = text.trim().toLocaleUpperCase()
         if (columnText) {
           const dimension = modelDimensions.find(d => d.column === columnText)
           if (dimension) {
diff --git a/kystudio/src/components/common/RecognizeAggregateModal/handler.js 
b/kystudio/src/components/common/RecognizeAggregateModal/handler.js
index cf4930ca14..f8cdc0d6e8 100644
--- a/kystudio/src/components/common/RecognizeAggregateModal/handler.js
+++ b/kystudio/src/components/common/RecognizeAggregateModal/handler.js
@@ -69,6 +69,9 @@ export function scrollToLineAndHighlight (editor, line) {
 export function searchColumnInEditor (editor, column) {
   const { $search: editorSearch } = editor
   const session = editor.getSession()
+  column = column.replace(/[\\$|\\/|\\^|\\?]/g, ($1) => {
+    return `\\${$1}`
+  })
 
   editorSearch.setOptions({
     needle: `^${column},\n`,

Reply via email to