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

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


The following commit(s) were added to refs/heads/kylin5 by this push:
     new 8f7807fb0e KYLIN-5993 Internal table For website
8f7807fb0e is described below

commit 8f7807fb0e7dead034a204978c826fffd25d3886
Author: jlf <[email protected]>
AuthorDate: Wed Feb 19 15:17:37 2025 +0800

    KYLIN-5993 Internal table For website
---
 .gitignore                                         |   2 +
 .../components/layout/layout_left_right_top.vue    |   4 +-
 kystudio/src/components/monitor/batchJobs/jobs.vue |   6 +-
 .../src/components/monitor/batchJobs/locales.js    |   1 +
 kystudio/src/components/query/query_history.vue    |   2 +-
 .../InternalTable/DataManagement/LoadData.vue      |  25 ++++-
 .../components/studio/InternalTable/List/index.vue |  11 ++
 .../InternalTable/Setting/InternalTableSetting.vue | 125 +++++++++++----------
 .../studio/InternalTable/Setting/locales.js        |   4 +-
 9 files changed, 107 insertions(+), 73 deletions(-)

diff --git a/.gitignore b/.gitignore
index c53cc1e7d8..9d89616a52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -94,6 +94,8 @@ build/lib
 build/kybot
 build/tpch-benchmark
 build/spark
+build/gluten
+build/libasyncProfiler*
 
 *.tgz
 *.tar.gz
diff --git a/kystudio/src/components/layout/layout_left_right_top.vue 
b/kystudio/src/components/layout/layout_left_right_top.vue
index 6278e288ef..332be06a92 100644
--- a/kystudio/src/components/layout/layout_left_right_top.vue
+++ b/kystudio/src/components/layout/layout_left_right_top.vue
@@ -339,9 +339,9 @@ export default class LayoutLeftRightTop extends Vue {
       case 'streamingjob':
         return this.availableMenus.includes(menuName.toLowerCase()) && 
this.$store.state.system.streamingEnabled === 'true'
       case 'ddl':
-        return this.availableMenus.includes(menuName.toLowerCase()) && 
this.$store.state.system.ddlEnabled === 'true' && 
!this.currentSelectedProjectInternalTableEnabled
+        return this.availableMenus.includes(menuName.toLowerCase()) && 
this.$store.state.system.ddlEnabled === 'true'
       case 'logicalView':
-        return this.availableMenus.includes(menuName.toLowerCase()) && 
this.$store.state.system.logicalViewEnabled === 'true' && 
!this.currentSelectedProjectInternalTableEnabled
+        return this.availableMenus.includes(menuName.toLowerCase()) && 
this.$store.state.system.logicalViewEnabled === 'true'
       default:
         return this.availableMenus.includes(menuName.toLowerCase())
     }
diff --git a/kystudio/src/components/monitor/batchJobs/jobs.vue 
b/kystudio/src/components/monitor/batchJobs/jobs.vue
index 9d3b021927..3d38693df1 100644
--- a/kystudio/src/components/monitor/batchJobs/jobs.vue
+++ b/kystudio/src/components/monitor/batchJobs/jobs.vue
@@ -85,8 +85,8 @@
                 <common-tip :content="$t('snapshotDisableTips')" 
v-if="['SNAPSHOT_BUILD', 'SNAPSHOT_REFRESH'].includes(scope.row.job_name) && 
!scope.row.target_subject_error && 
!$store.state.project.snapshot_manual_management_enabled">
                   <span class="is-disabled">{{scope.row.target_subject}}</span>
                 </common-tip>
-                <a class="link" v-if="scope.row.job_name === null" 
@click="gotoInternalTableList(scope.row)">{{scope.row.target_subject}}</a>
-                <a class="link" v-if="scope.row.job_name !== null && 
!tableJobTypes.includes(scope.row.job_name) && !scope.row.target_subject_error" 
@click="gotoModelList(scope.row)">{{scope.row.target_subject}}</a>
+                <a class="link" v-if="['INTERNAL_TABLE_BUILD', 
'INTERNAL_TABLE_REFRESH'].includes(scope.row.job_name)" 
@click="gotoInternalTableList(scope.row)">{{scope.row.target_subject}}</a>
+                <a class="link" 
v-else-if="!tableJobTypes.includes(scope.row.job_name) && 
!scope.row.target_subject_error" 
@click="gotoModelList(scope.row)">{{scope.row.target_subject}}</a>
               </p>
             </template>
           </el-table-column>
