Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
803c8d83
Unverified
Commit
803c8d83
authored
Oct 28, 2022
by
ZackYoung
Committed by
GitHub
Oct 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix][udf]修复udf逻辑遗留问题 (#1174)
* 因为之前udf 开发逻辑遗留问题,导致其他任务添加savepoint变null.null * 因为之前udf 开发逻辑遗留问题,导致其他任务添加savepoint变null.null * 更新sql模板语句
parent
0459b324
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
TaskServiceImpl.java
...src/main/java/com/dlink/service/impl/TaskServiceImpl.java
+2
-2
UDFServiceImpl.java
.../src/main/java/com/dlink/service/impl/UDFServiceImpl.java
+7
-0
dinky_dml.sql
dlink-doc/sql/upgrade/0.6.8_schema/mysql/dinky_dml.sql
+0
-1
No files found.
dlink-admin/src/main/java/com/dlink/service/impl/TaskServiceImpl.java
View file @
803c8d83
...
@@ -377,7 +377,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -377,7 +377,6 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
task
.
setStatement
(
code
);
task
.
setStatement
(
code
);
}
}
}
}
}
// to compiler udf
// to compiler udf
if
(
Asserts
.
isNotNullString
(
task
.
getDialect
())
&&
Dialect
.
JAVA
.
equalsVal
(
task
.
getDialect
())
if
(
Asserts
.
isNotNullString
(
task
.
getDialect
())
&&
Dialect
.
JAVA
.
equalsVal
(
task
.
getDialect
())
&&
Asserts
.
isNotNullString
(
task
.
getStatement
()))
{
&&
Asserts
.
isNotNullString
(
task
.
getStatement
()))
{
...
@@ -385,9 +384,10 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -385,9 +384,10 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
task
.
setSavePointPath
(
compiler
.
getFullClassName
());
task
.
setSavePointPath
(
compiler
.
getFullClassName
());
}
else
if
(
Dialect
.
PYTHON
.
equalsVal
(
task
.
getDialect
()))
{
}
else
if
(
Dialect
.
PYTHON
.
equalsVal
(
task
.
getDialect
()))
{
task
.
setSavePointPath
(
task
.
getName
()
+
"."
+
UDFUtil
.
getPyUDFAttr
(
task
.
getStatement
()));
task
.
setSavePointPath
(
task
.
getName
()
+
"."
+
UDFUtil
.
getPyUDFAttr
(
task
.
getStatement
()));
}
else
{
}
else
if
(
Dialect
.
SCALA
.
equalsVal
(
task
.
getDialect
()))
{
task
.
setSavePointPath
(
UDFUtil
.
getScalaFullClassName
(
task
.
getStatement
()));
task
.
setSavePointPath
(
UDFUtil
.
getScalaFullClassName
(
task
.
getStatement
()));
}
}
}
// if modify task else create task
// if modify task else create task
if
(
task
.
getId
()
!=
null
)
{
if
(
task
.
getId
()
!=
null
)
{
...
...
dlink-admin/src/main/java/com/dlink/service/impl/UDFServiceImpl.java
View file @
803c8d83
...
@@ -64,6 +64,13 @@ public class UDFServiceImpl implements UDFService {
...
@@ -64,6 +64,13 @@ public class UDFServiceImpl implements UDFService {
@Resource
@Resource
TaskService
taskService
;
TaskService
taskService
;
/**
* init udf
*
* @param statement sql 语句
* @param gatewayType flink gateway类型
* @return {@link UDFPath}
*/
@Override
@Override
public
UDFPath
initUDF
(
String
statement
,
GatewayType
gatewayType
)
{
public
UDFPath
initUDF
(
String
statement
,
GatewayType
gatewayType
)
{
if
(
gatewayType
==
GatewayType
.
KUBERNETES_APPLICATION
)
{
if
(
gatewayType
==
GatewayType
.
KUBERNETES_APPLICATION
)
{
...
...
dlink-doc/sql/upgrade/0.6.8_schema/mysql/dinky_dml.sql
View file @
803c8d83
...
@@ -71,4 +71,3 @@ VALUES (4, 'python_udf_1', 'Python', 'UDF', 'from pyflink.table import ScalarFun
...
@@ -71,4 +71,3 @@ VALUES (4, 'python_udf_1', 'Python', 'UDF', 'from pyflink.table import ScalarFun
INSERT
INTO
`dlink_udf_template`
(
`id`
,
`name`
,
`code_type`
,
`function_type`
,
`template_code`
,
`enabled`
,
`create_time`
,
`update_time`
)
INSERT
INTO
`dlink_udf_template`
(
`id`
,
`name`
,
`code_type`
,
`function_type`
,
`template_code`
,
`enabled`
,
`create_time`
,
`update_time`
)
VALUES
(
5
,
'python_udf_2'
,
'Python'
,
'UDF'
,
'from pyflink.table import DataTypes
\n
from pyflink.table.udf import udf
\n\n
@udf(result_type=DataTypes.STRING())
\n
def ${className}(variable1:string):
\n
return
\'\'
'
,
NULL
,
'2022-10-25 09:25:13'
,
'2022-10-25 09:34:47'
);
VALUES
(
5
,
'python_udf_2'
,
'Python'
,
'UDF'
,
'from pyflink.table import DataTypes
\n
from pyflink.table.udf import udf
\n\n
@udf(result_type=DataTypes.STRING())
\n
def ${className}(variable1:string):
\n
return
\'\'
'
,
NULL
,
'2022-10-25 09:25:13'
,
'2022-10-25 09:34:47'
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment