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 a21180a6b13fd19256ba442825a83d1c70bf5237 Author: Qian Xia <[email protected]> AuthorDate: Thu Jul 27 16:53:28 2023 +0800 KYLIN-5670 add parameter for table max num --- kystudio/src/components/common/DataSourceModal/index.vue | 7 +++++++ kystudio/src/components/common/DataSourceModal/locales.js | 3 ++- kystudio/src/store/system.js | 4 +++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/kystudio/src/components/common/DataSourceModal/index.vue b/kystudio/src/components/common/DataSourceModal/index.vue index 4f24639c34..24232cf51b 100644 --- a/kystudio/src/components/common/DataSourceModal/index.vue +++ b/kystudio/src/components/common/DataSourceModal/index.vue @@ -123,6 +123,9 @@ vuex.registerModule(['modals', 'DataSourceModal'], store) firstEditType: state => state.firstEditType, databaseSizeObj: state => state.databaseSizeObj }), + ...mapState({ + loadThresholdEnabled: state => state.system.loadThresholdEnabled + }), ...mapGetters([ 'currentSelectedProject' ]) @@ -217,6 +220,10 @@ export default class DataSourceModal extends Vue { } } async handleSubmit () { + if (this.loadThresholdEnabled === 'true' && this.$refs['source-hive-form'] && this.$refs['source-hive-form'].tablesNum > 1000) { + this.$message.error(this.$t('tableNumOver')) + return + } this._showLoading() try { if (await this._validate()) { diff --git a/kystudio/src/components/common/DataSourceModal/locales.js b/kystudio/src/components/common/DataSourceModal/locales.js index 5a29c47147..9a9da86499 100644 --- a/kystudio/src/components/common/DataSourceModal/locales.js +++ b/kystudio/src/components/common/DataSourceModal/locales.js @@ -17,6 +17,7 @@ export default { pleaseGetClusterInfoAndTopicInfo: 'Please get the Kafka cluster and topic information.', needAttachedHiveTableInfo: 'Please select an attached Hive table.', needTimestampColumnInfo: 'Can\'t load. Please ensure the table has at least a timestamp column.', - hiveTableErrorTips: 'Can\'t attach. Please ensure that the columns of the Kafka table and the Hive table are identical.' + hiveTableErrorTips: 'Can\'t attach. Please ensure that the columns of the Kafka table and the Hive table are identical.', + tableNumOver: 'Up to 1000 tables could be loaded per time, please modify and try again.' } } diff --git a/kystudio/src/store/system.js b/kystudio/src/store/system.js index a890fd9afa..46264b62ec 100644 --- a/kystudio/src/store/system.js +++ b/kystudio/src/store/system.js @@ -62,7 +62,8 @@ export default { storageQuery: 'true', ddlEnabled: 'false', logicalViewEnabled: 'false', - logicalViewDatabase: 'KYLIN_LOGICAL_VIEW' + logicalViewDatabase: 'KYLIN_LOGICAL_VIEW', + loadThresholdEnabled: 'true' }, mutations: { [types.COLLECT_MESSAGE_DIRECTIVES]: (state, directive) => { @@ -189,6 +190,7 @@ export default { commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.hive.enabled', key: 'ddlEnabled', defaultValue: 'false'}) commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.logical-view.enabled', key: 'logicalViewEnabled', defaultValue: 'false'}) commit(types.GET_CONF_BY_NAME, {name: 'kylin.source.ddl.logical-view.database', key: 'logicalViewDatabase', defaultValue: 'KYLIN_LOGICAL_VIEW'}) + commit(types.GET_CONF_BY_NAME, {name: 'kylin.table.load-threshold-enabled', key: 'loadThresholdEnabled', defaultValue: 'true'}) resolve(response) }, () => { reject()