@@ -443,7 +443,7 @@ export default class JobsList extends Vue {
   jobsList = []
   jobTotal = 0
   allStatus = ['PENDING', 'RUNNING', 'FINISHED', 'ERROR', 'DISCARDED', 
'STOPPED']
-  jobTypeFilteArr = ['INDEX_REFRESH', 'INDEX_MERGE', 'INDEX_BUILD', 
'INC_BUILD', 'TABLE_SAMPLING', 'SNAPSHOT_BUILD', 'SNAPSHOT_REFRESH', 
'SUB_PARTITION_BUILD', 'SUB_PARTITION_REFRESH', 'EXPORT_TO_SECOND_STORAGE', 
'SECOND_STORAGE_NODE_CLEAN', 'SECOND_STORAGE_MODEL_CLEAN', 
'SECOND_STORAGE_SEGMENT_CLEAN', 'SECOND_STORAGE_INDEX_CLEAN', 
'SECOND_STORAGE_REFRESH_SECONDARY_INDEXES', 'LAYOUT_DATA_OPTIMIZE', 
'INTERNAL_TABLE_BUILD']
+  jobTypeFilteArr = ['INDEX_REFRESH', 'INDEX_MERGE', 'INDEX_BUILD', 
'INC_BUILD', 'TABLE_SAMPLING', 'SNAPSHOT_BUILD', 'SNAPSHOT_REFRESH', 
'SUB_PARTITION_BUILD', 'SUB_PARTITION_REFRESH', 'EXPORT_TO_SECOND_STORAGE', 
'SECOND_STORAGE_NODE_CLEAN', 'SECOND_STORAGE_MODEL_CLEAN', 
'SECOND_STORAGE_SEGMENT_CLEAN', 'SECOND_STORAGE_INDEX_CLEAN', 
'SECOND_STORAGE_REFRESH_SECONDARY_INDEXES', 'LAYOUT_DATA_OPTIMIZE', 
'INTERNAL_TABLE_BUILD', 'INTERNAL_TABLE_REFRESH']
   tableJobTypes = ['TABLE_SAMPLING', 'SNAPSHOT_BUILD', 'SNAPSHOT_REFRESH', 
'SECOND_STORAGE_NODE_CLEAN']
   delSecJobTypes = ['SECOND_STORAGE_NODE_CLEAN', 'SECOND_STORAGE_MODEL_CLEAN', 
'SECOND_STORAGE_SEGMENT_CLEAN', 'SECOND_STORAGE_INDEX_CLEAN']
   otherJobTypes = ['SECOND_STORAGE_REFRESH_SECONDARY_INDEXES']
diff --git a/kystudio/src/components/monitor/batchJobs/locales.js 
b/kystudio/src/components/monitor/batchJobs/locales.js
index a9c3a46226..5e24c81e91 100644
--- a/kystudio/src/components/monitor/batchJobs/locales.js
+++ b/kystudio/src/components/monitor/batchJobs/locales.js
@@ -77,6 +77,7 @@ export default {
     SUB_PARTITION_BUILD: 'Build Sub-partitions Data',
     SNAPSHOT_BUILD: 'Build Snapshot',
     INTERNAL_TABLE_BUILD: 'Load internal table',
+    INTERNAL_TABLE_REFRESH: 'Refresh internal table',
     LAYOUT_DATA_OPTIMIZE: 'Storage Optimization',
     clearUpIntermediateTable: 'Garbage CleanUp',
     project: 'Project',
diff --git a/kystudio/src/components/query/query_history.vue 
b/kystudio/src/components/query/query_history.vue
index c3e08503ff..efa7233c82 100644
--- a/kystudio/src/components/query/query_history.vue
+++ b/kystudio/src/components/query/query_history.vue
@@ -123,7 +123,7 @@ import { pageRefTags, apiUrl, bigPageCount } from 'config'
       exportSqlTitle: 'Export SQL',
       exportHistoryTips: '{maxLength} query histories could be exported at a 
time. If you want to export more. Check ',
       userManual: 'User Manual',
-      manualUrl: 'https://kylin.apache.org/5.0/docs/query/history',
+      manualUrl: 'https://kylin.apache.org/docs/query/history/query_history',
       exportHistoryTips2: ' for details.',
       exportSqlConfirm: '<b>{historyTotal}</b> SQL(s) will be exported as a 
.txt file. Are you sure you want to export?',
       exportHistoryConfirm: '<b>{historyTotal}</b> query historie(s) will be 
exported as a .csv file. Are you sure you want to export?'
diff --git 
a/kystudio/src/components/studio/InternalTable/DataManagement/LoadData.vue 
b/kystudio/src/components/studio/InternalTable/DataManagement/LoadData.vue
index 835c4d68d1..b977bea79d 100644
--- a/kystudio/src/components/studio/InternalTable/DataManagement/LoadData.vue
+++ b/kystudio/src/components/studio/InternalTable/DataManagement/LoadData.vue
@@ -1,6 +1,6 @@
 <template>
-  <div><el-form :model="ruleForm" :rules="rules" ref="ruleForm">
-    <el-tabs v-model="activeTab" type="card" class="internal-table-load-data">
+  <div class="internal-table-load-data"><el-form :model="ruleForm" 
:rules="rules" ref="ruleForm">
+    <el-tabs v-model="activeTab" type="card">
       <el-tab-pane name="append" :disabled="!tableInfo.date_partition_format">
         <span slot="label">{{$t('loadModelAppend')}}</span>
         <div>
@@ -52,8 +52,8 @@
       </el-tab-pane>
       <el-tab-pane name="full">
         <span slot="label">{{$t('loadModelFull')}}</span>
-        <div>
-          <div class="sub-title">{{$t('partitionOptionsTitle')}}</div>
+        <div class="full-load-partition">
+          <div 
class="sub-title"><span>{{$t('partitionOptionsTitle')}}</span></div>
           <div>
             <el-select v-model="tableInfo.time_partition_col" 
class='max-width' disabled>
               <el-option
@@ -203,7 +203,20 @@ export default class LoadData extends Vue {
 }
 </script>
 <style lang="less">
-  .internal-table-load-data .el-tabs__content {
-    overflow: visible;
+  .internal-table-load-data {
+    .el-tabs__content {
+      overflow: visible;
+    }
+    .full-load-partition {
+      display: flex;
+      align-items: center;
+
+      .sub-title {
+        padding-right: 8px;
+      }
+    }
+    .dialog-footer {
+      text-align: right;
+    }
   }
 </style>
diff --git a/kystudio/src/components/studio/InternalTable/List/index.vue 
b/kystudio/src/components/studio/InternalTable/List/index.vue
index 142553422b..0426fe7eca 100644
--- a/kystudio/src/components/studio/InternalTable/List/index.vue
+++ b/kystudio/src/components/studio/InternalTable/List/index.vue
@@ -222,6 +222,16 @@ export default class InternalTableList extends Vue {
         tableInfo.project = this.currentSelectedProject
         tableInfo.time_partition_col = row.time_partition_col
         tableInfo.date_partition_format = row.date_partition_format
+        tableInfo.bucket_column = row.tbl_properties.bucketCol
+        tableInfo.bucket_num = parseInt(row.tbl_properties.bucketNum)
+        const orderByArray = row.tbl_properties.orderByKey ? 
row.tbl_properties.orderByKey.split(',') : []
+        const primaryKeyArray = row.tbl_properties.primaryKey ? 
row.tbl_properties.primaryKey.split(',') : []
+        const tableAttributes = (tableInfo && tableInfo.columns) ? 
tableInfo.columns.map(c => ({ name: c.name, primaryKey: 
primaryKeyArray.includes(c.name), sortByKey: orderByArray.includes(c.name) })) 
: []
+        tableInfo.table_attributes = tableAttributes.sort((a, b) => {
+          const indexA = orderByArray.indexOf(a.name)
+          const indexB = orderByArray.indexOf(b.name)
+          return (indexA === -1 ? Infinity : indexA) - (indexB === -1 ? 
Infinity : indexB)
+        })
         this.currentEditTableInfo = tableInfo
       }
     })
@@ -324,6 +334,7 @@ export default class InternalTableList extends Vue {
         project: this.currentSelectedProject
       }).finally(() => {
         this.somethingLoading = false
+        this._getInternalTables(this.internalTableListPageOffset, 
this.internalTableListPageLimit)
       })
     })
   }
