Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
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
zhaowei
dlink
Commits
bea56361
Commit
bea56361
authored
Jul 15, 2021
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assert
parent
0d660379
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
CustomTableEnvironmentImpl.java
...com/dlink/executor/custom/CustomTableEnvironmentImpl.java
+1
-1
Asserts.java
dlink-core/src/main/java/com/dlink/assertion/Asserts.java
+6
-0
TransGenerator.java
...c/main/java/com/dlink/explainer/trans/TransGenerator.java
+4
-5
No files found.
dlink-client/dlink-client-1.12/src/main/java/com/dlink/executor/custom/CustomTableEnvironmentImpl.java
View file @
bea56361
...
...
@@ -168,7 +168,7 @@ public class CustomTableEnvironmentImpl extends TableEnvironmentImpl {
ObjectNode
jsonNode
=
jsonGenerator
.
getJSONNode
();
return
jsonNode
;
}
else
{
throw
new
TableException
(
"Unsupported SQL query!
explainSql() need a single SQL to query
."
);
throw
new
TableException
(
"Unsupported SQL query!
ExecEnv need a ExecutorBase
."
);
}
}
}
...
...
dlink-core/src/main/java/com/dlink/assertion/Asserts.java
View file @
bea56361
...
...
@@ -38,4 +38,10 @@ public class Asserts {
}
}
public
static
void
checkNotNull
(
Object
object
,
String
msg
)
{
if
(
isNull
(
object
))
{
throw
new
JobException
(
msg
);
}
}
}
dlink-core/src/main/java/com/dlink/explainer/trans/TransGenerator.java
View file @
bea56361
package
com
.
dlink
.
explainer
.
trans
;
import
com.dlink.assertion.Asserts
;
import
com.dlink.exception.SqlException
;
import
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.JsonNode
;
import
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode
;
...
...
@@ -23,7 +24,7 @@ public class TransGenerator {
this
.
plan
=
plan
;
}
public
static
Trans
get
(
String
pact
)
{
public
static
Trans
get
Trans
(
String
pact
)
{
switch
(
pact
)
{
case
OperatorTrans
.
TRANS_TYPE
:
return
new
OperatorTrans
();
...
...
@@ -42,10 +43,8 @@ public class TransGenerator {
Map
<
Integer
,
Trans
>
nodemap
=
new
HashMap
<>();
for
(
JsonNode
node
:
nodes
)
{
String
pact
=
node
.
get
(
"pact"
).
asText
();
Trans
trans
=
get
(
pact
);
if
(
trans
==
null
)
{
throw
new
SqlException
(
"该转换无法被解析,原文如下:"
+
pact
);
}
Trans
trans
=
getTrans
(
pact
);
Asserts
.
checkNotNull
(
trans
,
"该转换无法被解析,原文如下:"
+
pact
);
trans
.
build
(
node
);
nodemap
.
put
(
trans
.
getId
(),
trans
);
}
...
...
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