-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Write mapping support #25124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Write mapping support #25124
Conversation
50a7742
to
e7b8684
Compare
b03db2f
to
de13a86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few initial comments
.gitignore
Outdated
@@ -18,6 +18,7 @@ test-reports/ | |||
.DS_Store | |||
.classpath | |||
.settings | |||
.java-version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
else if (type.getTypeSignature().getBase().equals(StandardTypes.JSON)) { | ||
return sliceMapping("jsonb", ((statement, index, value) -> { | ||
PGobject pgObject = new PGobject(); | ||
pgObject.setType("json"); | ||
pgObject.setValue(value.toStringUtf8()); | ||
statement.setObject(index, pgObject); | ||
})); | ||
} | ||
return super.toWriteMapping(type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we're also adding support for JSON types here? If so, can the JSON support be in a separate commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have another PR that will add additional type supports so I'll move it to there
} | ||
|
||
return super.toSqlType(type); | ||
else if (type.getTypeSignature().getBase().equals(StandardTypes.JSON)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if (type.getTypeSignature().getBase().equals(StandardTypes.JSON)) { | |
else if (type.getTypeSignature().getBase().equals(JSON)) { |
|
||
return super.toSqlType(type); | ||
else if (type.getTypeSignature().getBase().equals(StandardTypes.JSON)) { | ||
return sliceMapping("jsonb", ((statement, index, value) -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this jsonb
? Are we able to convert to the binary form for postgres? I think it should be json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also needs tests
c065212
to
84ded12
Compare
Codenotify: Notifying subscribers in CODENOTIFY files for diff 57a85ce...5f8e951. No notifications. |
Co-authored-by: pratyakshsharma <[email protected]>
Description
Currently, write mapping is hard coded in JdbcPageSink.appendColumn, making it difficult to add additional write support. This PR adds WriteMapping to match the ReadMapping functionality & make it possible to add additional type support on a per connector basis.
Motivation and Context
It will allow us to support additional types on a per connector basis
Impact
None
Test Plan
Unit tests
Contributor checklist
Release Notes