diff --git 
a/kystudio/src/components/studio/InternalTable/Setting/InternalTableSetting.vue 
b/kystudio/src/components/studio/InternalTable/Setting/InternalTableSetting.vue
index 53d69a5dbe..8e3188e372 100644
--- 
a/kystudio/src/components/studio/InternalTable/Setting/InternalTableSetting.vue
+++ 
b/kystudio/src/components/studio/InternalTable/Setting/InternalTableSetting.vue
@@ -22,7 +22,7 @@
               </el-select>
             </div>
           </el-col>
-          <el-col :span="8" v-show="doesPartionColumnNeedDateFormatter">
+          <el-col :span="8" v-show="ruleForm.partitionColumn">
             <div class="sub-title">{{$t('timePartitionFormatTitle')}}</div>
             <div>
               <el-form-item prop="timePartitionFormat">
@@ -165,12 +165,14 @@ import { timePartitionFormatOptions } from '../const'
       return (this.tableInfo.columns ? this.tableInfo.columns.filter(c => 
c.name !== this.ruleForm.partitionColumn).map(c => ({ label: c.name, value: 
c.name })) : [])
     },
     doesPartionColumnNeedDateFormatter () {
-      const column = this.tableInfo.columns && this.tableInfo.columns.find(c 
=> c.name === this.ruleForm.partitionColumn)
-      return column && column.datatype === 'date'
+      // const column = this.tableInfo.columns && 
this.tableInfo.columns.find(c => c.name === this.ruleForm.partitionColumn)
+      // return column && column.datatype === 'date'
+      return true
     },
     rules () {
       return {
-        timePartitionFormat: { required: 
this.doesPartionColumnNeedDateFormatter, message: 
this.$t('validateErrorSelect'), trigger: 'change' },
+        // timePartitionFormat: { required: 
this.doesPartionColumnNeedDateFormatter, message: 
this.$t('validateErrorSelect'), trigger: 'change' },
+        timePartitionFormat: { required: false, message: 
this.$t('validateErrorSelect'), trigger: 'change' },
         bucketCount: [
           { required: !!this.bucketColumn, trigger: 'blur' },
           { type: 'number', message: this.$t('validateErrorNumber'), min: 1, 
max: 5000, trigger: 'blur' }
@@ -202,7 +204,11 @@ export default class InternalTableSetting extends Vue {
   tableAttributes = this.getTableAttributesFromTableInfo()
 
   getTableAttributesFromTableInfo () {
-    return (this.tableInfo && this.tableInfo.columns) ? 
this.tableInfo.columns.map(c => ({ name: c.name, primaryKey: false, sortByKey: 
false })) : []
+    if (this.tableInfo) {
+      if (this.tableInfo.table_attributes) return 
this.tableInfo.table_attributes
+      if (this.tableInfo.columns) return this.tableInfo.columns.map(c => ({ 
name: c.name, primaryKey: false, sortByKey: false }))
+    }
+    return []
   }
 
   @Watch('tableInfo')
@@ -211,9 +217,9 @@ export default class InternalTableSetting extends Vue {
       this.tableAttributes = this.getTableAttributesFromTableInfo()
       this.ruleForm.partitionColumn = this.tableInfo.time_partition_col || ''
       this.ruleForm.timePartitionFormat = this.tableInfo.date_partition_format 
|| ''
-      this.ruleForm.bucketColumn = ''
-      this.ruleForm.bucketCount = 1
-      this.ruleForm.selectedTableAttributeKeys = []
+      this.ruleForm.bucketColumn = this.tableInfo.bucket_column || ''
+      this.ruleForm.bucketCount = this.tableInfo.bucket_num || 1
+      this._sortTableAttributes()
       this.selectTableAttributeKeys = false
     }
   }
@@ -225,7 +231,7 @@ export default class InternalTableSetting extends Vue {
       this.ruleForm.bucketColumn = ''
       this.ruleForm.bucketCount = 1
     }
-    this.tableAttributes = this.tableAttributes.filter(a => a.name !== newVal)
+    this.tableAttributes = this.getTableAttributesFromTableInfo().filter(a => 
a.name !== newVal)
     this._sortTableAttributes()
   }
 
@@ -318,57 +324,58 @@ export default class InternalTableSetting extends Vue {
     .el-dialog {
       width: @dialog-width;
     }
-  }
-  .with-selector {
-    padding-right: @dialog-width;
-  }
-  .el-dialog__body {
-    scrollbar-gutter: stable;
-  }
-  .internal-table-container {
-    margin: 32px 24px 24px;
-  }
-  .split-block {
-    margin-top: 24px;
-  }
-  .sub-title {
-    margin-bottom: 8px;
-  }
-  .table-attribute-selector {
-    position: absolute;
-    bottom: 0;
-    right: -@dialog-width - 12px;
-    width: @dialog-width;
-    box-sizing: border-box;
-    background-color: #fff;
-    padding: 6px;
-    border-radius: 12px;
-    .el-table-draggable-wrapper {
-      max-height: 560px;
-      overflow: overlay;
+
+    .with-selector {
+      padding-right: @dialog-width;
     }
-  }
-  .dialog-footer {
-    margin-bottom: 24px;
-    text-align: right;
-  }
-  .query-inernal-table-tips {
-    position: relative;
-    top: -1px;
-    left: 2px;
-  }
-  .el-table__empty-block {
-    height: 0px;
-  }
-  .el-table {
-    min-height: 148px;
-  }
-  .max-width {
-    width: 100%;
-  }
-  .internal-table-tips {
-    :first-child {
-      max-height: 100% !important;
+    .el-dialog__body {
+      scrollbar-gutter: stable;
+    }
+    .internal-table-container {
+      margin: 32px 24px 24px;
+    }
+    .split-block {
+      margin-top: 24px;
+    }
+    .sub-title {
+      margin-bottom: 8px;
+    }
+    .table-attribute-selector {
+      position: absolute;
+      bottom: 0;
+      right: -@dialog-width - 12px;
+      width: @dialog-width;
+      box-sizing: border-box;
+      background-color: #fff;
+      padding: 6px;
+      border-radius: 12px;
+      .el-table-draggable-wrapper {
+        max-height: 560px;
+        overflow: overlay;
+      }
+    }
+    .dialog-footer {
+      margin-bottom: 24px;
+      text-align: right;
+    }
+    .query-inernal-table-tips {
+      position: relative;
+      top: -1px;
+      left: 2px;
+    }
+    .el-table__empty-block {
+      height: 0px;
+    }
+    .el-table {
+      min-height: 148px;
+    }
+    .max-width {
+      width: 100%;
+    }
+    .internal-table-tips {
+      :first-child {
+        max-height: 100% !important;
+      }
     }
   }
 </style>
diff --git a/kystudio/src/components/studio/InternalTable/Setting/locales.js 
b/kystudio/src/components/studio/InternalTable/Setting/locales.js
index 3590926dfe..d684ee376c 100644
--- a/kystudio/src/components/studio/InternalTable/Setting/locales.js
+++ b/kystudio/src/components/studio/InternalTable/Setting/locales.js
@@ -1,7 +1,7 @@
 export default {
   en: {
     dialogTitle: 'Internal Table Settings',
-    settingDesc: 'After you set the time partition column, you can load data 
in incremental or full mode. Non-partitioned tables only support full load. 
Note that if incremental loading is required, set the partitioned column to be 
the same as the data source table level partition and to be a date-type column',
+    settingDesc: 'Please note that if incremental loading is required, set the 
partition column as a date type, or other types that can be converted to dates, 
and set the correct time partition column format.',
     partitionOptionsTitle: 'Please choose the partition column',
     timePartitionFormatTitle: 'Time column format',
     bucketColumnTitle: 'Please choose the bucket column',
@@ -24,7 +24,7 @@ export default {
   },
   'zh-cn': {
     dialogTitle: '内表设置',
-    settingDesc: 
'设置时间分区列后可以使用增量或全量方式加载数据,非分区表仅支持全量加载。请注意,如需增量加载,请设置分区列与数据源表一级分区保持一致,且为日期类型列',
+    settingDesc: '请注意,如需增量加载,请设置分区列为日期类型,或可以转为日期的其他类型,并设置正确的时间分区列格式。',
     partitionOptionsTitle: '请选择分区列',
     timePartitionFormatTitle: '时间分区列格式',
     bucketColumnTitle: '设置分桶列',

Reply via email to