Skip to content

[improve][io] JDBC Sink: add flag to exclude non-declared fields - #18008

Merged
nicoloboschi merged 5 commits into
apache:masterfrom
nicoloboschi:jdbc-flag-use-only-declared-columns
Oct 18, 2022
Merged

nicoloboschi merged 5 commits into
apache:masterfrom
nicoloboschi:jdbc-flag-use-only-declared-columns

Conversation

@nicoloboschi

Copy link
Copy Markdown
Contributor

Motivation

In the JDBC sink even if you don't add a field to key or nonKey all the table fields are read from the table metadata and included in the INSERT/UPSERT statement. This limits the possibility to leverage database fields default value.

Modifications

  • Added new flag excludeNonDeclaredFields (default false) to make the sink only include declared fields in the queries. The behavior is retro compatible with the current sinks since the default value is to still include non listed fields.

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@github-actions github-actions Bot added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Oct 11, 2022
Comment thread site2/docs/io-jdbc-sink.md Resolved

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Technoboy- Technoboy- added this to the 2.12.0 milestone Oct 17, 2022
@Technoboy- Technoboy- added type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages area/function ready-to-test labels Oct 17, 2022
@Technoboy- Technoboy- closed this Oct 17, 2022
@Technoboy- Technoboy- reopened this Oct 17, 2022
@codecov-commenter

codecov-commenter commented Oct 17, 2022 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@92b4708). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...main/java/org/apache/pulsar/io/jdbc/JdbcUtils.java 0.00% 11 Missing ⚠️
...va/org/apache/pulsar/io/jdbc/JdbcAbstractSink.java 0.00% 2 Missing ⚠️
...java/org/apache/pulsar/io/jdbc/JdbcSinkConfig.java 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #18008   +/-   ##
=========================================
  Coverage          ?   39.78%           
  Complexity        ?    14816           
=========================================
  Files             ?     1574           
  Lines             ?   128322           
  Branches          ?    14119           
=========================================
  Hits              ?    51053           
  Misses            ?    71503           
  Partials          ?     5766           
Flag Coverage Δ
unittests 39.78% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...va/org/apache/pulsar/io/jdbc/JdbcAbstractSink.java 4.16% <0.00%> (ø)
...java/org/apache/pulsar/io/jdbc/JdbcSinkConfig.java 23.33% <0.00%> (ø)
...main/java/org/apache/pulsar/io/jdbc/JdbcUtils.java 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nicoloboschi
nicoloboschi merged commit d901138 into apache:master Oct 18, 2022
nicoloboschi added a commit to datastax/pulsar that referenced this pull request Oct 18, 2022
…che#18008)

* [improve][io] JDBC Sink: add flag to exclude non declared fields

* rename and doc

* fix doc

* Update pulsar-io/jdbc/core/src/main/java/org/apache/pulsar/io/jdbc/JdbcSinkConfig.java

Co-authored-by: tison <[email protected]>

Co-authored-by: tison <[email protected]>
(cherry picked from commit d901138)
@momo-jun momo-jun changed the title [improve][io] JDBC Sink: add flag to exclude non declared fields [improve][io] JDBC Sink: add flag to exclude non-declared fields Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/function doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. ready-to-test type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants