apache / apache/arrow-java

How to iterate over a record batch?

Aperta
#468 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Type: usage
Lingua principale
Java
Stelle
94
Fork
152
Merge medio
3g 16h
PR unite (30g)
11

Descrizione

### Describe the usage question you have. Please include as many useful details as possible.

Now I have a `VectorSchemaRoot`. I can see to iterate over the batch with `getVector` and then `getObject`.

But the return value is of type `Obejct`. And I wonder how I can downcast it for some useful class I can retrieve the real value (string, int, float, etc.).

I know we have the field info of each vetcor, but I don't know the mapping between field type to real Java class. It looks over challenge to remember all the mapping by reverse engineering the code, and it may change as version evolves.

I checked https://arrow.apache.org/docs/java/index.html but all the pages tell about constructing a batch and how to move it from one place to another, rather than tell about how to read and dump a batch to a typed two-dimensional matrix.

The most trivial usage, `contentToTSVString`, call `Object::toString` on each cell. But I don't thing we should convert all the values to String and reparse it to concrete type.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con l’uso di VectorSchemaRoot, getVector, getObject e contentToTSVString descritto nell’issue, quindi confrontalo con la documentazione Java collegata. Individua il modo documentato per leggere ogni vettore con il relativo tipo Java concreto e considera concluso il lavoro quando un nuovo contributore può iterare su un batch senza dover ricostruire tramite reverse engineering le corrispondenze dei tipi né analizzare nuovamente le stringhe.

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

Valutazione

Stack tecnologico
java
Ambito
data
Tipo di issue
Documentazione
Difficoltà
3/5
Tempo stimato
1-2 giorni
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.