[Bug] Mosaic accepts TIMESTAMP(0) columns that its native writer cannot write

Aperta Adatta ai principianti
#11,228 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
backend, databases

Direzione di ricerca

Leggi MosaicFileFormat.validateDataFields e i controlli esistenti per i tipi non supportati, quindi segui il modo in cui ArrowFieldTypeConversion mappa la precisione dei timestamp. Aggiungi test per TIMESTAMP(0) e TIMESTAMP(0) WITH LOCAL TIME ZONE nei test pertinenti e conferma che la creazione della tabella rifiuta questi tipi con un messaggio chiaro prima di tentare una scrittura.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version
master @ 33dbcfcb17

Compute Engine
Engine-agnostic (Mosaic file format).

Minimal reproduce step
Create a table with 'file.format' = 'mosaic' and a TIMESTAMP(0) or TIMESTAMP(0) WITH LOCAL TIME ZONE column, then insert a row. CREATE TABLE succeeds, but every write fails when the file is opened:

java.lang.RuntimeException: writer open failed: unsupported Timestamp unit: Second

ArrowFieldTypeConversion maps precision 0 to the Arrow SECOND unit, and the Mosaic native writer only accepts millisecond, microsecond and nanosecond timestamps (validate_data_type in apache/paimon-mosaic core/src/types.rs). Precisions 1 to 9 write fine.

MySQL CDC maps DATETIME without a precision to TIMESTAMP(0), so a CDC job into a Mosaic table hits this on its first write.

What doesn't meet your expectations?
MosaicFileFormat.validateDataFields should reject TIMESTAMP(0) the way it already rejects VARIANT, BLOB, VECTOR, MULTISET and ROW, so the table definition fails with a message that names the type, instead of every write failing later with a native error that names neither the column nor the format.

Anything else?
Storing precision 0 as milliseconds would make the type writable, but it needs matching changes on the write and read sides of the Arrow conversion. Rejecting it is the smaller fix.

Are you willing to submit a PR?

  • I'm willing to submit a PR!
Lingua principale
Java
Stelle
3.4k
Fork
1.4k
Merge medio
1g 10h
PR unite (30g)
365

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/paimon

Tutte le issue di apache/paimon

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.