UNPKG

apache-arrow

Version:

Apache Arrow columnar in-memory format

54 lines (52 loc) 1.77 kB
"use strict"; // automatically generated by the FlatBuffers compiler, do not modify Object.defineProperty(exports, "__esModule", { value: true }); exports.FieldNode = void 0; /** * ---------------------------------------------------------------------- * Data structures for describing a table row batch (a collection of * equal-length Arrow arrays) * Metadata about a field at some level of a nested type tree (but not * its children). * * For example, a List<Int16> with values `[[1, 2, 3], null, [4], [5, 6], null]` * would have {length: 5, null_count: 2} for its List node, and {length: 6, * null_count: 0} for its Int16 node, as separate FieldNode structs */ class FieldNode { constructor() { this.bb = null; this.bb_pos = 0; } __init(i, bb) { this.bb_pos = i; this.bb = bb; return this; } /** * The number of value slots in the Arrow array at this level of a nested * tree */ length() { return this.bb.readInt64(this.bb_pos); } /** * The number of observed nulls. Fields with null_count == 0 may choose not * to write their physical validity bitmap out as a materialized buffer, * instead setting the length of the bitmap buffer to 0. */ nullCount() { return this.bb.readInt64(this.bb_pos + 8); } static sizeOf() { return 16; } static createFieldNode(builder, length, null_count) { builder.prep(8, 16); builder.writeInt64(BigInt(null_count !== null && null_count !== void 0 ? null_count : 0)); builder.writeInt64(BigInt(length !== null && length !== void 0 ? length : 0)); return builder.offset(); } } exports.FieldNode = FieldNode; //# sourceMappingURL=field-node.js.map