Unverified Commit 523baf51 authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

fix modify cluster instance bug && fix some sql bug (#2479)

* fix modify cluster instance bug && fix some sql bug * fix modify cluster instance bug && fix some sql bug * Spotless Apply --------- Co-authored-by: 's avatarzhu-mingye <zhu-mingye@users.noreply.github.com>
parent 04499202
...@@ -42,6 +42,9 @@ import lombok.NoArgsConstructor; ...@@ -42,6 +42,9 @@ import lombok.NoArgsConstructor;
@ApiModel(value = "ClusterInstanceDTO", description = "API Cluster Instance Data Transfer Object") @ApiModel(value = "ClusterInstanceDTO", description = "API Cluster Instance Data Transfer Object")
public class ClusterInstanceDTO { public class ClusterInstanceDTO {
@ApiModelProperty(value = "id", required = true, dataType = "Integer", example = "id")
private Integer id;
@ApiModelProperty(value = "Name", required = true, dataType = "String", example = "Name") @ApiModelProperty(value = "Name", required = true, dataType = "String", example = "Name")
private String name; private String name;
......
...@@ -60,9 +60,6 @@ public class UDFTemplateServiceImpl extends SuperServiceImpl<UDFTemplateMapper, ...@@ -60,9 +60,6 @@ public class UDFTemplateServiceImpl extends SuperServiceImpl<UDFTemplateMapper,
public Boolean modifyUDFTemplateStatus(Integer id) { public Boolean modifyUDFTemplateStatus(Integer id) {
UDFTemplate udfTemplate = getById(id); UDFTemplate udfTemplate = getById(id);
udfTemplate.setEnabled(!udfTemplate.getEnabled()); udfTemplate.setEnabled(!udfTemplate.getEnabled());
if (updateById(udfTemplate)) { return updateById(udfTemplate);
return true;
}
return false;
} }
} }
...@@ -2342,7 +2342,7 @@ CREATE TABLE `dinky_udf_template` ( ...@@ -2342,7 +2342,7 @@ CREATE TABLE `dinky_udf_template` (
`code_type` varchar(10) null DEFAULT null COMMENT 'code type', `code_type` varchar(10) null DEFAULT null COMMENT 'code type',
`function_type` varchar(10) null DEFAULT null COMMENT 'function type', `function_type` varchar(10) null DEFAULT null COMMENT 'function type',
`template_code` longtext null COMMENT 'code', `template_code` longtext null COMMENT 'code',
`enabled` tinyint(1) null DEFAULT 1 COMMENT 'is enable', `enabled` tinyint(1) not null DEFAULT 1 COMMENT 'is enable',
`create_time` datetime(0) null DEFAULT null COMMENT 'create time', `create_time` datetime(0) null DEFAULT null COMMENT 'create time',
`update_time` datetime DEFAULT null ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time' `update_time` datetime DEFAULT null ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time'
) ENGINE = InnoDB ROW_FORMAT = Dynamic; ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
...@@ -2356,7 +2356,7 @@ public class ${className} extends ScalarFunction { ...@@ -2356,7 +2356,7 @@ public class ${className} extends ScalarFunction {
return null; return null;
} }
}' }'
, null, '2022-10-19 09:17:37', '2022-10-25 17:45:57'); , 1, '2022-10-19 09:17:37', '2022-10-25 17:45:57');
INSERT INTO `dinky_udf_template` INSERT INTO `dinky_udf_template`
VALUES (2, 'java_udtf', 'Java', 'UDTF', '${(package=='''')?string('''',''package ''+package+'';'')} VALUES (2, 'java_udtf', 'Java', 'UDTF', '${(package=='''')?string('''',''package ''+package+'';'')}
...@@ -2372,7 +2372,7 @@ public static class ${className} extends TableFunction<Row> { ...@@ -2372,7 +2372,7 @@ public static class ${className} extends TableFunction<Row> {
} }
} }
}' }'
, null, '2022-10-19 09:22:58', '2022-10-25 17:49:30'); , 1, '2022-10-19 09:22:58', '2022-10-25 17:49:30');
INSERT INTO `dinky_udf_template` INSERT INTO `dinky_udf_template`
VALUES (3, 'scala_udf', 'Scala', 'UDF', '${(package=='''')?string('''',''package ''+package+'';'')} VALUES (3, 'scala_udf', 'Scala', 'UDF', '${(package=='''')?string('''',''package ''+package+'';'')}
...@@ -2385,7 +2385,7 @@ class ${className} extends ScalarFunction { ...@@ -2385,7 +2385,7 @@ class ${className} extends ScalarFunction {
"this is scala" "this is scala"
} }
}' }'
, null, '2022-10-25 09:21:32', '2022-10-25 17:49:46'); , 1, '2022-10-25 09:21:32', '2022-10-25 17:49:46');
INSERT INTO `dinky_udf_template` INSERT INTO `dinky_udf_template`
VALUES (4, 'python_udf_1', 'Python', 'UDF', 'from pyflink.table import ScalarFunction, DataTypes VALUES (4, 'python_udf_1', 'Python', 'UDF', 'from pyflink.table import ScalarFunction, DataTypes
from pyflink.table.udf import udf from pyflink.table.udf import udf
...@@ -2399,7 +2399,7 @@ class ${className}(ScalarFunction): ...@@ -2399,7 +2399,7 @@ class ${className}(ScalarFunction):
${attr!''f''} = udf(${className}(), result_type=DataTypes.STRING())' ${attr!''f''} = udf(${className}(), result_type=DataTypes.STRING())'
, null, '2022-10-25 09:23:07', '2022-10-25 09:34:01'); , 1, '2022-10-25 09:23:07', '2022-10-25 09:34:01');
INSERT INTO `dinky_udf_template` INSERT INTO `dinky_udf_template`
VALUES (5, 'python_udf_2', 'Python', 'UDF', 'from pyflink.table import DataTypes VALUES (5, 'python_udf_2', 'Python', 'UDF', 'from pyflink.table import DataTypes
from pyflink.table.udf import udf from pyflink.table.udf import udf
...@@ -2407,7 +2407,7 @@ from pyflink.table.udf import udf ...@@ -2407,7 +2407,7 @@ from pyflink.table.udf import udf
@udf(result_type=DataTypes.STRING()) @udf(result_type=DataTypes.STRING())
def ${className}(variable1:str): def ${className}(variable1:str):
return ''''' return '''''
, null, '2022-10-25 09:25:13', '2022-10-25 09:34:47'); , 1, '2022-10-25 09:25:13', '2022-10-25 09:34:47');
DROP TABLE IF EXISTS `dinky_user`; DROP TABLE IF EXISTS `dinky_user`;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
import EditorFloatBtn from '@/components/CustomEditor/EditorFloatBtn'; import EditorFloatBtn from '@/components/CustomEditor/EditorFloatBtn';
import { LogLanguage } from '@/components/CustomEditor/languages/javalog'; import { LogLanguage } from '@/components/CustomEditor/languages/javalog';
import useThemeValue from '@/hooks/useThemeValue'; import useThemeValue from '@/hooks/useThemeValue';
import { Loading } from '@/pages/Other/Loading';
import { MonacoEditorOptions } from '@/types/Public/data'; import { MonacoEditorOptions } from '@/types/Public/data';
import { convertCodeEditTheme } from '@/utils/function'; import { convertCodeEditTheme } from '@/utils/function';
import { Editor, useMonaco } from '@monaco-editor/react'; import { Editor, useMonaco } from '@monaco-editor/react';
...@@ -116,7 +117,7 @@ const CodeShow = (props: CodeShowFormProps) => { ...@@ -116,7 +117,7 @@ const CodeShow = (props: CodeShowFormProps) => {
const handleStopAutoRefresh = () => { const handleStopAutoRefresh = () => {
setStopping(true); setStopping(true);
setInterval(() => { setInterval(() => {
clearInterval(timer); clearInterval(timer as any);
setStopping(false); setStopping(false);
setAutoRefresh(false); setAutoRefresh(false);
}, 1000); }, 1000);
...@@ -212,7 +213,8 @@ const CodeShow = (props: CodeShowFormProps) => { ...@@ -212,7 +213,8 @@ const CodeShow = (props: CodeShowFormProps) => {
<Editor <Editor
width={width} width={width}
height={height} height={height}
value={loading ? 'loading...' : code} loading={<Loading loading={loading} />}
value={code ?? ''}
language={language} language={language}
options={{ options={{
scrollBeyondLastLine: false, scrollBeyondLastLine: false,
...@@ -257,7 +259,6 @@ const CodeShow = (props: CodeShowFormProps) => { ...@@ -257,7 +259,6 @@ const CodeShow = (props: CodeShowFormProps) => {
style={{ style={{
width: 35, width: 35,
height: height, height: height,
backgroundColor: themeValue.borderColor,
paddingBlock: 10 paddingBlock: 10
}} }}
> >
......
/* /*
*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. * this work for additional information regarding copyright ownership.
...@@ -13,6 +14,7 @@ ...@@ -13,6 +14,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*
*/ */
import { CircleBtn } from '@/components/CallBackButton/CircleBtn'; import { CircleBtn } from '@/components/CallBackButton/CircleBtn';
...@@ -68,7 +70,7 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => { ...@@ -68,7 +70,7 @@ const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => {
*/ */
return ( return (
<> <>
<Space direction={'vertical'} size={0}> <Space direction={'vertical'} align={'center'} size={2}>
{refreshLogCallback && ( {refreshLogCallback && (
<> <>
<CircleBtn <CircleBtn
......
...@@ -19,27 +19,15 @@ ...@@ -19,27 +19,15 @@
import { CLUSTER_INSTANCE_TYPE } from '@/pages/RegCenter/Cluster/Instance/components/contants'; import { CLUSTER_INSTANCE_TYPE } from '@/pages/RegCenter/Cluster/Instance/components/contants';
import { validatorJMHAAdderess } from '@/pages/RegCenter/Cluster/Instance/components/function'; import { validatorJMHAAdderess } from '@/pages/RegCenter/Cluster/Instance/components/function';
import { MODAL_FORM_OPTIONS } from '@/services/constants';
import { Cluster } from '@/types/RegCenter/data';
import { l } from '@/utils/intl'; import { l } from '@/utils/intl';
import { import {
ProForm,
ProFormGroup, ProFormGroup,
ProFormSelect, ProFormSelect,
ProFormText, ProFormText,
ProFormTextArea ProFormTextArea
} from '@ant-design/pro-components'; } from '@ant-design/pro-components';
import { FormInstance } from 'antd/es/form/hooks/useForm';
import { Values } from 'async-validator';
import React from 'react';
type InstanceFormProps = {
form: FormInstance<Values>;
value: Partial<Cluster.Instance>;
};
const InstanceForm: React.FC<InstanceFormProps> = (props) => {
const { form, value } = props;
const InstanceForm = () => {
const renderForm = () => { const renderForm = () => {
return ( return (
<> <>
...@@ -93,14 +81,7 @@ const InstanceForm: React.FC<InstanceFormProps> = (props) => { ...@@ -93,14 +81,7 @@ const InstanceForm: React.FC<InstanceFormProps> = (props) => {
); );
}; };
return ( return <>{renderForm()}</>;
<>
{/*// @ts-ignore*/}
<ProForm {...MODAL_FORM_OPTIONS} form={form} initialValues={value} submitter={false}>
{renderForm()}
</ProForm>
</>
);
}; };
export default InstanceForm; export default InstanceForm;
...@@ -29,8 +29,8 @@ import InstanceForm from './InstanceForm'; ...@@ -29,8 +29,8 @@ import InstanceForm from './InstanceForm';
type InstanceModalProps = { type InstanceModalProps = {
visible: boolean; visible: boolean;
onClose: () => void; onClose: () => void;
value: Partial<Cluster.Instance>; value: Cluster.Instance | Partial<Cluster.Instance>;
onSubmit: (values: Partial<Cluster.Instance>) => void; onSubmit: (values: Cluster.Instance) => void;
}; };
const InstanceModal: React.FC<InstanceModalProps> = (props) => { const InstanceModal: React.FC<InstanceModalProps> = (props) => {
const { visible, onClose, onSubmit, value } = props; const { visible, onClose, onSubmit, value } = props;
...@@ -72,7 +72,7 @@ const InstanceModal: React.FC<InstanceModalProps> = (props) => { ...@@ -72,7 +72,7 @@ const InstanceModal: React.FC<InstanceModalProps> = (props) => {
const submitForm = async () => { const submitForm = async () => {
const fieldsValue = await form.validateFields(); const fieldsValue = await form.validateFields();
setSubmitting(true); setSubmitting(true);
await onSubmit({ ...value, ...fieldsValue }); onSubmit({ ...value, ...fieldsValue });
handleCancel(); handleCancel();
}; };
...@@ -97,11 +97,12 @@ const InstanceModal: React.FC<InstanceModalProps> = (props) => { ...@@ -97,11 +97,12 @@ const InstanceModal: React.FC<InstanceModalProps> = (props) => {
{...MODAL_FORM_OPTIONS} {...MODAL_FORM_OPTIONS}
open={visible} open={visible}
modalProps={{ onCancel: handleCancel }} modalProps={{ onCancel: handleCancel }}
form={form}
title={value.id ? l('rc.ci.modify') : l('rc.ci.create')} title={value.id ? l('rc.ci.modify') : l('rc.ci.create')}
submitter={{ render: () => [...renderFooter()] }} submitter={{ render: () => [...renderFooter()] }}
initialValues={value} initialValues={value}
> >
<InstanceForm form={form} value={value} /> <InstanceForm />
</ModalForm> </ModalForm>
</> </>
); );
......
...@@ -150,7 +150,7 @@ const DocumentTableList: React.FC = () => { ...@@ -150,7 +150,7 @@ const DocumentTableList: React.FC = () => {
hideInTable: true, hideInTable: true,
hideInSearch: true, hideInSearch: true,
render: (_, record) => { render: (_, record) => {
return <CodeShow width={'85vh'} code={record.fillValue} />; return <CodeShow language={'sql'} width={'40vw'} code={record.fillValue} />;
} }
}, },
{ {
......
...@@ -1316,7 +1316,7 @@ CREATE TABLE `dinky_udf_template` ( ...@@ -1316,7 +1316,7 @@ CREATE TABLE `dinky_udf_template` (
`code_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'code type', `code_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'code type',
`function_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'function type', `function_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'function type',
`template_code` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'code', `template_code` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'code',
`enabled` tinyint(1) NULL DEFAULT 1 COMMENT 'is enable', `enabled` tinyint(1) not null DEFAULT 1 COMMENT 'is enable',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time', `create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time', `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
...@@ -1325,11 +1325,11 @@ CREATE TABLE `dinky_udf_template` ( ...@@ -1325,11 +1325,11 @@ CREATE TABLE `dinky_udf_template` (
-- ---------------------------- -- ----------------------------
-- Records of dinky_udf_template -- Records of dinky_udf_template
-- ---------------------------- -- ----------------------------
INSERT INTO `dinky_udf_template` VALUES (1, 'java_udf', 'Java', 'UDF', '${(package==\'\')?string(\'\',\'package \'+package+\';\')}\n\nimport org.apache.flink.table.functions.ScalarFunction;\n\npublic class ${className} extends ScalarFunction {\n public String eval(String s) {\n return null;\n }\n}', NULL, '2022-10-19 09:17:37', '2022-10-25 17:45:57'); INSERT INTO `dinky_udf_template` VALUES (1, 'java_udf', 'Java', 'UDF', '${(package==\'\')?string(\'\',\'package \'+package+\';\')}\n\nimport org.apache.flink.table.functions.ScalarFunction;\n\npublic class ${className} extends ScalarFunction {\n public String eval(String s) {\n return null;\n }\n}', true, '2022-10-19 09:17:37', '2022-10-25 17:45:57');
INSERT INTO `dinky_udf_template` VALUES (2, 'java_udtf', 'Java', 'UDTF', '${(package==\'\')?string(\'\',\'package \'+package+\';\')}\n\nimport org.apache.flink.table.functions.ScalarFunction;\n\n@FunctionHint(output = @DataTypeHint(\"ROW<word STRING, length INT>\"))\npublic static class ${className} extends TableFunction<Row> {\n\n public void eval(String str) {\n for (String s : str.split(\" \")) {\n // use collect(...) to emit a row\n collect(Row.of(s, s.length()));\n }\n }\n}', NULL, '2022-10-19 09:22:58', '2022-10-25 17:49:30'); INSERT INTO `dinky_udf_template` VALUES (2, 'java_udtf', 'Java', 'UDTF', '${(package==\'\')?string(\'\',\'package \'+package+\';\')}\n\nimport org.apache.flink.table.functions.ScalarFunction;\n\n@FunctionHint(output = @DataTypeHint(\"ROW<word STRING, length INT>\"))\npublic static class ${className} extends TableFunction<Row> {\n\n public void eval(String str) {\n for (String s : str.split(\" \")) {\n // use collect(...) to emit a row\n collect(Row.of(s, s.length()));\n }\n }\n}', true, '2022-10-19 09:22:58', '2022-10-25 17:49:30');
INSERT INTO `dinky_udf_template` VALUES (3, 'scala_udf', 'Scala', 'UDF', '${(package==\'\')?string(\'\',\'package \'+package+\';\')}\n\nimport org.apache.flink.table.api._\nimport org.apache.flink.table.functions.ScalarFunction\n\n// 定义可参数化的函数逻辑\nclass ${className} extends ScalarFunction {\n def eval(s: String, begin: Integer, end: Integer): String = {\n \"this is scala\"\n }\n}', NULL, '2022-10-25 09:21:32', '2022-10-25 17:49:46'); INSERT INTO `dinky_udf_template` VALUES (3, 'scala_udf', 'Scala', 'UDF', '${(package==\'\')?string(\'\',\'package \'+package+\';\')}\n\nimport org.apache.flink.table.api._\nimport org.apache.flink.table.functions.ScalarFunction\n\n// 定义可参数化的函数逻辑\nclass ${className} extends ScalarFunction {\n def eval(s: String, begin: Integer, end: Integer): String = {\n \"this is scala\"\n }\n}', true, '2022-10-25 09:21:32', '2022-10-25 17:49:46');
INSERT INTO `dinky_udf_template` VALUES (4, 'python_udf_1', 'Python', 'UDF', 'from pyflink.table import ScalarFunction, DataTypes\nfrom pyflink.table.udf import udf\n\nclass ${className}(ScalarFunction):\n def __init__(self):\n pass\n\n def eval(self, variable):\n return str(variable)\n\n\n${attr!\'f\'} = udf(${className}(), result_type=DataTypes.STRING())', NULL, '2022-10-25 09:23:07', '2022-10-25 09:34:01'); INSERT INTO `dinky_udf_template` VALUES (4, 'python_udf_1', 'Python', 'UDF', 'from pyflink.table import ScalarFunction, DataTypes\nfrom pyflink.table.udf import udf\n\nclass ${className}(ScalarFunction):\n def __init__(self):\n pass\n\n def eval(self, variable):\n return str(variable)\n\n\n${attr!\'f\'} = udf(${className}(), result_type=DataTypes.STRING())', true, '2022-10-25 09:23:07', '2022-10-25 09:34:01');
INSERT INTO `dinky_udf_template` VALUES (5, 'python_udf_2', 'Python', 'UDF', 'from pyflink.table import DataTypes\nfrom pyflink.table.udf import udf\n\n@udf(result_type=DataTypes.STRING())\ndef ${className}(variable1:str):\n return \'\'', NULL, '2022-10-25 09:25:13', '2022-10-25 09:34:47'); INSERT INTO `dinky_udf_template` VALUES (5, 'python_udf_2', 'Python', 'UDF', 'from pyflink.table import DataTypes\nfrom pyflink.table.udf import udf\n\n@udf(result_type=DataTypes.STRING())\ndef ${className}(variable1:str):\n return \'\'', true, '2022-10-25 09:25:13', '2022-10-25 09:34:47');
-- ---------------------------- -- ----------------------------
......
...@@ -1628,7 +1628,7 @@ CREATE TABLE "public"."dinky_udf_template" ( ...@@ -1628,7 +1628,7 @@ CREATE TABLE "public"."dinky_udf_template" (
"code_type" varchar(10) COLLATE "pg_catalog"."default", "code_type" varchar(10) COLLATE "pg_catalog"."default",
"function_type" varchar(10) COLLATE "pg_catalog"."default", "function_type" varchar(10) COLLATE "pg_catalog"."default",
"template_code" text COLLATE "pg_catalog"."default", "template_code" text COLLATE "pg_catalog"."default",
"enabled" int2, "enabled" int2 NOT null DEFAULT 1,
"create_time" timestamp(6), "create_time" timestamp(6),
"update_time" timestamp(6) "update_time" timestamp(6)
) )
...@@ -1653,7 +1653,7 @@ public class ${className} extends ScalarFunction { ...@@ -1653,7 +1653,7 @@ public class ${className} extends ScalarFunction {
public String eval(String s) { public String eval(String s) {
return null; return null;
} }
}', null, '2022-10-19 09:17:37', '2022-10-25 17:45:57'); }', 1, '2022-10-19 09:17:37', '2022-10-25 17:45:57');
INSERT INTO "public"."dinky_udf_template" VALUES (2, 'java_udtf', 'Java', 'UDTF', '${(package=='''')?string('''',''package ''+package+'';'')} INSERT INTO "public"."dinky_udf_template" VALUES (2, 'java_udtf', 'Java', 'UDTF', '${(package=='''')?string('''',''package ''+package+'';'')}
import org.apache.flink.table.functions.ScalarFunction; import org.apache.flink.table.functions.ScalarFunction;
...@@ -1667,7 +1667,7 @@ public static class ${className} extends TableFunction<Row> { ...@@ -1667,7 +1667,7 @@ public static class ${className} extends TableFunction<Row> {
collect(Row.of(s, s.length())); collect(Row.of(s, s.length()));
} }
} }
}', null, '2022-10-19 09:22:58', '2022-10-25 17:49:30'); }', 1, '2022-10-19 09:22:58', '2022-10-25 17:49:30');
INSERT INTO "public"."dinky_udf_template" VALUES (3, 'scala_udf', 'Scala', 'UDF', '${(package=='''')?string('''',''package ''+package+'';'')} INSERT INTO "public"."dinky_udf_template" VALUES (3, 'scala_udf', 'Scala', 'UDF', '${(package=='''')?string('''',''package ''+package+'';'')}
import org.apache.flink.table.api._ import org.apache.flink.table.api._
...@@ -1678,7 +1678,7 @@ class ${className} extends ScalarFunction { ...@@ -1678,7 +1678,7 @@ class ${className} extends ScalarFunction {
def eval(s: String, begin: Integer, end: Integer): String = { def eval(s: String, begin: Integer, end: Integer): String = {
"this is scala" "this is scala"
} }
}', null, '2022-10-25 09:21:32', '2022-10-25 17:49:46'); }', 1, '2022-10-25 09:21:32', '2022-10-25 17:49:46');
INSERT INTO "public"."dinky_udf_template" VALUES (4, 'python_udf_1', 'Python', 'UDF', 'from pyflink.table import ScalarFunction, DataTypes INSERT INTO "public"."dinky_udf_template" VALUES (4, 'python_udf_1', 'Python', 'UDF', 'from pyflink.table import ScalarFunction, DataTypes
from pyflink.table.udf import udf from pyflink.table.udf import udf
...@@ -1690,13 +1690,13 @@ class ${className}(ScalarFunction): ...@@ -1690,13 +1690,13 @@ class ${className}(ScalarFunction):
return str(variable) return str(variable)
${attr!''f''} = udf(${className}(), result_type=DataTypes.STRING())', null, '2022-10-25 09:23:07', '2022-10-25 09:34:01'); ${attr!''f''} = udf(${className}(), result_type=DataTypes.STRING())', 1, '2022-10-25 09:23:07', '2022-10-25 09:34:01');
INSERT INTO "public"."dinky_udf_template" VALUES (5, 'python_udf_2', 'Python', 'UDF', 'from pyflink.table import DataTypes INSERT INTO "public"."dinky_udf_template" VALUES (5, 'python_udf_2', 'Python', 'UDF', 'from pyflink.table import DataTypes
from pyflink.table.udf import udf from pyflink.table.udf import udf
@udf(result_type=DataTypes.STRING()) @udf(result_type=DataTypes.STRING())
def ${className}(variable1:str): def ${className}(variable1:str):
return ''''', null, '2022-10-25 09:25:13', '2022-10-25 09:34:47'); return ''''', 1, '2022-10-25 09:25:13', '2022-10-25 09:34:47');
-- ---------------------------- -- ----------------------------
......
...@@ -240,6 +240,7 @@ alter table dinky_task alter column `step` set default 1; ...@@ -240,6 +240,7 @@ alter table dinky_task alter column `step` set default 1;
-- todo: 需要修改历史作业的默认值 , 过滤条件待定 -- todo: 需要修改历史作业的默认值 , 过滤条件待定
replace INTO dinky_task SELECT replace INTO dinky_task SELECT
t.id, t.id,
t.`name`, t.`name`,
...@@ -679,3 +680,8 @@ WITH ( ...@@ -679,3 +680,8 @@ WITH (
''connector'' = ''kafka'' ''connector'' = ''kafka''
) )
AS SELECT id, name, age FROM source_table WHERE mod(id, 10) = 0;', 'All Versions', 0, 1, '2023-10-31 16:41:46', '2023-10-31 16:43:29'); AS SELECT id, name, age FROM source_table WHERE mod(id, 10) = 0;', 'All Versions', 0, 1, '2023-10-31 16:41:46', '2023-10-31 16:43:29');
-- 修改 dinky_udf_template 表的 enable 字段 不允许为空 默认为 1
alter table dinky_udf_template modify column `enabled` tinyint(1) not null default 1 comment 'is enable, 0:no 1:yes';
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment