feat(jdbc): JdbcExporter, matching the CSV and Parquet exporters
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Java
- Étoiles
- 3
- Forks
- 2
- Merge moyen
- 14 h 59 min
- PR mergées (30 j)
- 137
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de dfa1/vortex-java
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
dfa1/vortex-java#636 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
dfa1/vortex-java#634 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
dfa1/vortex-java#601 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 30/100
dfa1/vortex-java#583 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
dfa1/vortex-java#548 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de dfa1/vortex-java
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 3 jours
-
A proxy that fails to start logs a RejectedExecutionException stack trace from its shutdown hookOuvertefollow-up
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Sanne/incus-spawn#1953 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Shweit/EtherealPortals#30 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 70/100
checkstyle/checkstyle#22398 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Typo in jakartaee-bom 12.0.0-SNAPSHOT with cdiPeut-être pris @ElectLive l’a pris aujourd’hui. Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 80/100
jakartaee/jakartaee-api#205 · 1 commentaire ·