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
23e8d5a5
Unverified
Commit
23e8d5a5
authored
Jan 05, 2023
by
Licho
Committed by
GitHub
Jan 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: udf not support CASE INSENSITIVE (#1509)
Signed-off-by:
Licho
<
chinabhsun@gmail.com
>
Signed-off-by:
Licho
<
chinabhsun@gmail.com
>
parent
7a7c8eb0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
UDFUtil.java
...nction/src/main/java/com/dlink/function/util/UDFUtil.java
+3
-3
No files found.
dlink-function/src/main/java/com/dlink/function/util/UDFUtil.java
View file @
23e8d5a5
...
@@ -280,13 +280,13 @@ public class UDFUtil {
...
@@ -280,13 +280,13 @@ public class UDFUtil {
return
MD5
.
create
().
digestHex
(
FileUtil
.
file
(
filePath
));
return
MD5
.
create
().
digestHex
(
FileUtil
.
file
(
filePath
));
}
}
public
static
boolean
isUdfStatement
(
String
statement
)
{
public
static
boolean
isUdfStatement
(
Pattern
pattern
,
String
statement
)
{
return
!
StrUtil
.
isBlank
(
statement
)
&&
CollUtil
.
isNotEmpty
(
ReUtil
.
findAll
(
FUNCTION_SQL_REGEX
,
statement
,
0
));
return
!
StrUtil
.
isBlank
(
statement
)
&&
CollUtil
.
isNotEmpty
(
ReUtil
.
findAll
(
pattern
,
statement
,
0
));
}
}
public
static
UDF
toUDF
(
String
statement
)
{
public
static
UDF
toUDF
(
String
statement
)
{
if
(
isUdfStatement
(
statement
))
{
Pattern
pattern
=
Pattern
.
compile
(
FUNCTION_SQL_REGEX
,
Pattern
.
CASE_INSENSITIVE
);
Pattern
pattern
=
Pattern
.
compile
(
FUNCTION_SQL_REGEX
,
Pattern
.
CASE_INSENSITIVE
);
if
(
isUdfStatement
(
pattern
,
statement
))
{
List
<
String
>
groups
=
CollUtil
.
removeEmpty
(
ReUtil
.
getAllGroups
(
pattern
,
statement
));
List
<
String
>
groups
=
CollUtil
.
removeEmpty
(
ReUtil
.
getAllGroups
(
pattern
,
statement
));
String
udfName
=
groups
.
get
(
1
);
String
udfName
=
groups
.
get
(
1
);
String
className
=
groups
.
get
(
2
);
String
className
=
groups
.
get
(
2
);
...
...
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