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

Ouverte Adaptée aux débutants
#11,228 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
76/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
java
Domaine
backend, databases

Piste de recherche

Lisez MosaicFileFormat.validateDataFields et les vérifications existantes pour les types non pris en charge, puis suivez la façon dont ArrowFieldTypeConversion associe la précision des horodatages. Ajoutez des tests pour TIMESTAMP(0) et TIMESTAMP(0) WITH LOCAL TIME ZONE dans les tests concernés, et confirmez que la création de tables rejette ces types avec un message clair avant toute tentative d’écriture.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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!
Langage dominant
Java
Étoiles
3.4k
Forks
1.4k
Merge moyen
1 j 10 h
PR mergées (30 j)
365

Préparer son environnement

  • Aucun Dockerfile ni fichier Docker Compose
  • Propose un modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/paimon

Toutes les issues de apache/paimon

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.