feat(jdbc): JdbcExporter, matching the CSV and Parquet exporters
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 3
- Forks
- 2
- Merge medio
- 9 h 47 min
- PR fusionados (30 d)
- 128
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dfa1/vortex-java
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
dfa1/vortex-java#636 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
dfa1/vortex-java#655 ·
Los mantenedores suelen responder en 1 día
-
perf
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
dfa1/vortex-java#651 ·
Los mantenedores suelen responder en 1 día
-
Writer: string columns written as per-chunk dicts where Rust uses its dict layout (up to 2x larger)Abiertoperf
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
dfa1/vortex-java#650 ·
Los mantenedores suelen responder en 1 día
-
perf
Dificultad 4/5 3-5 días Aptitud para principiantes 28/100
dfa1/vortex-java#649 ·
Los mantenedores suelen responder en 1 día
Todos los issues de dfa1/vortex-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
a2aproject/a2a-java#1275 ·
Los mantenedores suelen responder en 1 día
-
module/ftp Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ballerina-platform/ballerina-library#9476 ·
Los mantenedores suelen responder en 1 día
-
[Feature] 为世界管理页面添加打开存档文件夹按钮Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
HMCL-dev/HMCL#7175 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anwilli5/coin-collection-android-US#515 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
FasterXML/jackson-databind#6398 ·
Los mantenedores suelen responder en 1 día