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
0d992253
Commit
0d992253
authored
Oct 18, 2024
by
wangpeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化判空逻辑
parent
4e0caa2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
pom.xml
dinky-cdc/dinky-cdc-core/pom.xml
+5
-0
PostgresqlCustomJsonDebeziumDeserializationSchema.java
...er/PostgresqlCustomJsonDebeziumDeserializationSchema.java
+4
-2
No files found.
dinky-cdc/dinky-cdc-core/pom.xml
View file @
0d992253
...
...
@@ -23,6 +23,11 @@
<groupId>
org.dinky
</groupId>
<artifactId>
dinky-common
</artifactId>
</dependency>
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
<version>
2.8.9
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.datatype
</groupId>
<artifactId>
jackson-datatype-jsr310
</artifactId>
...
...
dinky-cdc/dinky-cdc-core/src/main/java/org/dinky/cdc/debezium/converter/PostgresqlCustomJsonDebeziumDeserializationSchema.java
View file @
0d992253
package
org
.
dinky
.
cdc
.
debezium
.
converter
;
import
alluxio.shaded.client.
com.google.gson.Gson
;
import
alluxio.shaded.client.
com.google.gson.JsonObject
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonObject
;
import
org.apache.flink.api.common.typeinfo.BasicTypeInfo
;
import
org.apache.flink.api.common.typeinfo.TypeInformation
;
import
org.apache.flink.cdc.connectors.shaded.org.apache.kafka.connect.data.Field
;
...
...
@@ -59,6 +59,8 @@ public class PostgresqlCustomJsonDebeziumDeserializationSchema implements Debezi
private
Map
<
String
,
String
>
getBooleanWithoutDefault
(
SourceRecord
record
,
String
key
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
Objects
.
isNull
(
record
))
return
map
;
Struct
struct
=
(
Struct
)
record
.
value
();
Object
after
=
struct
.
get
(
key
);
if
(
Objects
.
nonNull
(
after
))
{
...
...
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