JDBC: ResultSet.getObject(int, java.time.OffsetTime.class) fails for TIME_WITH_TIME_ZONE column
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start by reproducing the failure with the time_tz_col TIME WITH TIME ZONE table from the issue and a ResultSet.getObject(1, OffsetTime.class) call. Then find where the driver converts a TIME_WITH_TIME_ZONE value for a requested Java class, and check why OffsetTime is reported by the metadata but rejected by the typed getter. Done means the call returns the stored time with its offset, and a regression test covers it.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug description
For a TIME WITH TIME ZONE column, DuckDB JDBC reports java.time.OffsetTime as the column class through ResultSetMetaData, but ResultSet.getObject(..., OffsetTime.class) fails with a conversion error.
Reproduction
Create a table containing a TIME WITH TIME ZONE column:
CREATE TABLE test_table (
time_tz_col TIME WITH TIME ZONE NOT NULL
);
Execute a simple query:
SELECT time_tz_col FROM test_table;
The ResultSetMetaData correctly reports:
| Metadata | Value |
|---|---|
getColumnName() |
time_tz_col |
getColumnTypeName() |
TIME WITH TIME ZONE |
getColumnType() |
2013 (java.sql.Types.TIME_WITH_TIMEZONE) |
getColumnClassName() |
java.time.OffsetTime |
These metadata values appear correct and indicate that the JDBC driver maps TIME WITH TIME ZONE to java.time.OffsetTime.
However, attempting to retrieve the value using the corresponding JDBC typed getter fails:
OffsetTime value = resultSet.getObject(1, OffsetTime.class);
Results in:
java.sql.SQLException: Can't convert value to class java.time.OffsetTime, SQL type: TIME_WITH_TIME_ZONE
Environment
- DuckDB JDBC: 1.5.6.0
- SQL type:
TIME WITH TIME ZONE - Java type reported by metadata:
java.time.OffsetTime - JDBC type:
java.sql.Types.TIME_WITH_TIMEZONE(2013)
- Lenguaje dominante
- C++
- Estrellas
- 127
- Forks
- 82
- Merge medio
- 13 h 55 min
- PR fusionados (30 d)
- 30
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 duckdb/duckdb-java
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
duckdb/duckdb-java#832 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 60/100
duckdb/duckdb-java#901 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 Medio día Aptitud para principiantes 55/100
duckdb/duckdb-java#900 ·
Los mantenedores suelen responder en 1 día
-
Native SIGSEGV in DuckDB JDBC when repeatedly executing queries with window functions and LIMIT 0Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
duckdb/duckdb-java#871 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
duckdb/duckdb-java#872 ·
Los mantenedores suelen responder en 1 día
Todos los issues de duckdb/duckdb-java
Issues similares
-
bug format I/O medium priority rt_lib
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
raspberrypi/rpi-imager#1775 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
compiler-explorer/compiler-explorer#9272 ·
Los mantenedores suelen responder en 1 día
-
【问题】在文件树重命名文件,发现无法用鼠标选中一段文字Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100