apache / apache/arrow-dotnet

Add a new TimeUnit for dotnet ticks

Aperta
#246 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C#
Stelle
39
Fork
30
Merge medio
1g 9h
PR unite (30g)
16

Descrizione

### Describe the enhancement requested

When serializing a DateTimeOffset into an Arrow type, the TimestampType feels like a natural choice. However there is no time unit which fully represents both the precision and range of a C# DateTimeOffset. A DateTimeOffset tick is 100 nanoseconds long and the full range of representable values is between years 0001 and 9999 according to the [documentation](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset?view=netstandard-2.0).

There are currently 2 options for TimeUnit when converting a C# DateTimeOffset to TimestampType

- TimeUnit.Microseconds : Lose precision but be able to fully convert every valid DateTimeOffset to Timestamp
- TimeUnit.Nanoseconds : Keep precision, but the range of representable calendar years is reduced to 1677 - 2262

Of course, users could serialize DateTimeOffset into a long in the Arrow Table and remember the type when deserializing. However, it would be nice to preserve the type information. Having a new TimeUnit equal to a tick would solve this tension.

I appreciate that adding a new time unit would be a fundamental change to arrow across more than just the .NET ecosystem, please let me know if this has been considered before or if the discussion needs to be moved elsewhere.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Iniziate esaminando le opzioni TimeUnit esistenti e i percorsi di conversione di TimestampType per C# DateTimeOffset. Determinate le implicazioni tra gli ecosistemi dell’aggiunta di un’unità tick da 100 nanosecondi e definite il comportamento di compatibilità e serializzazione che costituirebbe una proposta completa.

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

Valutazione

Stack tecnologico
csharp
Ambito
data
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.