-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrowReader.java
More file actions
34 lines (28 loc) · 1.33 KB
/
Copy pathArrowReader.java
File metadata and controls
34 lines (28 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import org.apache.arrow.vector.VectorSchemaRoot;
import org.apache.arrow.vector.types.pojo.Field;
import java.util.List;
public class ArrowReader {
public void read(VectorSchemaRoot root) {
// iterate through
List<Field> fields = root.getSchema().getFields();
// fields.stream().map(field -> {
// field.get
// });
// fields.size()
// Field field = fields.get(0);
// root.getVector(fields.get(0).getName())
// IntVector intVector = (IntVector) root.getVector(fields.get(0).getName());
// intVector.get(0)
}
public void schema() {
// ImmutableList.Builder<Field> childrenBuilder = ImmutableList.builder();
// childrenBuilder.add(new Field("int", FieldType.nullable(new ArrowType.Int(32, true)), null));
// childrenBuilder.add(new Field("long", FieldType.nullable(new ArrowType.Int(64, true)), null));
// Schema schema = new Schema(childrenBuilder.build(), null);
// VectorSchemaRoot root = VectorSchemaRoot.create(schema, allocator);
// List<Field> fields = root.getSchema().getFields();
// IntVector intVector = (IntVector) root.getVector(fields.get(0).getName());
// BigIntVector intVector = (BigIntVector) root.getVector(fields.get(0).getName());
// int Vector.get(0)
}
}