Skip to content

Add a JDBC write mapping interface#25437

Merged
rschlussel merged 1 commit intoprestodb:masterfrom
infvg:writemapping
Jul 14, 2025
Merged

Add a JDBC write mapping interface#25437
rschlussel merged 1 commit intoprestodb:masterfrom
infvg:writemapping

Conversation

@infvg
Copy link
Contributor

@infvg infvg commented Jun 25, 2025

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

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== RELEASE NOTES ==

JDBC Driver Changes
* Improve type mapping API to add WriteMapping functionality.

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Jun 25, 2025
@infvg infvg changed the title Add write mapping Add a JDBC write mapping interface Jun 25, 2025
@infvg infvg marked this pull request as ready for review June 25, 2025 12:45
@infvg infvg requested a review from a team as a code owner June 25, 2025 12:45
@prestodb-ci prestodb-ci requested review from a team, bibith4 and wanglinsong and removed request for a team June 25, 2025 12:45
@pratyakshsharma
Copy link
Contributor

@infvg Did we have a discussion with Meta people around this? Are they fine with it this time?

@infvg infvg force-pushed the writemapping branch 3 times, most recently from c7b3afd to 4f4b59a Compare June 30, 2025 18:05
@steveburnett
Copy link
Contributor

Thanks for the release note entry! Consider adding a little explanation of how what benefit this gives.

@zation99
Copy link
Contributor

zation99 commented Jun 30, 2025

More context of this PR: it is an update from #25124 which was reverted in #25369.

