You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/08/29 07:21:08 UTC

[GitHub] [dolphinscheduler] Amy0104 commented on a diff in pull request #11651: [Feature][Task Plugin] Support hive cli task plugin

Amy0104 commented on code in PR #11651:
URL: https://github.com/apache/dolphinscheduler/pull/11651#discussion_r956969619


##########
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-hive-cli.ts:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { useI18n } from 'vue-i18n'
+import {useCustomParams, useResources} from '.'
+import type { IJsonItem } from '../types'
+
+export function useHiveCli(model: { [field: string]: any }): IJsonItem[] {
+    const { t } = useI18n()
+
+    return [
+        {
+            type: 'select',
+            field: 'hiveCliTaskExecutionType',
+            span: 12,
+            name: t('project.node.hive_cli_task_execution_type'),
+            options: HIVE_CLI_TASK_EXECUTION_TYPES,
+        },
+        {
+            type: 'editor',
+            field: 'hiveSqlScript',
+            name: t('project.node.hive_sql_script'),
+            props: {
+                language: 'sql'
+            }
+        },
+        {
+            type: 'input',
+            field: 'hiveCliOptions',
+            name: t('project.node.hive_cli_options'),
+            props: {
+                placeholder: t('project.node.hive_cli_options')

Review Comment:
   It's better to use the 'hive_cli_options_tips' here.



##########
dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-hive-cli.ts:
##########
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { reactive } from 'vue'
+import * as Fields from '../fields/index'
+import type { IJsonItem, INodeData, ITaskData } from '../types'
+
+export function useHiveCli({
+                               projectCode,
+                               from = 0,
+                               readonly,
+                               data
+                           }: {
+    projectCode: number

Review Comment:
   It's better to format the code by eslint.



##########
dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts:
##########
@@ -658,5 +664,10 @@ export function formatModel(data: ITaskData) {
   if (data.taskParams?.jobType) {
     params.isCustomTask = data.taskParams.jobType === 'CUSTOM'
   }
+
+  if (data.taskParams?.type) {
+    params.type = data.taskParams.type

Review Comment:
   It seems that the type doesn't need to be reassigned here.



##########
dolphinscheduler-ui/src/locales/zh_CN/project.ts:
##########
@@ -644,6 +644,12 @@ export default {
     zeppelin_parameters_tips: '请输入zeppelin dynamic form参数',
     zeppelin_rest_endpoint: 'zeppelinRestEndpoint',
     zeppelin_rest_endpoint_tips: '请输入zeppelin server的rest endpoint',
+    hive_cli_task_execution_type: 'Hive Cli 任务类型',
+    hive_cli_task_execution_type_tips: '请选择您的Hive Cli任务类型',
+    hive_sql_script: 'Hive SQL 脚本',
+    hive_sql_script_tips: '请填写您的Hive SQL脚本',

Review Comment:
   This seems not to be used too.



##########
dolphinscheduler-ui/src/locales/zh_CN/project.ts:
##########
@@ -644,6 +644,12 @@ export default {
     zeppelin_parameters_tips: '请输入zeppelin dynamic form参数',
     zeppelin_rest_endpoint: 'zeppelinRestEndpoint',
     zeppelin_rest_endpoint_tips: '请输入zeppelin server的rest endpoint',
+    hive_cli_task_execution_type: 'Hive Cli 任务类型',
+    hive_cli_task_execution_type_tips: '请选择您的Hive Cli任务类型',

Review Comment:
   This seems not to be used, same as the en_US.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org