feat(jdbc): JdbcExporter, matching the CSV and Parquet exporters
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start by comparing the existing JdbcImporter and JdbcImportOptions with the CSV and Parquet exporter APIs to locate the JDBC module’s conventions. Then review the import type mapping and exporter progress listener patterns before defining the export API and binder behavior. Done means exporting rows into a caller-provided table in batches with validity-aware nulls, transaction rollback on failure, restored auto-commit, and opt-in DDL support.
索引モデルが issue の本文から書いたものです。
説明
vortex-jdbc only has JdbcImporter/JdbcImportOptions; csv and parquet each have an importer and an exporter. Add JdbcExporter + JdbcExportOptions for symmetry: read a Vortex file and move its rows into a table in a JDBC database over a caller-supplied Connection.
API sketch
JdbcExportOptions opts = JdbcExportOptions.defaults()
.withBatchSize(5_000)
.withBinder(JdbcBinder.standard()
.with(DType.Extension.class, (ps, i, value) -> ps.setObject(i, value)));
JdbcExporter.export(vortexPath, connection, "ohlc", opts);
- Options are a final class with a private constructor,
defaults()andwithXxxcopies, as everywhere else. The target table is a required argument ofexport, not an option (confirm thatCsvExporter/ParquetExportertake their target the same way). - Binder (callback): a small functional interface that sets one value on a
PreparedStatement.JdbcBinder.standard()covers primitives, strings, decimals, booleans and dates. A user overrides only the types their database needs special handling for (Postgres arrays,setObjectfor timestamps). - DDL helper, not automatic: a
DTypeto SQL type function pluscreateTableSql(name, dtype)returns aCREATE TABLEstring. The exporter never creates or alters a table on its own; creation is opt-in.
Behavior
- Appends to an existing table with
INSERT INTO t (cols...) VALUES (?, ...)through aPreparedStatement. Nulls follow the validity mask. - One transaction for the whole export: remember the connection's auto-commit setting,
setAutoCommit(false),addBatch()per row,executeBatch()everybatchSizerows,commit()at the end,rollback()and rethrow on failure, and restore auto-commit in afinally. The connection belongs to the caller. A failed export leaves nothing behind. ProgressListener, as in the other exporters.
Open design questions
- Reverse type mapping
DTypeto SQL type (the inverse ofSqlTypeToDType); it varies by database. - Create-if-missing vs truncate vs fail-if-exists: all opt-in, append is the default.
- A
withCommitEvery(n)option for very large exports, if a long-lived transaction proves a problem. Not in the first cut.
Not needed for the jdbc:vortex: driver work (#566). No demand yet, so this waits until someone needs it.
- 主要言語
- Java
- スター
- 3
- フォーク
- 2
- 平均マージ
- 9時間 47分
- マージ済み PR(30日)
- 128
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dfa1/vortex-java のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
dfa1/vortex-java#636 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
dfa1/vortex-java#655 ·
メンテナーはふだん 1 日以内に返信
-
perf
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
dfa1/vortex-java#651 ·
メンテナーはふだん 1 日以内に返信
-
Writer: string columns written as per-chunk dicts where Rust uses its dict layout (up to 2x larger)オープンperf
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
dfa1/vortex-java#650 ·
メンテナーはふだん 1 日以内に返信
-
perf
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
dfa1/vortex-java#649 ·
メンテナーはふだん 1 日以内に返信
dfa1/vortex-java の issue をすべて見る
似ている issue
-
5.0.x backport enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
spring-cloud/spring-cloud-function#1507 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
open-learning-exchange/myplanet#18484 ·
メンテナーはふだん 1 日以内に返信
-
ai-driven-fuzzing bug claude Minor
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
linagora/twake-calendar-side-service#1417 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
line/armeria#7109 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-feature/java-sdk-contrib#1966 ·
メンテナーはふだん 1 日以内に返信