Time is rendered as DATETIME, so a time-of-day is silently stored as a 1970-01-01 timestamp
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
Línea de trabajo
Empieza reproduciendo el CREATE TABLE y las lecturas tipadas o no tipadas descritas en el issue; después, sigue el punto de entrada de compilación del dialecto para el tipo Time de SQLAlchemy Core. Se considera terminado cuando un Time no compatible se rechaza en tiempo de compilación o usa TEXT sin inventar una fecha; la reflexión y las lecturas genéricas no deben exponer silenciosamente una marca de tiempo 1970-01-01.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Versions
- databend-sqlalchemy 0.5.5
- databend-driver 0.34.2
- SQLAlchemy 2.0.51
- Python 3.12.9, macOS
- Server:
datafuselabs/databend:v1.2.925-patch-4in Docker
What happens
Databend has no time-of-day type. Its parser says so by listing what it will take:
CREATE TABLE probe (clock TIME)
-> unexpected `TIME`, expecting `TIMESTAMP`, `TIMESTAMP_TZ`, `TEXT`, … `DATE`, … `DATETIME`, …
The dialect renders Core's Time as DATETIME. The column is created, and the substitution is invisible from Core, because SQLAlchemy's own Time type re-derives the value on the way out:
- typed
select()on the column hands backtime(14, 30)— looks correct - the same column read without the Core type in play is
1970-01-01T14:30:00Z inspect()reports the column type asDATETIME
So it round-trips correctly through a typed Core select and is wrong through everything else: reflection, any consumer reading the column generically, anything comparing against another engine's storage of the same value.
Why this is the awkward failure mode
A column that couldn't be created is a five-minute problem. A column that exists and quietly holds a different type is the kind that surfaces months later, in whichever consumer wasn't going through Core's typed path. The date part isn't neutral either — it's a real 1970-01-01 sitting in the data, and it sorts and compares as one.
Suggested fix
Refuse Time at compile time on an engine that has no such type, the same way an unsupported type is refused elsewhere. If a substitution is preferred over a refusal, TEXT at least doesn't invent a date, but I'd rather it just raised.
- Lenguaje dominante
- Python
- Estrellas
- 15
- Forks
- 5
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 1
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 databendlabs/databend-sqlalchemy
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Index.create() reports success and creates nothing: the compiler emits an empty string and the connector returns earlyPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
do_rollback() swallows the connector's NotSupportedError, so a rollback reports success over a write that standsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
databendlabs/databend-sqlalchemy#58 · 1 comentario ·
Todos los issues de databendlabs/databend-sqlalchemy
Issues similares
-
HandyModRTransform.deriv3 is wrong for m > 2Posiblemente ocupada @SajalDevX la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
read_messages: the first read after subscribe/psubscribe returns no messages even when some are waitingPosiblemente ocupada @matheussilvano la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
The-Swarm-Corporation/swarms-framework-docs#399 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
bump patch
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
autowarefoundation/autoware_carla_scenario#1321 ·
Los mantenedores suelen responder en 1 día