The difference is that instead of replacing ReadMapping class with ColumnMapping (as in #25124), this PR keeps ReadMapping. So now we have ReadMapping+WriteMapping which makes the code structure more intuitive.

This change was done after our offline discussion on the approach to address the original motivation.

CC: @rschlussel @gggrace14

@infvg infvg force-pushed the writemapping branch 2 times, most recently from 2d351d4 to 8978d9c Compare July 1, 2025 11:08
zation99
zation99 previously approved these changes Jul 1, 2025

/*
* JDBC based connectors can control how data should be read from a ResultSet via ReadMapping definitions. But writing was
* hard-coded in JdbcPageSink#appendColumn. This class provides the control to define how data should be written back to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment seems should be in WriteMapping class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment for both classes

@prestodb-ci
Copy link
Contributor

@ethanyzhang imported this issue as lakehouse/presto #25437

Co-authored-by: pratyakshsharma <pratyaksh13@gmail.com>
@rschlussel rschlussel merged commit 078270c into prestodb:master Jul 14, 2025
108 checks passed
@shangm2 shangm2 mentioned this pull request Jul 14, 2025
6 tasks
shangm2 added a commit that referenced this pull request Jul 15, 2025
## Description
1. Build fails on master branch due to
#25437
2. Newly created pr failed
<img width="1034" height="204" alt="Screenshot 2025-07-14 at 14 32 35"
src="https://github.com/user-attachments/assets/b15b07dc-5232-46f0-8dc0-e17005996c0f"
/>

## Motivation and Context
<!---Why is this change required? What problem does it solve?-->
<!---If it fixes an open issue, please link to the issue here.-->

## Impact
<!---Describe any public API or user-facing feature change or any
performance impact-->

## Test Plan
<!---Please fill in how you tested your change-->

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.

## Release Notes

```
== NO RELEASE NOTE ==
```
@prestodb-ci prestodb-ci mentioned this pull request Jul 28, 2025
6 tasks
lga-zurich pushed a commit to lga-zurich/presto-exchange that referenced this pull request Sep 2, 2025
## Description
1. Build fails on master branch due to
prestodb#25437
2. Newly created pr failed
<img width="1034" height="204" alt="Screenshot 2025-07-14 at 14 32 35"
src="https://github.com/user-attachments/assets/b15b07dc-5232-46f0-8dc0-e17005996c0f"
/>

## Motivation and Context
<!---Why is this change required? What problem does it solve?-->
<!---If it fixes an open issue, please link to the issue here.-->

## Impact
<!---Describe any public API or user-facing feature change or any
performance impact-->

## Test Plan
<!---Please fill in how you tested your change-->

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.

## Release Notes

```
== NO RELEASE NOTE ==
```
lga-zurich pushed a commit to lga-zurich/presto-exchange that referenced this pull request Sep 8, 2025
## Description
1. Build fails on master branch due to
prestodb#25437
2. Newly created pr failed
<img width="1034" height="204" alt="Screenshot 2025-07-14 at 14 32 35"
src="https://github.com/user-attachments/assets/b15b07dc-5232-46f0-8dc0-e17005996c0f"
/>

## Motivation and Context
<!---Why is this change required? What problem does it solve?-->
<!---If it fixes an open issue, please link to the issue here.-->

## Impact
<!---Describe any public API or user-facing feature change or any
performance impact-->

## Test Plan
<!---Please fill in how you tested your change-->

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.

## Release Notes

```
== NO RELEASE NOTE ==
```
lga-zurich pushed a commit to lga-zurich/presto-exchange that referenced this pull request Sep 8, 2025
## Description
1. Build fails on master branch due to
prestodb#25437
2. Newly created pr failed
<img width="1034" height="204" alt="Screenshot 2025-07-14 at 14 32 35"
src="https://github.com/user-attachments/assets/b15b07dc-5232-46f0-8dc0-e17005996c0f"
/>

## Motivation and Context
<!---Why is this change required? What problem does it solve?-->
<!---If it fixes an open issue, please link to the issue here.-->

## Impact
<!---Describe any public API or user-facing feature change or any
performance impact-->

## Test Plan
<!---Please fill in how you tested your change-->

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.

## Release Notes

```
== NO RELEASE NOTE ==
```
lga-zurich pushed a commit to lga-zurich/presto-exchange that referenced this pull request Sep 8, 2025
## Description
1. Build fails on master branch due to
prestodb#25437
2. Newly created pr failed
<img width="1034" height="204" alt="Screenshot 2025-07-14 at 14 32 35"
src="https://github.com/user-attachments/assets/b15b07dc-5232-46f0-8dc0-e17005996c0f"
/>

## Motivation and Context
<!---Why is this change required? What problem does it solve?-->
<!---If it fixes an open issue, please link to the issue here.-->

## Impact
<!---Describe any public API or user-facing feature change or any
performance impact-->

## Test Plan
<!---Please fill in how you tested your change-->

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.

## Release Notes

```
== NO RELEASE NOTE ==
```
lga-zurich pushed a commit to lga-zurich/presto-exchange that referenced this pull request Sep 8, 2025
## Description
1. Build fails on master branch due to
prestodb#25437
2. Newly created pr failed
<img width="1034" height="204" alt="Screenshot 2025-07-14 at 14 32 35"
src="https://github.com/user-attachments/assets/b15b07dc-5232-46f0-8dc0-e17005996c0f"
/>

## Motivation and Context
<!---Why is this change required? What problem does it solve?-->
<!---If it fixes an open issue, please link to the issue here.-->

## Impact
<!---Describe any public API or user-facing feature change or any
performance impact-->

## Test Plan
<!---Please fill in how you tested your change-->

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.

## Release Notes

```
== NO RELEASE NOTE ==
```
lga-zurich pushed a commit to lga-zurich/presto-exchange that referenced this pull request Sep 8, 2025
## Description
1. Build fails on master branch due to
prestodb#25437
2. Newly created pr failed
<img width="1034" height="204" alt="Screenshot 2025-07-14 at 14 32 35"
src="https://github.com/user-attachments/assets/b15b07dc-5232-46f0-8dc0-e17005996c0f"
/>

## Motivation and Context
<!---Why is this change required? What problem does it solve?-->
<!---If it fixes an open issue, please link to the issue here.-->

## Impact
<!---Describe any public API or user-facing feature change or any
performance impact-->

## Test Plan
<!---Please fill in how you tested your change-->

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.

## Release Notes

```
== NO RELEASE NOTE ==
```
lga-zurich pushed a commit to lga-zurich/presto-exchange that referenced this pull request Sep 8, 2025
## Description
1. Build fails on master branch due to
prestodb#25437
2. Newly created pr failed
<img width="1034" height="204" alt="Screenshot 2025-07-14 at 14 32 35"
src="https://github.com/user-attachments/assets/b15b07dc-5232-46f0-8dc0-e17005996c0f"
/>

## Motivation and Context
<!---Why is this change required? What problem does it solve?-->
<!---If it fixes an open issue, please link to the issue here.-->

## Impact
<!---Describe any public API or user-facing feature change or any
performance impact-->

## Test Plan
<!---Please fill in how you tested your change-->

## Contributor checklist

- [ ] Please make sure your submission complies with our [contributing
guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md),
in particular [code
style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style)
and [commit
standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards).
- [ ] PR description addresses the issue accurately and concisely. If
the change is non-trivial, a GitHub Issue is referenced.
- [ ] Documented new properties (with its default value), SQL syntax,
functions, or other functionality.
- [ ] If release notes are required, they follow the [release notes
guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines).
- [ ] Adequate tests were added if applicable.
- [ ] CI passed.

## Release Notes

```
== NO RELEASE NOTE ==
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants