JDBC: ResultSet.getObject(int, java.sql.Struct.class) fails for STRUCT column
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 55/100
Direzione di ricerca
The failing call is ResultSet.getObject(int, Class) with java.sql.Struct.class, which throws "Can't convert value to interface java.sql.Struct". Start in the JDBC result set's getObject type-conversion path and see how it handles STRUCT, and check how org.duckdb.DuckDBStruct implements java.sql.Struct. Reproduce with the CREATE TABLE and SELECT from the issue. Done when getObject with Struct.class returns the struct for a STRUCT column and a test covers it.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug description
For a STRUCT column, DuckDB JDBC reports org.duckdb.DuckDBStruct as the column class through ResultSetMetaData, which extends java.sql.Struct, but ResultSet.getObject(..., Struct.class) fails with a conversion error.
Reproduction
Create a table containing a STRUCT column:
CREATE TABLE test_table (
struct_col STRUCT(name VARCHAR, age INTEGER) NOT NULL
);
Execute a simple query:
SELECT struct_col FROM test_table;
The ResultSetMetaData reports:
| Metadata | Value |
|---|---|
getColumnName() |
struct_col |
getColumnTypeName() |
STRUCT("name" VARCHAR, age INTEGER) |
getColumnType() |
2002 (java.sql.Types.STRUCT) |
getColumnClassName() |
org.duckdb.DuckDBStruct |
DuckDBStruct implements java.sql.Struct.
However, attempting to retrieve the value using the standard JDBC typed getter:
Struct value = resultSet.getObject(1, Struct.class);
fails with:
java.sql.SQLException: Can't convert value to interface java.sql.Struct, SQL type: STRUCT
I am using ResultSet.getObject(index, Struct.class) because getStruct() is only exposed through the DuckDB-specific org.duckdb.DuckDBResultSet, rather than the standard java.sql.ResultSet interface.
Environment
- DuckDB JDBC: 1.5.6.0
- SQL type:
STRUCT - Java type reported by metadata:
org.duckdb.DuckDBStruct - JDBC type:
java.sql.Types.STRUCT(2002)
- Lingua principale
- C++
- Stelle
- 127
- Fork
- 83
- Merge medio
- 13h 55m
- PR unite (30g)
- 30
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di duckdb/duckdb-java
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
duckdb/duckdb-java#832 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 60/100
duckdb/duckdb-java#901 ·
I maintainer di solito rispondono entro 1 giorno
-
JDBC: ResultSet.getObject(int, java.time.OffsetTime.class) fails for TIME_WITH_TIME_ZONE columnAperta
Difficoltà 3/5 Mezza giornata Idoneità per principianti 55/100
duckdb/duckdb-java#899 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Native SIGSEGV in DuckDB JDBC when repeatedly executing queries with window functions and LIMIT 0Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
duckdb/duckdb-java#871 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
duckdb/duckdb-java#872 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di duckdb/duckdb-java
Issue simili
-
llvm.memcpy with destination align but no source align asserts "Missed Source alignment!"Forse già presa @pvelesko l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
KhronosGroup/SPIRV-LLVM-Translator#4093 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
SIMQ silently truncates multi-query batch search to the first queryForse già presa @LHT129 l’ha presa oggi. Apertakind/bug module/index needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
antgroup/vsag#3080 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
KhronosGroup/glslang#4469 ·
I maintainer di solito rispondono entro 1 giorno