Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@apache-arrow/es2015-esm

Package Overview
Dependencies
Maintainers
5
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apache-arrow/es2015-esm - npm Package Compare versions

Comparing version 0.13.0 to 0.14.0

builder.d.ts

10

Arrow.d.ts
/// <reference types="flatbuffers" />
export { ArrowType, DateUnit, IntervalUnit, MessageHeader, MetadataVersion, Precision, TimeUnit, Type, UnionMode, VectorType } from './enum';
export { ArrowType, DateUnit, IntervalUnit, MessageHeader, MetadataVersion, Precision, TimeUnit, Type, UnionMode, BufferType } from './enum';
export { Data } from './data';

@@ -7,5 +7,6 @@ export { DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Binary, FixedSizeBinary, Date_, DateDay, DateMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Decimal, List, Struct, Union, DenseUnion, SparseUnion, Dictionary, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Map_, } from './type';

export { Column } from './column';
export { Visitor } from './visitor';
export { Schema, Field } from './schema';
export { Visitor } from './visitor';
export { Row, Vector, BaseVector, BinaryVector, BoolVector, Chunked, DateVector, DateDayVector, DateMillisecondVector, DecimalVector, DictionaryVector, FixedSizeBinaryVector, FixedSizeListVector, FloatVector, Float16Vector, Float32Vector, Float64Vector, IntervalVector, IntervalDayTimeVector, IntervalYearMonthVector, IntVector, Int8Vector, Int16Vector, Int32Vector, Int64Vector, Uint8Vector, Uint16Vector, Uint32Vector, Uint64Vector, ListVector, MapVector, NullVector, StructVector, TimestampVector, TimestampSecondVector, TimestampMillisecondVector, TimestampMicrosecondVector, TimestampNanosecondVector, TimeVector, TimeSecondVector, TimeMillisecondVector, TimeMicrosecondVector, TimeNanosecondVector, UnionVector, DenseUnionVector, SparseUnionVector, Utf8Vector, } from './vector/index';
export { Builder, BinaryBuilder, BoolBuilder, DateBuilder, DateDayBuilder, DateMillisecondBuilder, DecimalBuilder, DictionaryBuilder, FixedSizeBinaryBuilder, FixedSizeListBuilder, FloatBuilder, Float16Builder, Float32Builder, Float64Builder, IntervalBuilder, IntervalDayTimeBuilder, IntervalYearMonthBuilder, IntBuilder, Int8Builder, Int16Builder, Int32Builder, Int64Builder, Uint8Builder, Uint16Builder, Uint32Builder, Uint64Builder, ListBuilder, MapBuilder, NullBuilder, StructBuilder, TimestampBuilder, TimestampSecondBuilder, TimestampMillisecondBuilder, TimestampMicrosecondBuilder, TimestampNanosecondBuilder, TimeBuilder, TimeSecondBuilder, TimeMillisecondBuilder, TimeMicrosecondBuilder, TimeNanosecondBuilder, UnionBuilder, DenseUnionBuilder, SparseUnionBuilder, Utf8Builder, } from './builder/index';
export { ByteStream, AsyncByteStream, AsyncByteQueue, ReadableSource, WritableSink } from './io/stream';

@@ -19,2 +20,3 @@ export { RecordBatchReader, RecordBatchFileReader, RecordBatchStreamReader, AsyncRecordBatchFileReader, AsyncRecordBatchStreamReader } from './ipc/reader';

export { DataFrame, FilteredDataFrame, CountByResult, BindFunc, NextFunc } from './compute/dataframe';
import * as util_bn_ from './util/bn';
import * as util_int_ from './util/int';

@@ -94,2 +96,6 @@ import * as util_buffer_ from './util/buffer';

Int128: typeof util_int_.Int128;
isArrowBigNumSymbol: typeof util_bn_.isArrowBigNumSymbol;
bignumToString: <T extends util_bn_.BN<Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array>>(a: T) => string;
bignumToBigInt: <T extends util_bn_.BN<Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array>>(a: T) => bigint;
BN: typeof util_bn_.BN;
};

2

Arrow.dom.d.ts

@@ -1,1 +0,1 @@

export { ArrowType, DateUnit, IntervalUnit, MessageHeader, MetadataVersion, Precision, TimeUnit, Type, UnionMode, VectorType, Data, DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Binary, FixedSizeBinary, Date_, DateDay, DateMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Decimal, List, Struct, Union, DenseUnion, SparseUnion, Dictionary, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Map_, Table, Column, Schema, Field, Visitor, Vector, BaseVector, BinaryVector, BoolVector, Chunked, DateVector, DateDayVector, DateMillisecondVector, DecimalVector, DictionaryVector, FixedSizeBinaryVector, FixedSizeListVector, FloatVector, Float16Vector, Float32Vector, Float64Vector, IntervalVector, IntervalDayTimeVector, IntervalYearMonthVector, IntVector, Int8Vector, Int16Vector, Int32Vector, Int64Vector, Uint8Vector, Uint16Vector, Uint32Vector, Uint64Vector, ListVector, MapVector, NullVector, StructVector, TimestampVector, TimestampSecondVector, TimestampMillisecondVector, TimestampMicrosecondVector, TimestampNanosecondVector, TimeVector, TimeSecondVector, TimeMillisecondVector, TimeMicrosecondVector, TimeNanosecondVector, UnionVector, DenseUnionVector, SparseUnionVector, Utf8Vector, ByteStream, AsyncByteStream, AsyncByteQueue, ReadableSource, WritableSink, RecordBatchReader, RecordBatchFileReader, RecordBatchStreamReader, AsyncRecordBatchFileReader, AsyncRecordBatchStreamReader, RecordBatchWriter, RecordBatchFileWriter, RecordBatchStreamWriter, RecordBatchJSONWriter, MessageReader, AsyncMessageReader, JSONMessageReader, Message, RecordBatch, ArrowJSONLike, FileHandle, Readable, Writable, ReadableWritable, ReadableDOMStreamOptions, DataFrame, FilteredDataFrame, CountByResult, BindFunc, NextFunc, predicate, util } from './Arrow';
export { ArrowType, DateUnit, IntervalUnit, MessageHeader, MetadataVersion, Precision, TimeUnit, Type, UnionMode, BufferType, Data, DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Binary, FixedSizeBinary, Date_, DateDay, DateMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Decimal, List, Struct, Union, DenseUnion, SparseUnion, Dictionary, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Map_, Table, Column, Schema, Field, Visitor, Vector, BaseVector, BinaryVector, BoolVector, Chunked, DateVector, DateDayVector, DateMillisecondVector, DecimalVector, DictionaryVector, FixedSizeBinaryVector, FixedSizeListVector, FloatVector, Float16Vector, Float32Vector, Float64Vector, IntervalVector, IntervalDayTimeVector, IntervalYearMonthVector, IntVector, Int8Vector, Int16Vector, Int32Vector, Int64Vector, Uint8Vector, Uint16Vector, Uint32Vector, Uint64Vector, ListVector, MapVector, NullVector, StructVector, TimestampVector, TimestampSecondVector, TimestampMillisecondVector, TimestampMicrosecondVector, TimestampNanosecondVector, TimeVector, TimeSecondVector, TimeMillisecondVector, TimeMicrosecondVector, TimeNanosecondVector, UnionVector, DenseUnionVector, SparseUnionVector, Utf8Vector, ByteStream, AsyncByteStream, AsyncByteQueue, ReadableSource, WritableSink, RecordBatchReader, RecordBatchFileReader, RecordBatchStreamReader, AsyncRecordBatchFileReader, AsyncRecordBatchStreamReader, RecordBatchWriter, RecordBatchFileWriter, RecordBatchStreamWriter, RecordBatchJSONWriter, MessageReader, AsyncMessageReader, JSONMessageReader, Message, RecordBatch, ArrowJSONLike, FileHandle, Readable, Writable, ReadableWritable, ReadableDOMStreamOptions, DataFrame, FilteredDataFrame, CountByResult, BindFunc, NextFunc, predicate, util, Builder, BinaryBuilder, BoolBuilder, DateBuilder, DateDayBuilder, DateMillisecondBuilder, DecimalBuilder, DictionaryBuilder, FixedSizeBinaryBuilder, FixedSizeListBuilder, FloatBuilder, Float16Builder, Float32Builder, Float64Builder, IntervalBuilder, IntervalDayTimeBuilder, IntervalYearMonthBuilder, IntBuilder, Int8Builder, Int16Builder, Int32Builder, Int64Builder, Uint8Builder, Uint16Builder, Uint32Builder, Uint64Builder, ListBuilder, MapBuilder, NullBuilder, StructBuilder, TimestampBuilder, TimestampSecondBuilder, TimestampMillisecondBuilder, TimestampMicrosecondBuilder, TimestampNanosecondBuilder, TimeBuilder, TimeSecondBuilder, TimeMillisecondBuilder, TimeMicrosecondBuilder, TimeNanosecondBuilder, UnionBuilder, DenseUnionBuilder, SparseUnionBuilder, Utf8Builder, } from './Arrow';

@@ -18,12 +18,15 @@ // Licensed to the Apache Software Foundation (ASF) under one

import streamAdapters from './io/adapters';
import { Builder } from './builder/index';
import { RecordBatchReader } from './ipc/reader';
import { RecordBatchWriter } from './ipc/writer';
import { toDOMStream } from './ipc/whatwg/iterable';
import { recordBatchReaderThroughDOMStream } from './ipc/whatwg/reader';
import { recordBatchWriterThroughDOMStream } from './ipc/whatwg/writer';
import { toDOMStream } from './io/whatwg/iterable';
import { builderThroughDOMStream } from './io/whatwg/builder';
import { recordBatchReaderThroughDOMStream } from './io/whatwg/reader';
import { recordBatchWriterThroughDOMStream } from './io/whatwg/writer';
streamAdapters.toDOMStream = toDOMStream;
Builder['throughDOM'] = builderThroughDOMStream;
RecordBatchReader['throughDOM'] = recordBatchReaderThroughDOMStream;
RecordBatchWriter['throughDOM'] = recordBatchWriterThroughDOMStream;
export { ArrowType, DateUnit, IntervalUnit, MessageHeader, MetadataVersion, Precision, TimeUnit, Type, UnionMode, VectorType, Data, DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Binary, FixedSizeBinary, Date_, DateDay, DateMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Decimal, List, Struct, Union, DenseUnion, SparseUnion, Dictionary, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Map_, Table, Column, Schema, Field, Visitor, Vector, BaseVector, BinaryVector, BoolVector, Chunked, DateVector, DateDayVector, DateMillisecondVector, DecimalVector, DictionaryVector, FixedSizeBinaryVector, FixedSizeListVector, FloatVector, Float16Vector, Float32Vector, Float64Vector, IntervalVector, IntervalDayTimeVector, IntervalYearMonthVector, IntVector, Int8Vector, Int16Vector, Int32Vector, Int64Vector, Uint8Vector, Uint16Vector, Uint32Vector, Uint64Vector, ListVector, MapVector, NullVector, StructVector, TimestampVector, TimestampSecondVector, TimestampMillisecondVector, TimestampMicrosecondVector, TimestampNanosecondVector, TimeVector, TimeSecondVector, TimeMillisecondVector, TimeMicrosecondVector, TimeNanosecondVector, UnionVector, DenseUnionVector, SparseUnionVector, Utf8Vector, ByteStream, AsyncByteStream, AsyncByteQueue, RecordBatchReader, RecordBatchFileReader, RecordBatchStreamReader, AsyncRecordBatchFileReader, AsyncRecordBatchStreamReader, RecordBatchWriter, RecordBatchFileWriter, RecordBatchStreamWriter, RecordBatchJSONWriter, MessageReader, AsyncMessageReader, JSONMessageReader, Message, RecordBatch, DataFrame, FilteredDataFrame, CountByResult, predicate, util } from './Arrow';
export { ArrowType, DateUnit, IntervalUnit, MessageHeader, MetadataVersion, Precision, TimeUnit, Type, UnionMode, BufferType, Data, DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Binary, FixedSizeBinary, Date_, DateDay, DateMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Decimal, List, Struct, Union, DenseUnion, SparseUnion, Dictionary, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Map_, Table, Column, Schema, Field, Visitor, Vector, BaseVector, BinaryVector, BoolVector, Chunked, DateVector, DateDayVector, DateMillisecondVector, DecimalVector, DictionaryVector, FixedSizeBinaryVector, FixedSizeListVector, FloatVector, Float16Vector, Float32Vector, Float64Vector, IntervalVector, IntervalDayTimeVector, IntervalYearMonthVector, IntVector, Int8Vector, Int16Vector, Int32Vector, Int64Vector, Uint8Vector, Uint16Vector, Uint32Vector, Uint64Vector, ListVector, MapVector, NullVector, StructVector, TimestampVector, TimestampSecondVector, TimestampMillisecondVector, TimestampMicrosecondVector, TimestampNanosecondVector, TimeVector, TimeSecondVector, TimeMillisecondVector, TimeMicrosecondVector, TimeNanosecondVector, UnionVector, DenseUnionVector, SparseUnionVector, Utf8Vector, ByteStream, AsyncByteStream, AsyncByteQueue, RecordBatchReader, RecordBatchFileReader, RecordBatchStreamReader, AsyncRecordBatchFileReader, AsyncRecordBatchStreamReader, RecordBatchWriter, RecordBatchFileWriter, RecordBatchStreamWriter, RecordBatchJSONWriter, MessageReader, AsyncMessageReader, JSONMessageReader, Message, RecordBatch, DataFrame, FilteredDataFrame, CountByResult, predicate, util, Builder, BinaryBuilder, BoolBuilder, DateBuilder, DateDayBuilder, DateMillisecondBuilder, DecimalBuilder, DictionaryBuilder, FixedSizeBinaryBuilder, FixedSizeListBuilder, FloatBuilder, Float16Builder, Float32Builder, Float64Builder, IntervalBuilder, IntervalDayTimeBuilder, IntervalYearMonthBuilder, IntBuilder, Int8Builder, Int16Builder, Int32Builder, Int64Builder, Uint8Builder, Uint16Builder, Uint32Builder, Uint64Builder, ListBuilder, MapBuilder, NullBuilder, StructBuilder, TimestampBuilder, TimestampSecondBuilder, TimestampMillisecondBuilder, TimestampMicrosecondBuilder, TimestampNanosecondBuilder, TimeBuilder, TimeSecondBuilder, TimeMillisecondBuilder, TimeMicrosecondBuilder, TimeNanosecondBuilder, UnionBuilder, DenseUnionBuilder, SparseUnionBuilder, Utf8Builder, } from './Arrow';
//# sourceMappingURL=Arrow.dom.mjs.map

@@ -17,3 +17,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

// under the License.
export { ArrowType, DateUnit, IntervalUnit, MessageHeader, MetadataVersion, Precision, TimeUnit, Type, UnionMode, VectorType } from './enum';
export { ArrowType, DateUnit, IntervalUnit, MessageHeader, MetadataVersion, Precision, TimeUnit, Type, UnionMode, BufferType } from './enum';
export { Data } from './data';

@@ -23,5 +23,6 @@ export { DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Utf8, Binary, FixedSizeBinary, Date_, DateDay, DateMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Decimal, List, Struct, Union, DenseUnion, SparseUnion, Dictionary, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Map_, } from './type';

export { Column } from './column';
export { Visitor } from './visitor';
export { Schema, Field } from './schema';
export { Visitor } from './visitor';
export { Row, Vector, BaseVector, BinaryVector, BoolVector, Chunked, DateVector, DateDayVector, DateMillisecondVector, DecimalVector, DictionaryVector, FixedSizeBinaryVector, FixedSizeListVector, FloatVector, Float16Vector, Float32Vector, Float64Vector, IntervalVector, IntervalDayTimeVector, IntervalYearMonthVector, IntVector, Int8Vector, Int16Vector, Int32Vector, Int64Vector, Uint8Vector, Uint16Vector, Uint32Vector, Uint64Vector, ListVector, MapVector, NullVector, StructVector, TimestampVector, TimestampSecondVector, TimestampMillisecondVector, TimestampMicrosecondVector, TimestampNanosecondVector, TimeVector, TimeSecondVector, TimeMillisecondVector, TimeMicrosecondVector, TimeNanosecondVector, UnionVector, DenseUnionVector, SparseUnionVector, Utf8Vector, } from './vector/index';
export { Builder, BinaryBuilder, BoolBuilder, DateBuilder, DateDayBuilder, DateMillisecondBuilder, DecimalBuilder, DictionaryBuilder, FixedSizeBinaryBuilder, FixedSizeListBuilder, FloatBuilder, Float16Builder, Float32Builder, Float64Builder, IntervalBuilder, IntervalDayTimeBuilder, IntervalYearMonthBuilder, IntBuilder, Int8Builder, Int16Builder, Int32Builder, Int64Builder, Uint8Builder, Uint16Builder, Uint32Builder, Uint64Builder, ListBuilder, MapBuilder, NullBuilder, StructBuilder, TimestampBuilder, TimestampSecondBuilder, TimestampMillisecondBuilder, TimestampMicrosecondBuilder, TimestampNanosecondBuilder, TimeBuilder, TimeSecondBuilder, TimeMillisecondBuilder, TimeMicrosecondBuilder, TimeNanosecondBuilder, UnionBuilder, DenseUnionBuilder, SparseUnionBuilder, Utf8Builder, } from './builder/index';
export { ByteStream, AsyncByteStream, AsyncByteQueue } from './io/stream';

@@ -34,2 +35,3 @@ export { RecordBatchReader, RecordBatchFileReader, RecordBatchStreamReader, AsyncRecordBatchFileReader, AsyncRecordBatchStreamReader } from './ipc/reader';

export { DataFrame, FilteredDataFrame, CountByResult } from './compute/dataframe';
import * as util_bn_ from './util/bn';
import * as util_int_ from './util/int';

@@ -42,4 +44,4 @@ import * as util_bit_ from './util/bit';

/** @ignore */
export const util = Object.assign({}, util_int_, util_bit_, util_buffer_, util_vector_);
export const util = Object.assign({}, util_bn_, util_int_, util_bit_, util_buffer_, util_vector_);
//# sourceMappingURL=Arrow.mjs.map

@@ -18,8 +18,11 @@ // Licensed to the Apache Software Foundation (ASF) under one

import streamAdapters from './io/adapters';
import { Builder } from './builder/index';
import { RecordBatchReader } from './ipc/reader';
import { RecordBatchWriter } from './ipc/writer';
import { toNodeStream } from './ipc/node/iterable';
import { recordBatchReaderThroughNodeStream } from './ipc/node/reader';
import { recordBatchWriterThroughNodeStream } from './ipc/node/writer';
import { toNodeStream } from './io/node/iterable';
import { builderThroughNodeStream } from './io/node/builder';
import { recordBatchReaderThroughNodeStream } from './io/node/reader';
import { recordBatchWriterThroughNodeStream } from './io/node/writer';
streamAdapters.toNodeStream = toNodeStream;
Builder['throughNode'] = builderThroughNodeStream;
RecordBatchReader['throughNode'] = recordBatchReaderThroughNodeStream;

@@ -26,0 +29,0 @@ RecordBatchWriter['throughNode'] = recordBatchWriterThroughNodeStream;

#! /usr/bin/env node
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
import * as tslib_1 from "tslib";
/* tslint:disable */
import * as fs from 'fs';

@@ -136,3 +153,3 @@ import * as stream from 'stream';

if (batchId === -1) {
this.push(`${horizontalRule(state.maxColWidths, hr, sep)}\n\n`);
hr && this.push(`${horizontalRule(state.maxColWidths, hr, sep)}\n\n`);
this.push(`${formatRow(header, maxColWidths, sep)}\n`);

@@ -143,3 +160,3 @@ if (state.metadata && schema.metadata.size > 0) {

}
this.push(`${horizontalRule(state.maxColWidths, hr, sep)}\n\n`);
hr && this.push(`${horizontalRule(state.maxColWidths, hr, sep)}\n\n`);
cb();

@@ -156,6 +173,6 @@ },

if (++batchId === 0) {
this.push(`${horizontalRule(state.maxColWidths, hr, sep)}\n`);
hr && this.push(`${horizontalRule(state.maxColWidths, hr, sep)}\n`);
if (state.metadata && batch.schema.metadata.size > 0) {
this.push(`metadata:\n${formatMetadata(batch.schema.metadata)}\n`);
this.push(`${horizontalRule(state.maxColWidths, hr, sep)}\n`);
hr && this.push(`${horizontalRule(state.maxColWidths, hr, sep)}\n`);
}

@@ -189,6 +206,6 @@ if (batch.length <= 0 || batch.numCols <= 0) {

}
function horizontalRule(maxColWidths, hr = '-', sep = ' |') {
function horizontalRule(maxColWidths, hr = '', sep = ' | ') {
return ` ${padLeft('', maxColWidths.reduce((x, y) => x + y, -2 + maxColWidths.length * sep.length), hr)}`;
}
function formatRow(row = [], maxColWidths = [], sep = ' |') {
function formatRow(row = [], maxColWidths = [], sep = ' | ') {
return `${row.map((x, j) => padLeft(x, maxColWidths[j])).join(sep)}`;

@@ -276,9 +293,9 @@ }

type: String,
name: 'sep', optional: true, default: ' |',
description: 'The column separator character (default: " |")'
name: 'sep', optional: true, default: ' | ',
description: 'The column separator character (default: " | ")'
},
{
type: String,
name: 'hr', optional: true, default: '-',
description: 'The horizontal border character (default: "-")'
name: 'hr', optional: true, default: '',
description: 'The horizontal border character (default: "")'
},

@@ -320,4 +337,3 @@ {

content: [
'$ arrow2csv --schema foo baz --sep "," -f simple.arrow',
'>--------------------------------------',
'$ arrow2csv --schema foo baz --sep " , " -f simple.arrow',
'> "row_id", "foo: Int32", "baz: Utf8"',

@@ -329,3 +345,2 @@ '> 0, 1, "aa"',

'> 4, 5, "cccc"',
'>--------------------------------------',
]

@@ -332,0 +347,0 @@ }

@@ -5,4 +5,4 @@ import { Data } from './data';

import { Vector } from './vector';
import { VectorCtorArgs, Vector as V } from './interfaces';
import { Clonable, Sliceable, Applicative } from './vector';
import { VectorCtorArgs, VectorType as V } from './interfaces';
import { Chunked } from './vector/chunked';

@@ -9,0 +9,0 @@ export interface Column<T extends DataType = any> {

@@ -36,3 +36,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

const type = chunks[0].data.type;
field = new Field(field, type, chunks.some(({ nullCount }) => nullCount > 0));
field = new Field(field, type, true);
}

@@ -71,2 +71,3 @@ else if (!field.nullable && chunks.some(({ nullCount }) => nullCount > 0)) {

}
/** @ignore */
class SingleChunkColumn extends Column {

@@ -73,0 +74,0 @@ constructor(field, vector, offsets) {

import { Table } from '../table';
import { Vector } from '../vector';
import { Vector as V } from '../interfaces';
import { Predicate, Col } from './predicate';
import { RecordBatch } from '../recordbatch';
import { VectorType as V } from '../interfaces';
import { DataType, Int, Struct } from '../type';

@@ -18,2 +18,3 @@ /** @ignore */

}
/** @ignore */
export declare class CountByResult<T extends DataType = any, TCount extends Int = Int> extends Table<{

@@ -26,2 +27,3 @@ values: T;

}
/** @ignore */
export declare class FilteredDataFrame<T extends {

@@ -28,0 +30,0 @@ [key: string]: DataType;

@@ -54,3 +54,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

}
const countByteLength = Math.ceil(Math.log(vector.dictionary.length) / Math.log(256));
const countByteLength = Math.ceil(Math.log(vector.length) / Math.log(256));
const CountsArrayType = countByteLength == 4 ? Uint32Array :

@@ -76,2 +76,3 @@ countByteLength >= 2 ? Uint16Array : Uint8Array;

}
/** @ignore */
export class CountByResult extends Table {

@@ -95,2 +96,3 @@ constructor(values, counts) {

}
/** @ignore */
export class FilteredDataFrame extends DataFrame {

@@ -184,3 +186,3 @@ constructor(batches, predicate) {

}
const countByteLength = Math.ceil(Math.log(vector.dictionary.length) / Math.log(256));
const countByteLength = Math.ceil(Math.log(vector.length) / Math.log(256));
const CountsArrayType = countByteLength == 4 ? Uint32Array :

@@ -187,0 +189,0 @@ countByteLength >= 2 ? Uint16Array : Uint8Array;

import { Vector } from './vector';
import { BufferType } from './enum';
import { DataType, SparseUnion, DenseUnion } from './type';
import { VectorType as BufferType } from './enum';
import { Dictionary, Null, Int, Float, Binary, Bool, Utf8, Decimal, Date_, Time, Timestamp, Interval, List, Struct, Union, FixedSizeBinary, FixedSizeList, Map_ } from './type';

@@ -8,5 +8,5 @@ /** @ignore */ export declare type kUnknownNullCount = -1;

/** @ignore */ export declare type NullBuffer = Uint8Array | null | undefined;
/** @ignore */ export declare type TypeIdsBuffer = Int8Array | ArrayLike<number> | Iterable<number>;
/** @ignore */ export declare type ValueOffsetsBuffer = Int32Array | ArrayLike<number> | Iterable<number>;
/** @ignore */ export declare type DataBuffer<T extends DataType> = T['TArray'] | ArrayLike<number> | Iterable<number>;
/** @ignore */ export declare type TypeIdsBuffer = Int8Array | ArrayLike<number> | Iterable<number> | undefined;
/** @ignore */ export declare type ValueOffsetsBuffer = Int32Array | ArrayLike<number> | Iterable<number> | undefined;
/** @ignore */ export declare type DataBuffer<T extends DataType> = T['TArray'] | ArrayLike<number> | Iterable<number> | undefined;
/** @ignore */

@@ -32,2 +32,6 @@ export interface Buffers<T extends DataType> {

readonly childData: Data[];
/**
* The dictionary for this Vector, if any. Only used for Dictionary type.
*/
dictionary?: Vector;
readonly values: Buffers<T>[BufferType.DATA];

@@ -37,8 +41,9 @@ readonly typeIds: Buffers<T>[BufferType.TYPE];

readonly valueOffsets: Buffers<T>[BufferType.OFFSET];
readonly ArrayType: any;
readonly typeId: T['TType'];
readonly ArrayType: T['ArrayType'];
readonly buffers: Buffers<T>;
readonly byteLength: number;
protected _nullCount: number | kUnknownNullCount;
readonly nullCount: number;
constructor(type: T, offset: number, length: number, nullCount?: number, buffers?: Partial<Buffers<T>> | Data<T>, childData?: (Data | Vector)[]);
constructor(type: T, offset: number, length: number, nullCount?: number, buffers?: Partial<Buffers<T>> | Data<T>, childData?: (Data | Vector)[], dictionary?: Vector);
clone<R extends DataType>(type: R, offset?: number, length?: number, nullCount?: number, buffers?: Buffers<R>, childData?: (Data | Vector)[]): Data<R>;

@@ -50,3 +55,3 @@ slice(offset: number, length: number): Data<T>;

/** @nocollapse */
static new<T extends DataType>(type: T, offset: number, length: number, nullCount?: number, buffers?: Partial<Buffers<T>> | Data<T>, childData?: (Data | Vector)[]): Data<T>;
static new<T extends DataType>(type: T, offset: number, length: number, nullCount?: number, buffers?: Partial<Buffers<T>> | Data<T>, childData?: (Data | Vector)[], dictionary?: Vector): Data<T>;
/** @nocollapse */

@@ -57,3 +62,3 @@ static Null<T extends Null>(type: T, offset: number, length: number, nullCount: number, nullBitmap: NullBuffer, _data?: NullBuffer): Data<T>;

/** @nocollapse */
static Dictionary<T extends Dictionary>(type: T, offset: number, length: number, nullCount: number, nullBitmap: NullBuffer, data: DataBuffer<T>): Data<T>;
static Dictionary<T extends Dictionary>(type: T, offset: number, length: number, nullCount: number, nullBitmap: NullBuffer, data: DataBuffer<T>, dictionary: Vector<T['dictionary']>): Data<T>;
/** @nocollapse */

@@ -60,0 +65,0 @@ static Float<T extends Float>(type: T, offset: number, length: number, nullCount: number, nullBitmap: NullBuffer, data: DataBuffer<T>): Data<T>;

@@ -19,3 +19,4 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { popcnt_bit_range } from './util/bit';
import { VectorType as BufferType, UnionMode, Type } from './enum';
import { BufferType, UnionMode, Type } from './enum';
import { strideForType } from './type';
import { toArrayBufferView, toUint8Array, toInt32Array } from './util/buffer';

@@ -25,4 +26,5 @@ /** @ignore */ export const kUnknownNullCount = -1;

export class Data {
constructor(type, offset, length, nullCount, buffers, childData) {
constructor(type, offset, length, nullCount, buffers, childData, dictionary) {
this.type = type;
this.dictionary = dictionary;
this.offset = Math.floor(Math.max(offset || 0, 0));

@@ -41,2 +43,3 @@ this.length = Math.floor(Math.max(length || 0, 0));

else {
this.stride = strideForType(type);
if (buffers) {

@@ -48,37 +51,18 @@ (buffer = buffers[0]) && (this.valueOffsets = buffer);

}
const t = type;
switch (type.typeId) {
case Type.Decimal:
this.stride = 4;
break;
case Type.Timestamp:
this.stride = 2;
break;
case Type.Date:
this.stride = 1 + t.unit;
break;
case Type.Interval:
this.stride = 1 + t.unit;
break;
case Type.Int:
this.stride = 1 + +(t.bitWidth > 32);
break;
case Type.Time:
this.stride = 1 + +(t.bitWidth > 32);
break;
case Type.FixedSizeList:
this.stride = t.listSize;
break;
case Type.FixedSizeBinary:
this.stride = t.byteWidth;
break;
default: this.stride = 1;
}
}
}
get typeId() { return this.type.typeId; }
get ArrayType() { return this.type.ArrayType; }
get typeId() { return this.type.typeId; }
get buffers() {
return [this.valueOffsets, this.values, this.nullBitmap, this.typeIds];
}
get byteLength() {
let byteLength = 0;
let { valueOffsets, values, nullBitmap, typeIds } = this;
valueOffsets && (byteLength += valueOffsets.byteLength);
values && (byteLength += values.byteLength);
nullBitmap && (byteLength += nullBitmap.byteLength);
typeIds && (byteLength += typeIds.byteLength);
return this.childData.reduce((byteLength, child) => byteLength + child.byteLength, byteLength);
}
get nullCount() {

@@ -93,9 +77,9 @@ let nullCount = this._nullCount;

clone(type, offset = this.offset, length = this.length, nullCount = this._nullCount, buffers = this, childData = this.childData) {
return new Data(type, offset, length, nullCount, buffers, childData);
return new Data(type, offset, length, nullCount, buffers, childData, this.dictionary);
}
slice(offset, length) {
const { stride, typeId, childData } = this;
// +true === 1, +false === 0, so this means
// we keep nullCount at 0 if it's already 0,
// otherwise set to the invalidated flag -1
const { stride, typeId, childData } = this;
const nullCount = +(this._nullCount === 0) - 1;

@@ -139,3 +123,3 @@ const childStride = typeId === 16 /* FixedSizeList */ ? stride : 1;

/** @nocollapse */
static new(type, offset, length, nullCount, buffers, childData) {
static new(type, offset, length, nullCount, buffers, childData, dictionary) {
if (buffers instanceof Data) {

@@ -148,20 +132,20 @@ buffers = buffers.buffers;

switch (type.typeId) {
case Type.Null: return Data.Null(type, offset, length, nullCount || 0, buffers[2]);
case Type.Int: return Data.Int(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Dictionary: return Data.Dictionary(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Float: return Data.Float(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Bool: return Data.Bool(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Decimal: return Data.Decimal(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Date: return Data.Date(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Time: return Data.Time(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Timestamp: return Data.Timestamp(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Interval: return Data.Interval(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.FixedSizeBinary: return Data.FixedSizeBinary(type, offset, length, nullCount || 0, buffers[2], buffers[1] || []);
case Type.Binary: return Data.Binary(type, offset, length, nullCount || 0, buffers[2], buffers[0] || [], buffers[1] || []);
case Type.Utf8: return Data.Utf8(type, offset, length, nullCount || 0, buffers[2], buffers[0] || [], buffers[1] || []);
case Type.List: return Data.List(type, offset, length, nullCount || 0, buffers[2], buffers[0] || [], (childData || [])[0]);
case Type.FixedSizeList: return Data.FixedSizeList(type, offset, length, nullCount || 0, buffers[2], (childData || [])[0]);
case Type.Struct: return Data.Struct(type, offset, length, nullCount || 0, buffers[2], childData || []);
case Type.Map: return Data.Map(type, offset, length, nullCount || 0, buffers[2], childData || []);
case Type.Union: return Data.Union(type, offset, length, nullCount || 0, buffers[2], buffers[3] || [], buffers[1] || childData, childData);
case Type.Null: return Data.Null(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY]);
case Type.Int: return Data.Int(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.Dictionary: return Data.Dictionary(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || [], dictionary);
case Type.Float: return Data.Float(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.Bool: return Data.Bool(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.Decimal: return Data.Decimal(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.Date: return Data.Date(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.Time: return Data.Time(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.Timestamp: return Data.Timestamp(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.Interval: return Data.Interval(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.FixedSizeBinary: return Data.FixedSizeBinary(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.DATA] || []);
case Type.Binary: return Data.Binary(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.OFFSET] || [], buffers[BufferType.DATA] || []);
case Type.Utf8: return Data.Utf8(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.OFFSET] || [], buffers[BufferType.DATA] || []);
case Type.List: return Data.List(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.OFFSET] || [], (childData || [])[0]);
case Type.FixedSizeList: return Data.FixedSizeList(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], (childData || [])[0]);
case Type.Struct: return Data.Struct(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], childData || []);
case Type.Map: return Data.Map(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], childData || []);
case Type.Union: return Data.Union(type, offset, length, nullCount || 0, buffers[BufferType.VALIDITY], buffers[BufferType.TYPE] || [], buffers[BufferType.OFFSET] || childData, childData);
}

@@ -179,4 +163,4 @@ throw new Error(`Unrecognized typeId ${type.typeId}`);

/** @nocollapse */
static Dictionary(type, offset, length, nullCount, nullBitmap, data) {
return new Data(type, offset, length, nullCount, [undefined, toArrayBufferView(type.indices.ArrayType, data), toUint8Array(nullBitmap)]);
static Dictionary(type, offset, length, nullCount, nullBitmap, data, dictionary) {
return new Data(type, offset, length, nullCount, [undefined, toArrayBufferView(type.indices.ArrayType, data), toUint8Array(nullBitmap)], [], dictionary);
}

@@ -253,4 +237,4 @@ /** @nocollapse */

}
(Data.prototype.childData = Object.freeze([]));
Data.prototype.childData = Object.freeze([]);
//# sourceMappingURL=data.mjs.map

@@ -8,3 +8,2 @@ import * as Schema_ from './fb/Schema';

export import UnionMode = Schema_.org.apache.arrow.flatbuf.UnionMode;
export import VectorType = Schema_.org.apache.arrow.flatbuf.VectorType;
export import IntervalUnit = Schema_.org.apache.arrow.flatbuf.IntervalUnit;

@@ -14,29 +13,65 @@ export import MessageHeader = Message_.org.apache.arrow.flatbuf.MessageHeader;

/**
* *
* Main data type enumeration:
* *
* Main data type enumeration.
*
* Data types in this library are all *logical*. They can be expressed as
* either a primitive physical type (bytes or bits of some fixed size), a
* nested type consisting of other data types, or another data type (e.g. a
* timestamp encoded as an int64)
* timestamp encoded as an int64).
*
* **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow
* IPC payload.
*
* The rest of the values are specified here so TypeScript can narrow the type
* signatures further beyond the base Arrow Types. The Arrow DataTypes include
* metadata like `bitWidth` that impact the type signatures of the values we
* accept and return.
*
* For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an
* `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`
* reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the
* underlying `Int32Array`.
*
* Library consumers benefit by knowing the narrowest type, since we can ensure
* the types across all public methods are propagated, and never bail to `any`.
* These values are _never_ used at runtime, and they will _never_ be written
* to the flatbuffers metadata of serialized Arrow IPC payloads.
*/
export declare enum Type {
/** The default placeholder type */
NONE = 0,
/** A NULL type having no physical storage */
Null = 1,
/** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */
Int = 2,
/** 2, 4, or 8-byte floating point value */
Float = 3,
/** Variable-length bytes (no guarantee of UTF8-ness) */
Binary = 4,
/** UTF8 variable-length string as List<Char> */
Utf8 = 5,
/** Boolean as 1 bit, LSB bit-packed ordering */
Bool = 6,
/** Precision-and-scale-based decimal type. Storage type depends on the parameters. */
Decimal = 7,
/** int32_t days or int64_t milliseconds since the UNIX epoch */
Date = 8,
/** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */
Time = 9,
/** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */
Timestamp = 10,
/** YEAR_MONTH or DAY_TIME interval in SQL style */
Interval = 11,
/** A list of some logical data type */
List = 12,
/** Struct of logical types */
Struct = 13,
/** Union of logical types */
Union = 14,
/** Fixed-size binary. Each value occupies the same number of bytes */
FixedSizeBinary = 15,
/** Fixed-size list. Each value occupies the same number of bytes */
FixedSizeList = 16,
/** Map of named logical types */
Map = 17,
/** Dictionary aka Category type */
Dictionary = -1,

@@ -69,1 +104,19 @@ Int8 = -2,

}
export declare enum BufferType {
/**
* used in List type, Dense Union and variable length primitive types (String, Binary)
*/
OFFSET = 0,
/**
* actual data, either wixed width primitive types in slots or variable width delimited by an OFFSET vector
*/
DATA = 1,
/**
* Bit vector indicating if each value is null
*/
VALIDITY = 2,
/**
* Type vector used in Union type
*/
TYPE = 3
}

@@ -24,3 +24,2 @@ // Licensed to the Apache Software Foundation (ASF) under one

export var UnionMode = Schema_.org.apache.arrow.flatbuf.UnionMode;
export var VectorType = Schema_.org.apache.arrow.flatbuf.VectorType;
export var IntervalUnit = Schema_.org.apache.arrow.flatbuf.IntervalUnit;

@@ -30,39 +29,66 @@ export var MessageHeader = Message_.org.apache.arrow.flatbuf.MessageHeader;

/**
* *
* Main data type enumeration:
* *
* Main data type enumeration.
*
* Data types in this library are all *logical*. They can be expressed as
* either a primitive physical type (bytes or bits of some fixed size), a
* nested type consisting of other data types, or another data type (e.g. a
* timestamp encoded as an int64)
* timestamp encoded as an int64).
*
* **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow
* IPC payload.
*
* The rest of the values are specified here so TypeScript can narrow the type
* signatures further beyond the base Arrow Types. The Arrow DataTypes include
* metadata like `bitWidth` that impact the type signatures of the values we
* accept and return.
*
* For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an
* `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`
* reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the
* underlying `Int32Array`.
*
* Library consumers benefit by knowing the narrowest type, since we can ensure
* the types across all public methods are propagated, and never bail to `any`.
* These values are _never_ used at runtime, and they will _never_ be written
* to the flatbuffers metadata of serialized Arrow IPC payloads.
*/
export var Type;
(function (Type) {
/** The default placeholder type */
Type[Type["NONE"] = 0] = "NONE";
/** A NULL type having no physical storage */
Type[Type["Null"] = 1] = "Null";
/** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */
Type[Type["Int"] = 2] = "Int";
/** 2, 4, or 8-byte floating point value */
Type[Type["Float"] = 3] = "Float";
/** Variable-length bytes (no guarantee of UTF8-ness) */
Type[Type["Binary"] = 4] = "Binary";
/** UTF8 variable-length string as List<Char> */
Type[Type["Utf8"] = 5] = "Utf8";
/** Boolean as 1 bit, LSB bit-packed ordering */
Type[Type["Bool"] = 6] = "Bool";
/** Precision-and-scale-based decimal type. Storage type depends on the parameters. */
Type[Type["Decimal"] = 7] = "Decimal";
/** int32_t days or int64_t milliseconds since the UNIX epoch */
Type[Type["Date"] = 8] = "Date";
/** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */
Type[Type["Time"] = 9] = "Time";
/** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */
Type[Type["Timestamp"] = 10] = "Timestamp";
/** YEAR_MONTH or DAY_TIME interval in SQL style */
Type[Type["Interval"] = 11] = "Interval";
/** A list of some logical data type */
Type[Type["List"] = 12] = "List";
/** Struct of logical types */
Type[Type["Struct"] = 13] = "Struct";
/** Union of logical types */
Type[Type["Union"] = 14] = "Union";
/** Fixed-size binary. Each value occupies the same number of bytes */
Type[Type["FixedSizeBinary"] = 15] = "FixedSizeBinary";
/** Fixed-size list. Each value occupies the same number of bytes */
Type[Type["FixedSizeList"] = 16] = "FixedSizeList";
/** Map of named logical types */
Type[Type["Map"] = 17] = "Map";
// These enum values are here so that TypeScript can narrow the type signatures further
// beyond the base Arrow types. The base Arrow types include metadata like bitWidths that
// impact the type signatures of the values we return. For example, the Int8Vector reads
// 1-byte numbers from an Int8Array, an Int32Vector reads a 4-byte number from an Int32Array,
// and an Int64Vector reads a pair of 4-byte lo, hi int32s, and returns them as a zero-copy
// slice from an underlying Int32Array. Library consumers benefit by doing this type narrowing,
// since we can ensure the types across all public methods are propagated and never bail to `any`.
// These values are _never_ actually used at runtime, and they will _never_ be written into the
// flatbuffers metadata of serialized Arrow IPC payloads.
/** Dictionary aka Category type */
Type[Type["Dictionary"] = -1] = "Dictionary";

@@ -95,3 +121,22 @@ Type[Type["Int8"] = -2] = "Int8";

})(Type || (Type = {}));
export var BufferType;
(function (BufferType) {
/**
* used in List type, Dense Union and variable length primitive types (String, Binary)
*/
BufferType[BufferType["OFFSET"] = 0] = "OFFSET";
/**
* actual data, either wixed width primitive types in slots or variable width delimited by an OFFSET vector
*/
BufferType[BufferType["DATA"] = 1] = "DATA";
/**
* Bit vector indicating if each value is null
*/
BufferType[BufferType["VALIDITY"] = 2] = "VALIDITY";
/**
* Type vector used in Union type
*/
BufferType[BufferType["TYPE"] = 3] = "TYPE";
})(BufferType || (BufferType = {}));
//# sourceMappingURL=enum.mjs.map
import { flatbuffers } from 'flatbuffers';
import * as NS16187549871986683199 from './Schema';
import * as NS7624605610262437867 from './Schema';
/**

@@ -12,95 +12,101 @@ * ----------------------------------------------------------------------

class Footer {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Footer}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Footer
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Footer;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Footer=} obj
* @returns {Footer}
* @param flatbuffers.ByteBuffer bb
* @param Footer= obj
* @returns Footer
*/
static getRootAsFooter(bb: flatbuffers.ByteBuffer, obj?: Footer): Footer;
/**
* @returns {org.apache.arrow.flatbuf.MetadataVersion}
* @param flatbuffers.ByteBuffer bb
* @param Footer= obj
* @returns Footer
*/
version(): NS16187549871986683199.org.apache.arrow.flatbuf.MetadataVersion;
static getSizePrefixedRootAsFooter(bb: flatbuffers.ByteBuffer, obj?: Footer): Footer;
/**
* @param {org.apache.arrow.flatbuf.Schema=} obj
* @returns {org.apache.arrow.flatbuf.Schema|null}
* @returns org.apache.arrow.flatbuf.MetadataVersion
*/
schema(obj?: NS16187549871986683199.org.apache.arrow.flatbuf.Schema): NS16187549871986683199.org.apache.arrow.flatbuf.Schema | null;
version(): NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion;
/**
* @param {number} index
* @param {org.apache.arrow.flatbuf.Block=} obj
* @returns {org.apache.arrow.flatbuf.Block}
* @param org.apache.arrow.flatbuf.Schema= obj
* @returns org.apache.arrow.flatbuf.Schema|null
*/
schema(obj?: NS7624605610262437867.org.apache.arrow.flatbuf.Schema): NS7624605610262437867.org.apache.arrow.flatbuf.Schema | null;
/**
* @param number index
* @param org.apache.arrow.flatbuf.Block= obj
* @returns org.apache.arrow.flatbuf.Block
*/
dictionaries(index: number, obj?: org.apache.arrow.flatbuf.Block): org.apache.arrow.flatbuf.Block | null;
/**
* @returns {number}
* @returns number
*/
dictionariesLength(): number;
/**
* @param {number} index
* @param {org.apache.arrow.flatbuf.Block=} obj
* @returns {org.apache.arrow.flatbuf.Block}
* @param number index
* @param org.apache.arrow.flatbuf.Block= obj
* @returns org.apache.arrow.flatbuf.Block
*/
recordBatches(index: number, obj?: org.apache.arrow.flatbuf.Block): org.apache.arrow.flatbuf.Block | null;
/**
* @returns {number}
* @returns number
*/
recordBatchesLength(): number;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startFooter(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.MetadataVersion} version
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.MetadataVersion version
*/
static addVersion(builder: flatbuffers.Builder, version: NS16187549871986683199.org.apache.arrow.flatbuf.MetadataVersion): void;
static addVersion(builder: flatbuffers.Builder, version: NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} schemaOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset schemaOffset
*/
static addSchema(builder: flatbuffers.Builder, schemaOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} dictionariesOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset dictionariesOffset
*/
static addDictionaries(builder: flatbuffers.Builder, dictionariesOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startDictionariesVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} recordBatchesOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset recordBatchesOffset
*/
static addRecordBatches(builder: flatbuffers.Builder, recordBatchesOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startRecordBatchesVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endFooter(builder: flatbuffers.Builder): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} offset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishFooterBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishSizePrefixedFooterBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
static createFooter(builder: flatbuffers.Builder, version: NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion, schemaOffset: flatbuffers.Offset, dictionariesOffset: flatbuffers.Offset, recordBatchesOffset: flatbuffers.Offset): flatbuffers.Offset;
}

@@ -113,14 +119,8 @@ }

class Block {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Block}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Block
*/

@@ -131,3 +131,3 @@ __init(i: number, bb: flatbuffers.ByteBuffer): Block;

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -138,3 +138,3 @@ offset(): flatbuffers.Long;

*
* @returns {number}
* @returns number
*/

@@ -146,11 +146,11 @@ metaDataLength(): number;

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/
bodyLength(): flatbuffers.Long;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} offset
* @param {number} metaDataLength
* @param {flatbuffers.Long} bodyLength
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param flatbuffers.Long offset
* @param number metaDataLength
* @param flatbuffers.Long bodyLength
* @returns flatbuffers.Offset
*/

@@ -157,0 +157,0 @@ static createBlock(builder: flatbuffers.Builder, offset: flatbuffers.Long, metaDataLength: number, bodyLength: flatbuffers.Long): flatbuffers.Offset;

// automatically generated by the FlatBuffers compiler, do not modify
import * as NS16187549871986683199 from './Schema';
import * as NS7624605610262437867 from './Schema';
/**

@@ -20,11 +20,9 @@ * ----------------------------------------------------------------------

constructor() {
/**
* @type {number}
*/
this.bb = null;
this.bb_pos = 0;
}
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Footer}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Footer
*/

@@ -37,5 +35,5 @@ __init(i, bb) {

/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Footer=} obj
* @returns {Footer}
* @param flatbuffers.ByteBuffer bb
* @param Footer= obj
* @returns Footer
*/

@@ -46,20 +44,28 @@ static getRootAsFooter(bb, obj) {

/**
* @returns {org.apache.arrow.flatbuf.MetadataVersion}
* @param flatbuffers.ByteBuffer bb
* @param Footer= obj
* @returns Footer
*/
static getSizePrefixedRootAsFooter(bb, obj) {
return (obj || new Footer).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
/**
* @returns org.apache.arrow.flatbuf.MetadataVersion
*/
version() {
let offset = this.bb.__offset(this.bb_pos, 4);
return offset ? /** @type {org.apache.arrow.flatbuf.MetadataVersion} */ (this.bb.readInt16(this.bb_pos + offset)) : NS16187549871986683199.org.apache.arrow.flatbuf.MetadataVersion.V1;
return offset ? /** */ (this.bb.readInt16(this.bb_pos + offset)) : NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion.V1;
}
/**
* @param {org.apache.arrow.flatbuf.Schema=} obj
* @returns {org.apache.arrow.flatbuf.Schema|null}
* @param org.apache.arrow.flatbuf.Schema= obj
* @returns org.apache.arrow.flatbuf.Schema|null
*/
schema(obj) {
let offset = this.bb.__offset(this.bb_pos, 6);
return offset ? (obj || new NS16187549871986683199.org.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
return offset ? (obj || new NS7624605610262437867.org.apache.arrow.flatbuf.Schema).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
}
/**
* @param {number} index
* @param {org.apache.arrow.flatbuf.Block=} obj
* @returns {org.apache.arrow.flatbuf.Block}
* @param number index
* @param org.apache.arrow.flatbuf.Block= obj
* @returns org.apache.arrow.flatbuf.Block
*/

@@ -71,3 +77,3 @@ dictionaries(index, obj) {

/**
* @returns {number}
* @returns number
*/

@@ -79,5 +85,5 @@ dictionariesLength() {

/**
* @param {number} index
* @param {org.apache.arrow.flatbuf.Block=} obj
* @returns {org.apache.arrow.flatbuf.Block}
* @param number index
* @param org.apache.arrow.flatbuf.Block= obj
* @returns org.apache.arrow.flatbuf.Block
*/

@@ -89,3 +95,3 @@ recordBatches(index, obj) {

/**
* @returns {number}
* @returns number
*/

@@ -97,3 +103,3 @@ recordBatchesLength() {

/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/

@@ -104,11 +110,11 @@ static startFooter(builder) {

/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.MetadataVersion} version
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.MetadataVersion version
*/
static addVersion(builder, version) {
builder.addFieldInt16(0, version, NS16187549871986683199.org.apache.arrow.flatbuf.MetadataVersion.V1);
builder.addFieldInt16(0, version, NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion.V1);
}
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} schemaOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset schemaOffset
*/

@@ -119,4 +125,4 @@ static addSchema(builder, schemaOffset) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} dictionariesOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset dictionariesOffset
*/

@@ -127,4 +133,4 @@ static addDictionaries(builder, dictionariesOffset) {

/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/

@@ -135,4 +141,4 @@ static startDictionariesVector(builder, numElems) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} recordBatchesOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset recordBatchesOffset
*/

@@ -143,4 +149,4 @@ static addRecordBatches(builder, recordBatchesOffset) {

/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/

@@ -151,4 +157,4 @@ static startRecordBatchesVector(builder, numElems) {

/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/

@@ -160,4 +166,4 @@ static endFooter(builder) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} offset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/

@@ -167,2 +173,17 @@ static finishFooterBuffer(builder, offset) {

}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishSizePrefixedFooterBuffer(builder, offset) {
builder.finish(offset, undefined);
}
static createFooter(builder, version, schemaOffset, dictionariesOffset, recordBatchesOffset) {
Footer.startFooter(builder);
Footer.addVersion(builder, version);
Footer.addSchema(builder, schemaOffset);
Footer.addDictionaries(builder, dictionariesOffset);
Footer.addRecordBatches(builder, recordBatchesOffset);
return Footer.endFooter(builder);
}
}

@@ -186,11 +207,9 @@ flatbuf.Footer = Footer;

constructor() {
/**
* @type {number}
*/
this.bb = null;
this.bb_pos = 0;
}
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Block}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Block
*/

@@ -205,3 +224,3 @@ __init(i, bb) {

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -214,3 +233,3 @@ offset() {

*
* @returns {number}
* @returns number
*/

@@ -224,3 +243,3 @@ metaDataLength() {

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -231,7 +250,7 @@ bodyLength() {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} offset
* @param {number} metaDataLength
* @param {flatbuffers.Long} bodyLength
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param flatbuffers.Long offset
* @param number metaDataLength
* @param flatbuffers.Long bodyLength
* @returns flatbuffers.Offset
*/

@@ -238,0 +257,0 @@ static createBlock(builder, offset, metaDataLength, bodyLength) {

import { flatbuffers } from 'flatbuffers';
import * as NS16187549871986683199 from './Schema';
import * as NS7624605610262437867 from './Schema';
export declare namespace org.apache.arrow.flatbuf {
export import Schema = NS16187549871986683199.org.apache.arrow.flatbuf.Schema;
export import Schema = NS7624605610262437867.org.apache.arrow.flatbuf.Schema;
}

@@ -16,3 +16,3 @@ /**

*
* @enum
* @enum {number}
*/

@@ -25,3 +25,4 @@ export declare namespace org.apache.arrow.flatbuf {

RecordBatch = 3,
Tensor = 4
Tensor = 4,
SparseTensor = 5
}

@@ -44,14 +45,8 @@ }

class FieldNode {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {FieldNode}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns FieldNode
*/

@@ -63,3 +58,3 @@ __init(i: number, bb: flatbuffers.ByteBuffer): FieldNode;

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -72,10 +67,10 @@ length(): flatbuffers.Long;

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/
nullCount(): flatbuffers.Long;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} length
* @param {flatbuffers.Long} null_count
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param flatbuffers.Long length
* @param flatbuffers.Long null_count
* @returns flatbuffers.Offset
*/

@@ -94,27 +89,27 @@ static createFieldNode(builder: flatbuffers.Builder, length: flatbuffers.Long, null_count: flatbuffers.Long): flatbuffers.Offset;

class RecordBatch {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {RecordBatch}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns RecordBatch
*/
__init(i: number, bb: flatbuffers.ByteBuffer): RecordBatch;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {RecordBatch=} obj
* @returns {RecordBatch}
* @param flatbuffers.ByteBuffer bb
* @param RecordBatch= obj
* @returns RecordBatch
*/
static getRootAsRecordBatch(bb: flatbuffers.ByteBuffer, obj?: RecordBatch): RecordBatch;
/**
* @param flatbuffers.ByteBuffer bb
* @param RecordBatch= obj
* @returns RecordBatch
*/
static getSizePrefixedRootAsRecordBatch(bb: flatbuffers.ByteBuffer, obj?: RecordBatch): RecordBatch;
/**
* number of records / rows. The arrays in the batch should all have this
* length
*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -125,9 +120,9 @@ length(): flatbuffers.Long;

*
* @param {number} index
* @param {org.apache.arrow.flatbuf.FieldNode=} obj
* @returns {org.apache.arrow.flatbuf.FieldNode}
* @param number index
* @param org.apache.arrow.flatbuf.FieldNode= obj
* @returns org.apache.arrow.flatbuf.FieldNode
*/
nodes(index: number, obj?: org.apache.arrow.flatbuf.FieldNode): org.apache.arrow.flatbuf.FieldNode | null;
/**
* @returns {number}
* @returns number
*/

@@ -143,45 +138,46 @@ nodesLength(): number;

*
* @param {number} index
* @param {org.apache.arrow.flatbuf.Buffer=} obj
* @returns {org.apache.arrow.flatbuf.Buffer}
* @param number index
* @param org.apache.arrow.flatbuf.Buffer= obj
* @returns org.apache.arrow.flatbuf.Buffer
*/
buffers(index: number, obj?: NS16187549871986683199.org.apache.arrow.flatbuf.Buffer): NS16187549871986683199.org.apache.arrow.flatbuf.Buffer | null;
buffers(index: number, obj?: NS7624605610262437867.org.apache.arrow.flatbuf.Buffer): NS7624605610262437867.org.apache.arrow.flatbuf.Buffer | null;
/**
* @returns {number}
* @returns number
*/
buffersLength(): number;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startRecordBatch(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} length
* @param flatbuffers.Builder builder
* @param flatbuffers.Long length
*/
static addLength(builder: flatbuffers.Builder, length: flatbuffers.Long): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} nodesOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset nodesOffset
*/
static addNodes(builder: flatbuffers.Builder, nodesOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startNodesVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} buffersOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset buffersOffset
*/
static addBuffers(builder: flatbuffers.Builder, buffersOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startBuffersVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endRecordBatch(builder: flatbuffers.Builder): flatbuffers.Offset;
static createRecordBatch(builder: flatbuffers.Builder, length: flatbuffers.Long, nodesOffset: flatbuffers.Offset, buffersOffset: flatbuffers.Offset): flatbuffers.Offset;
}

@@ -201,29 +197,29 @@ }

class DictionaryBatch {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {DictionaryBatch}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns DictionaryBatch
*/
__init(i: number, bb: flatbuffers.ByteBuffer): DictionaryBatch;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {DictionaryBatch=} obj
* @returns {DictionaryBatch}
* @param flatbuffers.ByteBuffer bb
* @param DictionaryBatch= obj
* @returns DictionaryBatch
*/
static getRootAsDictionaryBatch(bb: flatbuffers.ByteBuffer, obj?: DictionaryBatch): DictionaryBatch;
/**
* @returns {flatbuffers.Long}
* @param flatbuffers.ByteBuffer bb
* @param DictionaryBatch= obj
* @returns DictionaryBatch
*/
static getSizePrefixedRootAsDictionaryBatch(bb: flatbuffers.ByteBuffer, obj?: DictionaryBatch): DictionaryBatch;
/**
* @returns flatbuffers.Long
*/
id(): flatbuffers.Long;
/**
* @param {org.apache.arrow.flatbuf.RecordBatch=} obj
* @returns {org.apache.arrow.flatbuf.RecordBatch|null}
* @param org.apache.arrow.flatbuf.RecordBatch= obj
* @returns org.apache.arrow.flatbuf.RecordBatch|null
*/

@@ -235,29 +231,30 @@ data(obj?: org.apache.arrow.flatbuf.RecordBatch): org.apache.arrow.flatbuf.RecordBatch | null;

*
* @returns {boolean}
* @returns boolean
*/
isDelta(): boolean;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startDictionaryBatch(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} id
* @param flatbuffers.Builder builder
* @param flatbuffers.Long id
*/
static addId(builder: flatbuffers.Builder, id: flatbuffers.Long): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} dataOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset dataOffset
*/
static addData(builder: flatbuffers.Builder, dataOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {boolean} isDelta
* @param flatbuffers.Builder builder
* @param boolean isDelta
*/
static addIsDelta(builder: flatbuffers.Builder, isDelta: boolean): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endDictionaryBatch(builder: flatbuffers.Builder): flatbuffers.Offset;
static createDictionaryBatch(builder: flatbuffers.Builder, id: flatbuffers.Long, dataOffset: flatbuffers.Offset, isDelta: boolean): flatbuffers.Offset;
}

@@ -270,74 +267,106 @@ }

class Message {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Message}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Message
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Message;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Message=} obj
* @returns {Message}
* @param flatbuffers.ByteBuffer bb
* @param Message= obj
* @returns Message
*/
static getRootAsMessage(bb: flatbuffers.ByteBuffer, obj?: Message): Message;
/**
* @returns {org.apache.arrow.flatbuf.MetadataVersion}
* @param flatbuffers.ByteBuffer bb
* @param Message= obj
* @returns Message
*/
version(): NS16187549871986683199.org.apache.arrow.flatbuf.MetadataVersion;
static getSizePrefixedRootAsMessage(bb: flatbuffers.ByteBuffer, obj?: Message): Message;
/**
* @returns {org.apache.arrow.flatbuf.MessageHeader}
* @returns org.apache.arrow.flatbuf.MetadataVersion
*/
version(): NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion;
/**
* @returns org.apache.arrow.flatbuf.MessageHeader
*/
headerType(): org.apache.arrow.flatbuf.MessageHeader;
/**
* @param {flatbuffers.Table} obj
* @returns {?flatbuffers.Table}
* @param flatbuffers.Table obj
* @returns ?flatbuffers.Table
*/
header<T extends flatbuffers.Table>(obj: T): T | null;
/**
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/
bodyLength(): flatbuffers.Long;
/**
* @param {flatbuffers.Builder} builder
* @param number index
* @param org.apache.arrow.flatbuf.KeyValue= obj
* @returns org.apache.arrow.flatbuf.KeyValue
*/
customMetadata(index: number, obj?: NS7624605610262437867.org.apache.arrow.flatbuf.KeyValue): NS7624605610262437867.org.apache.arrow.flatbuf.KeyValue | null;
/**
* @returns number
*/
customMetadataLength(): number;
/**
* @param flatbuffers.Builder builder
*/
static startMessage(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.MetadataVersion} version
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.MetadataVersion version
*/
static addVersion(builder: flatbuffers.Builder, version: NS16187549871986683199.org.apache.arrow.flatbuf.MetadataVersion): void;
static addVersion(builder: flatbuffers.Builder, version: NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.MessageHeader} headerType
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.MessageHeader headerType
*/
static addHeaderType(builder: flatbuffers.Builder, headerType: org.apache.arrow.flatbuf.MessageHeader): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} headerOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset headerOffset
*/
static addHeader(builder: flatbuffers.Builder, headerOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} bodyLength
* @param flatbuffers.Builder builder
* @param flatbuffers.Long bodyLength
*/
static addBodyLength(builder: flatbuffers.Builder, bodyLength: flatbuffers.Long): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset customMetadataOffset
*/
static addCustomMetadata(builder: flatbuffers.Builder, customMetadataOffset: flatbuffers.Offset): void;
/**
* @param flatbuffers.Builder builder
* @param Array.<flatbuffers.Offset> data
* @returns flatbuffers.Offset
*/
static createCustomMetadataVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
/**
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startCustomMetadataVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endMessage(builder: flatbuffers.Builder): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} offset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishMessageBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishSizePrefixedMessageBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
static createMessage(builder: flatbuffers.Builder, version: NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion, headerType: org.apache.arrow.flatbuf.MessageHeader, headerOffset: flatbuffers.Offset, bodyLength: flatbuffers.Long, customMetadataOffset: flatbuffers.Offset): flatbuffers.Offset;
}
}
// automatically generated by the FlatBuffers compiler, do not modify
import * as NS16187549871986683199 from './Schema';
import * as NS7624605610262437867 from './Schema';
export var org;

@@ -11,3 +11,3 @@ (function (org) {

(function (flatbuf) {
flatbuf.Schema = NS16187549871986683199.org.apache.arrow.flatbuf.Schema;
flatbuf.Schema = NS7624605610262437867.org.apache.arrow.flatbuf.Schema;
})(flatbuf = arrow.flatbuf || (arrow.flatbuf = {}));

@@ -27,3 +27,3 @@ })(arrow = apache.arrow || (apache.arrow = {}));

*
* @enum
* @enum {number}
*/

@@ -44,2 +44,3 @@ (function (org) {

MessageHeader[MessageHeader["Tensor"] = 4] = "Tensor";
MessageHeader[MessageHeader["SparseTensor"] = 5] = "SparseTensor";
})(MessageHeader = flatbuf.MessageHeader || (flatbuf.MessageHeader = {}));

@@ -72,11 +73,9 @@ })(flatbuf = arrow.flatbuf || (arrow.flatbuf = {}));

constructor() {
/**
* @type {number}
*/
this.bb = null;
this.bb_pos = 0;
}
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {FieldNode}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns FieldNode
*/

@@ -92,3 +91,3 @@ __init(i, bb) {

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -103,3 +102,3 @@ length() {

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -110,6 +109,6 @@ nullCount() {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} length
* @param {flatbuffers.Long} null_count
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param flatbuffers.Long length
* @param flatbuffers.Long null_count
* @returns flatbuffers.Offset
*/

@@ -144,11 +143,9 @@ static createFieldNode(builder, length, null_count) {

constructor() {
/**
* @type {number}
*/
this.bb = null;
this.bb_pos = 0;
}
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {RecordBatch}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns RecordBatch
*/

@@ -161,5 +158,5 @@ __init(i, bb) {

/**
* @param {flatbuffers.ByteBuffer} bb
* @param {RecordBatch=} obj
* @returns {RecordBatch}
* @param flatbuffers.ByteBuffer bb
* @param RecordBatch= obj
* @returns RecordBatch
*/

@@ -170,6 +167,14 @@ static getRootAsRecordBatch(bb, obj) {

/**
* @param flatbuffers.ByteBuffer bb
* @param RecordBatch= obj
* @returns RecordBatch
*/
static getSizePrefixedRootAsRecordBatch(bb, obj) {
return (obj || new RecordBatch).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
/**
* number of records / rows. The arrays in the batch should all have this
* length
*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -183,5 +188,5 @@ length() {

*
* @param {number} index
* @param {org.apache.arrow.flatbuf.FieldNode=} obj
* @returns {org.apache.arrow.flatbuf.FieldNode}
* @param number index
* @param org.apache.arrow.flatbuf.FieldNode= obj
* @returns org.apache.arrow.flatbuf.FieldNode
*/

@@ -193,3 +198,3 @@ nodes(index, obj) {

/**
* @returns {number}
* @returns number
*/

@@ -208,12 +213,12 @@ nodesLength() {

*
* @param {number} index
* @param {org.apache.arrow.flatbuf.Buffer=} obj
* @returns {org.apache.arrow.flatbuf.Buffer}
* @param number index
* @param org.apache.arrow.flatbuf.Buffer= obj
* @returns org.apache.arrow.flatbuf.Buffer
*/
buffers(index, obj) {
let offset = this.bb.__offset(this.bb_pos, 8);
return offset ? (obj || new NS16187549871986683199.org.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos + offset) + index * 16, this.bb) : null;
return offset ? (obj || new NS7624605610262437867.org.apache.arrow.flatbuf.Buffer).__init(this.bb.__vector(this.bb_pos + offset) + index * 16, this.bb) : null;
}
/**
* @returns {number}
* @returns number
*/

@@ -225,3 +230,3 @@ buffersLength() {

/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/

@@ -232,4 +237,4 @@ static startRecordBatch(builder) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} length
* @param flatbuffers.Builder builder
* @param flatbuffers.Long length
*/

@@ -240,4 +245,4 @@ static addLength(builder, length) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} nodesOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset nodesOffset
*/

@@ -248,4 +253,4 @@ static addNodes(builder, nodesOffset) {

/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/

@@ -256,4 +261,4 @@ static startNodesVector(builder, numElems) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} buffersOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset buffersOffset
*/

@@ -264,4 +269,4 @@ static addBuffers(builder, buffersOffset) {

/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/

@@ -272,4 +277,4 @@ static startBuffersVector(builder, numElems) {

/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/

@@ -280,2 +285,9 @@ static endRecordBatch(builder) {

}
static createRecordBatch(builder, length, nodesOffset, buffersOffset) {
RecordBatch.startRecordBatch(builder);
RecordBatch.addLength(builder, length);
RecordBatch.addNodes(builder, nodesOffset);
RecordBatch.addBuffers(builder, buffersOffset);
return RecordBatch.endRecordBatch(builder);
}
}

@@ -306,11 +318,9 @@ flatbuf.RecordBatch = RecordBatch;

constructor() {
/**
* @type {number}
*/
this.bb = null;
this.bb_pos = 0;
}
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {DictionaryBatch}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns DictionaryBatch
*/

@@ -323,5 +333,5 @@ __init(i, bb) {

/**
* @param {flatbuffers.ByteBuffer} bb
* @param {DictionaryBatch=} obj
* @returns {DictionaryBatch}
* @param flatbuffers.ByteBuffer bb
* @param DictionaryBatch= obj
* @returns DictionaryBatch
*/

@@ -332,4 +342,12 @@ static getRootAsDictionaryBatch(bb, obj) {

/**
* @returns {flatbuffers.Long}
* @param flatbuffers.ByteBuffer bb
* @param DictionaryBatch= obj
* @returns DictionaryBatch
*/
static getSizePrefixedRootAsDictionaryBatch(bb, obj) {
return (obj || new DictionaryBatch).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
/**
* @returns flatbuffers.Long
*/
id() {

@@ -340,4 +358,4 @@ let offset = this.bb.__offset(this.bb_pos, 4);

/**
* @param {org.apache.arrow.flatbuf.RecordBatch=} obj
* @returns {org.apache.arrow.flatbuf.RecordBatch|null}
* @param org.apache.arrow.flatbuf.RecordBatch= obj
* @returns org.apache.arrow.flatbuf.RecordBatch|null
*/

@@ -352,3 +370,3 @@ data(obj) {

*
* @returns {boolean}
* @returns boolean
*/

@@ -360,3 +378,3 @@ isDelta() {

/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/

@@ -367,4 +385,4 @@ static startDictionaryBatch(builder) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} id
* @param flatbuffers.Builder builder
* @param flatbuffers.Long id
*/

@@ -375,4 +393,4 @@ static addId(builder, id) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} dataOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset dataOffset
*/

@@ -383,4 +401,4 @@ static addData(builder, dataOffset) {

/**
* @param {flatbuffers.Builder} builder
* @param {boolean} isDelta
* @param flatbuffers.Builder builder
* @param boolean isDelta
*/

@@ -391,4 +409,4 @@ static addIsDelta(builder, isDelta) {

/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/

@@ -399,2 +417,9 @@ static endDictionaryBatch(builder) {

}
static createDictionaryBatch(builder, id, dataOffset, isDelta) {
DictionaryBatch.startDictionaryBatch(builder);
DictionaryBatch.addId(builder, id);
DictionaryBatch.addData(builder, dataOffset);
DictionaryBatch.addIsDelta(builder, isDelta);
return DictionaryBatch.endDictionaryBatch(builder);
}
}

@@ -418,11 +443,9 @@ flatbuf.DictionaryBatch = DictionaryBatch;

constructor() {
/**
* @type {number}
*/
this.bb = null;
this.bb_pos = 0;
}
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Message}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Message
*/

@@ -435,5 +458,5 @@ __init(i, bb) {

/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Message=} obj
* @returns {Message}
* @param flatbuffers.ByteBuffer bb
* @param Message= obj
* @returns Message
*/

@@ -444,18 +467,26 @@ static getRootAsMessage(bb, obj) {

/**
* @returns {org.apache.arrow.flatbuf.MetadataVersion}
* @param flatbuffers.ByteBuffer bb
* @param Message= obj
* @returns Message
*/
static getSizePrefixedRootAsMessage(bb, obj) {
return (obj || new Message).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}
/**
* @returns org.apache.arrow.flatbuf.MetadataVersion
*/
version() {
let offset = this.bb.__offset(this.bb_pos, 4);
return offset ? /** @type {org.apache.arrow.flatbuf.MetadataVersion} */ (this.bb.readInt16(this.bb_pos + offset)) : NS16187549871986683199.org.apache.arrow.flatbuf.MetadataVersion.V1;
return offset ? /** */ (this.bb.readInt16(this.bb_pos + offset)) : NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion.V1;
}
/**
* @returns {org.apache.arrow.flatbuf.MessageHeader}
* @returns org.apache.arrow.flatbuf.MessageHeader
*/
headerType() {
let offset = this.bb.__offset(this.bb_pos, 6);
return offset ? /** @type {org.apache.arrow.flatbuf.MessageHeader} */ (this.bb.readUint8(this.bb_pos + offset)) : org.apache.arrow.flatbuf.MessageHeader.NONE;
return offset ? /** */ (this.bb.readUint8(this.bb_pos + offset)) : org.apache.arrow.flatbuf.MessageHeader.NONE;
}
/**
* @param {flatbuffers.Table} obj
* @returns {?flatbuffers.Table}
* @param flatbuffers.Table obj
* @returns ?flatbuffers.Table
*/

@@ -467,3 +498,3 @@ header(obj) {

/**
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -475,17 +506,33 @@ bodyLength() {

/**
* @param {flatbuffers.Builder} builder
* @param number index
* @param org.apache.arrow.flatbuf.KeyValue= obj
* @returns org.apache.arrow.flatbuf.KeyValue
*/
customMetadata(index, obj) {
let offset = this.bb.__offset(this.bb_pos, 12);
return offset ? (obj || new NS7624605610262437867.org.apache.arrow.flatbuf.KeyValue).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
}
/**
* @returns number
*/
customMetadataLength() {
let offset = this.bb.__offset(this.bb_pos, 12);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
}
/**
* @param flatbuffers.Builder builder
*/
static startMessage(builder) {
builder.startObject(4);
builder.startObject(5);
}
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.MetadataVersion} version
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.MetadataVersion version
*/
static addVersion(builder, version) {
builder.addFieldInt16(0, version, NS16187549871986683199.org.apache.arrow.flatbuf.MetadataVersion.V1);
builder.addFieldInt16(0, version, NS7624605610262437867.org.apache.arrow.flatbuf.MetadataVersion.V1);
}
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.MessageHeader} headerType
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.MessageHeader headerType
*/

@@ -496,4 +543,4 @@ static addHeaderType(builder, headerType) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} headerOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset headerOffset
*/

@@ -504,4 +551,4 @@ static addHeader(builder, headerOffset) {

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} bodyLength
* @param flatbuffers.Builder builder
* @param flatbuffers.Long bodyLength
*/

@@ -512,5 +559,31 @@ static addBodyLength(builder, bodyLength) {

/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset customMetadataOffset
*/
static addCustomMetadata(builder, customMetadataOffset) {
builder.addFieldOffset(4, customMetadataOffset, 0);
}
/**
* @param flatbuffers.Builder builder
* @param Array.<flatbuffers.Offset> data
* @returns flatbuffers.Offset
*/
static createCustomMetadataVector(builder, data) {
builder.startVector(4, data.length, 4);
for (let i = data.length - 1; i >= 0; i--) {
builder.addOffset(data[i]);
}
return builder.endVector();
}
/**
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startCustomMetadataVector(builder, numElems) {
builder.startVector(4, numElems, 4);
}
/**
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endMessage(builder) {

@@ -521,4 +594,4 @@ let offset = builder.endObject();

/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} offset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/

@@ -528,2 +601,18 @@ static finishMessageBuffer(builder, offset) {

}
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishSizePrefixedMessageBuffer(builder, offset) {
builder.finish(offset, undefined);
}
static createMessage(builder, version, headerType, headerOffset, bodyLength, customMetadataOffset) {
Message.startMessage(builder);
Message.addVersion(builder, version);
Message.addHeaderType(builder, headerType);
Message.addHeader(builder, headerOffset);
Message.addBodyLength(builder, bodyLength);
Message.addCustomMetadata(builder, customMetadataOffset);
return Message.endMessage(builder);
}
}

@@ -530,0 +619,0 @@ flatbuf.Message = Message;

import { flatbuffers } from 'flatbuffers';
/**
* @enum
* @enum {number}
*/

@@ -26,3 +26,3 @@ export declare namespace org.apache.arrow.flatbuf {

/**
* @enum
* @enum {number}
*/

@@ -36,3 +36,3 @@ export declare namespace org.apache.arrow.flatbuf {

/**
* @enum
* @enum {number}
*/

@@ -47,3 +47,3 @@ export declare namespace org.apache.arrow.flatbuf {

/**
* @enum
* @enum {number}
*/

@@ -57,3 +57,3 @@ export declare namespace org.apache.arrow.flatbuf {

/**
* @enum
* @enum {number}
*/

@@ -69,3 +69,3 @@ export declare namespace org.apache.arrow.flatbuf {

/**
* @enum
* @enum {number}
*/

@@ -83,3 +83,3 @@ export declare namespace org.apache.arrow.flatbuf {

*
* @enum
* @enum {number}
*/

@@ -105,3 +105,4 @@ export declare namespace org.apache.arrow.flatbuf {

FixedSizeList = 16,
Map = 17
Map = 17,
Duration = 18
}

@@ -111,31 +112,5 @@ }

* ----------------------------------------------------------------------
* The possible types of a vector
*
* @enum
*/
export declare namespace org.apache.arrow.flatbuf {
enum VectorType {
/**
* used in List type, Dense Union and variable length primitive types (String, Binary)
*/
OFFSET = 0,
/**
* actual data, either wixed width primitive types in slots or variable width delimited by an OFFSET vector
*/
DATA = 1,
/**
* Bit vector indicating if each value is null
*/
VALIDITY = 2,
/**
* Type vector used in Union type
*/
TYPE = 3
}
}
/**
* ----------------------------------------------------------------------
* Endianness of the platform producing the data
*
* @enum
* @enum {number}
*/

@@ -155,31 +130,32 @@ export declare namespace org.apache.arrow.flatbuf {

class Null {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Null}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Null
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Null;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Null=} obj
* @returns {Null}
* @param flatbuffers.ByteBuffer bb
* @param Null= obj
* @returns Null
*/
static getRootAsNull(bb: flatbuffers.ByteBuffer, obj?: Null): Null;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.ByteBuffer bb
* @param Null= obj
* @returns Null
*/
static getSizePrefixedRootAsNull(bb: flatbuffers.ByteBuffer, obj?: Null): Null;
/**
* @param flatbuffers.Builder builder
*/
static startNull(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endNull(builder: flatbuffers.Builder): flatbuffers.Offset;
static createNull(builder: flatbuffers.Builder): flatbuffers.Offset;
}

@@ -196,31 +172,32 @@ }

class Struct_ {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Struct_}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Struct_
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Struct_;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Struct_=} obj
* @returns {Struct_}
* @param flatbuffers.ByteBuffer bb
* @param Struct_= obj
* @returns Struct_
*/
static getRootAsStruct_(bb: flatbuffers.ByteBuffer, obj?: Struct_): Struct_;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.ByteBuffer bb
* @param Struct_= obj
* @returns Struct_
*/
static getSizePrefixedRootAsStruct_(bb: flatbuffers.ByteBuffer, obj?: Struct_): Struct_;
/**
* @param flatbuffers.Builder builder
*/
static startStruct_(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endStruct_(builder: flatbuffers.Builder): flatbuffers.Offset;
static createStruct_(builder: flatbuffers.Builder): flatbuffers.Offset;
}

@@ -233,31 +210,32 @@ }

class List {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {List}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns List
*/
__init(i: number, bb: flatbuffers.ByteBuffer): List;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {List=} obj
* @returns {List}
* @param flatbuffers.ByteBuffer bb
* @param List= obj
* @returns List
*/
static getRootAsList(bb: flatbuffers.ByteBuffer, obj?: List): List;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.ByteBuffer bb
* @param List= obj
* @returns List
*/
static getSizePrefixedRootAsList(bb: flatbuffers.ByteBuffer, obj?: List): List;
/**
* @param flatbuffers.Builder builder
*/
static startList(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endList(builder: flatbuffers.Builder): flatbuffers.Offset;
static createList(builder: flatbuffers.Builder): flatbuffers.Offset;
}

@@ -270,42 +248,43 @@ }

class FixedSizeList {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {FixedSizeList}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns FixedSizeList
*/
__init(i: number, bb: flatbuffers.ByteBuffer): FixedSizeList;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {FixedSizeList=} obj
* @returns {FixedSizeList}
* @param flatbuffers.ByteBuffer bb
* @param FixedSizeList= obj
* @returns FixedSizeList
*/
static getRootAsFixedSizeList(bb: flatbuffers.ByteBuffer, obj?: FixedSizeList): FixedSizeList;
/**
* @param flatbuffers.ByteBuffer bb
* @param FixedSizeList= obj
* @returns FixedSizeList
*/
static getSizePrefixedRootAsFixedSizeList(bb: flatbuffers.ByteBuffer, obj?: FixedSizeList): FixedSizeList;
/**
* Number of list items per value
*
* @returns {number}
* @returns number
*/
listSize(): number;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startFixedSizeList(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} listSize
* @param flatbuffers.Builder builder
* @param number listSize
*/
static addListSize(builder: flatbuffers.Builder, listSize: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endFixedSizeList(builder: flatbuffers.Builder): flatbuffers.Offset;
static createFixedSizeList(builder: flatbuffers.Builder, listSize: number): flatbuffers.Offset;
}

@@ -343,42 +322,43 @@ }

class Map {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Map}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Map
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Map;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Map=} obj
* @returns {Map}
* @param flatbuffers.ByteBuffer bb
* @param Map= obj
* @returns Map
*/
static getRootAsMap(bb: flatbuffers.ByteBuffer, obj?: Map): Map;
/**
* @param flatbuffers.ByteBuffer bb
* @param Map= obj
* @returns Map
*/
static getSizePrefixedRootAsMap(bb: flatbuffers.ByteBuffer, obj?: Map): Map;
/**
* Set to true if the keys within each value are sorted
*
* @returns {boolean}
* @returns boolean
*/
keysSorted(): boolean;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startMap(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {boolean} keysSorted
* @param flatbuffers.Builder builder
* @param boolean keysSorted
*/
static addKeysSorted(builder: flatbuffers.Builder, keysSorted: boolean): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endMap(builder: flatbuffers.Builder): flatbuffers.Offset;
static createMap(builder: flatbuffers.Builder, keysSorted: boolean): flatbuffers.Offset;
}

@@ -396,69 +376,70 @@ }

class Union {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Union}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Union
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Union;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Union=} obj
* @returns {Union}
* @param flatbuffers.ByteBuffer bb
* @param Union= obj
* @returns Union
*/
static getRootAsUnion(bb: flatbuffers.ByteBuffer, obj?: Union): Union;
/**
* @returns {org.apache.arrow.flatbuf.UnionMode}
* @param flatbuffers.ByteBuffer bb
* @param Union= obj
* @returns Union
*/
static getSizePrefixedRootAsUnion(bb: flatbuffers.ByteBuffer, obj?: Union): Union;
/**
* @returns org.apache.arrow.flatbuf.UnionMode
*/
mode(): org.apache.arrow.flatbuf.UnionMode;
/**
* @param {number} index
* @returns {number}
* @param number index
* @returns number
*/
typeIds(index: number): number | null;
/**
* @returns {number}
* @returns number
*/
typeIdsLength(): number;
/**
* @returns {Int32Array}
* @returns Int32Array
*/
typeIdsArray(): Int32Array | null;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startUnion(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.UnionMode} mode
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.UnionMode mode
*/
static addMode(builder: flatbuffers.Builder, mode: org.apache.arrow.flatbuf.UnionMode): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} typeIdsOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset typeIdsOffset
*/
static addTypeIds(builder: flatbuffers.Builder, typeIdsOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {Array.<number>} data
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param Array.<number> data
* @returns flatbuffers.Offset
*/
static createTypeIdsVector(builder: flatbuffers.Builder, data: number[] | Int32Array): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startTypeIdsVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endUnion(builder: flatbuffers.Builder): flatbuffers.Offset;
static createUnion(builder: flatbuffers.Builder, mode: org.apache.arrow.flatbuf.UnionMode, typeIdsOffset: flatbuffers.Offset): flatbuffers.Offset;
}

@@ -471,49 +452,50 @@ }

class Int {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Int}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Int
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Int;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Int=} obj
* @returns {Int}
* @param flatbuffers.ByteBuffer bb
* @param Int= obj
* @returns Int
*/
static getRootAsInt(bb: flatbuffers.ByteBuffer, obj?: Int): Int;
/**
* @returns {number}
* @param flatbuffers.ByteBuffer bb
* @param Int= obj
* @returns Int
*/
static getSizePrefixedRootAsInt(bb: flatbuffers.ByteBuffer, obj?: Int): Int;
/**
* @returns number
*/
bitWidth(): number;
/**
* @returns {boolean}
* @returns boolean
*/
isSigned(): boolean;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startInt(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} bitWidth
* @param flatbuffers.Builder builder
* @param number bitWidth
*/
static addBitWidth(builder: flatbuffers.Builder, bitWidth: number): void;
/**
* @param {flatbuffers.Builder} builder
* @param {boolean} isSigned
* @param flatbuffers.Builder builder
* @param boolean isSigned
*/
static addIsSigned(builder: flatbuffers.Builder, isSigned: boolean): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endInt(builder: flatbuffers.Builder): flatbuffers.Offset;
static createInt(builder: flatbuffers.Builder, bitWidth: number, isSigned: boolean): flatbuffers.Offset;
}

@@ -526,40 +508,41 @@ }

class FloatingPoint {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {FloatingPoint}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns FloatingPoint
*/
__init(i: number, bb: flatbuffers.ByteBuffer): FloatingPoint;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {FloatingPoint=} obj
* @returns {FloatingPoint}
* @param flatbuffers.ByteBuffer bb
* @param FloatingPoint= obj
* @returns FloatingPoint
*/
static getRootAsFloatingPoint(bb: flatbuffers.ByteBuffer, obj?: FloatingPoint): FloatingPoint;
/**
* @returns {org.apache.arrow.flatbuf.Precision}
* @param flatbuffers.ByteBuffer bb
* @param FloatingPoint= obj
* @returns FloatingPoint
*/
static getSizePrefixedRootAsFloatingPoint(bb: flatbuffers.ByteBuffer, obj?: FloatingPoint): FloatingPoint;
/**
* @returns org.apache.arrow.flatbuf.Precision
*/
precision(): org.apache.arrow.flatbuf.Precision;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startFloatingPoint(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.Precision} precision
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.Precision precision
*/
static addPrecision(builder: flatbuffers.Builder, precision: org.apache.arrow.flatbuf.Precision): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endFloatingPoint(builder: flatbuffers.Builder): flatbuffers.Offset;
static createFloatingPoint(builder: flatbuffers.Builder, precision: org.apache.arrow.flatbuf.Precision): flatbuffers.Offset;
}

@@ -574,31 +557,32 @@ }

class Utf8 {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Utf8}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Utf8
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Utf8;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Utf8=} obj
* @returns {Utf8}
* @param flatbuffers.ByteBuffer bb
* @param Utf8= obj
* @returns Utf8
*/
static getRootAsUtf8(bb: flatbuffers.ByteBuffer, obj?: Utf8): Utf8;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.ByteBuffer bb
* @param Utf8= obj
* @returns Utf8
*/
static getSizePrefixedRootAsUtf8(bb: flatbuffers.ByteBuffer, obj?: Utf8): Utf8;
/**
* @param flatbuffers.Builder builder
*/
static startUtf8(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endUtf8(builder: flatbuffers.Builder): flatbuffers.Offset;
static createUtf8(builder: flatbuffers.Builder): flatbuffers.Offset;
}

@@ -611,31 +595,32 @@ }

class Binary {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Binary}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Binary
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Binary;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Binary=} obj
* @returns {Binary}
* @param flatbuffers.ByteBuffer bb
* @param Binary= obj
* @returns Binary
*/
static getRootAsBinary(bb: flatbuffers.ByteBuffer, obj?: Binary): Binary;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.ByteBuffer bb
* @param Binary= obj
* @returns Binary
*/
static getSizePrefixedRootAsBinary(bb: flatbuffers.ByteBuffer, obj?: Binary): Binary;
/**
* @param flatbuffers.Builder builder
*/
static startBinary(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endBinary(builder: flatbuffers.Builder): flatbuffers.Offset;
static createBinary(builder: flatbuffers.Builder): flatbuffers.Offset;
}

@@ -648,42 +633,43 @@ }

class FixedSizeBinary {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {FixedSizeBinary}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns FixedSizeBinary
*/
__init(i: number, bb: flatbuffers.ByteBuffer): FixedSizeBinary;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {FixedSizeBinary=} obj
* @returns {FixedSizeBinary}
* @param flatbuffers.ByteBuffer bb
* @param FixedSizeBinary= obj
* @returns FixedSizeBinary
*/
static getRootAsFixedSizeBinary(bb: flatbuffers.ByteBuffer, obj?: FixedSizeBinary): FixedSizeBinary;
/**
* @param flatbuffers.ByteBuffer bb
* @param FixedSizeBinary= obj
* @returns FixedSizeBinary
*/
static getSizePrefixedRootAsFixedSizeBinary(bb: flatbuffers.ByteBuffer, obj?: FixedSizeBinary): FixedSizeBinary;
/**
* Number of bytes per value
*
* @returns {number}
* @returns number
*/
byteWidth(): number;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startFixedSizeBinary(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} byteWidth
* @param flatbuffers.Builder builder
* @param number byteWidth
*/
static addByteWidth(builder: flatbuffers.Builder, byteWidth: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endFixedSizeBinary(builder: flatbuffers.Builder): flatbuffers.Offset;
static createFixedSizeBinary(builder: flatbuffers.Builder, byteWidth: number): flatbuffers.Offset;
}

@@ -696,31 +682,32 @@ }

class Bool {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Bool}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Bool
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Bool;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Bool=} obj
* @returns {Bool}
* @param flatbuffers.ByteBuffer bb
* @param Bool= obj
* @returns Bool
*/
static getRootAsBool(bb: flatbuffers.ByteBuffer, obj?: Bool): Bool;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.ByteBuffer bb
* @param Bool= obj
* @returns Bool
*/
static getSizePrefixedRootAsBool(bb: flatbuffers.ByteBuffer, obj?: Bool): Bool;
/**
* @param flatbuffers.Builder builder
*/
static startBool(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endBool(builder: flatbuffers.Builder): flatbuffers.Offset;
static createBool(builder: flatbuffers.Builder): flatbuffers.Offset;
}

@@ -733,26 +720,26 @@ }

class Decimal {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Decimal}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Decimal
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Decimal;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Decimal=} obj
* @returns {Decimal}
* @param flatbuffers.ByteBuffer bb
* @param Decimal= obj
* @returns Decimal
*/
static getRootAsDecimal(bb: flatbuffers.ByteBuffer, obj?: Decimal): Decimal;
/**
* @param flatbuffers.ByteBuffer bb
* @param Decimal= obj
* @returns Decimal
*/
static getSizePrefixedRootAsDecimal(bb: flatbuffers.ByteBuffer, obj?: Decimal): Decimal;
/**
* Total number of decimal digits
*
* @returns {number}
* @returns number
*/

@@ -763,24 +750,25 @@ precision(): number;

*
* @returns {number}
* @returns number
*/
scale(): number;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startDecimal(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} precision
* @param flatbuffers.Builder builder
* @param number precision
*/
static addPrecision(builder: flatbuffers.Builder, precision: number): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} scale
* @param flatbuffers.Builder builder
* @param number scale
*/
static addScale(builder: flatbuffers.Builder, scale: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endDecimal(builder: flatbuffers.Builder): flatbuffers.Offset;
static createDecimal(builder: flatbuffers.Builder, precision: number, scale: number): flatbuffers.Offset;
}

@@ -800,40 +788,41 @@ }

class Date {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Date}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Date
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Date;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Date=} obj
* @returns {Date}
* @param flatbuffers.ByteBuffer bb
* @param Date= obj
* @returns Date
*/
static getRootAsDate(bb: flatbuffers.ByteBuffer, obj?: Date): Date;
/**
* @returns {org.apache.arrow.flatbuf.DateUnit}
* @param flatbuffers.ByteBuffer bb
* @param Date= obj
* @returns Date
*/
static getSizePrefixedRootAsDate(bb: flatbuffers.ByteBuffer, obj?: Date): Date;
/**
* @returns org.apache.arrow.flatbuf.DateUnit
*/
unit(): org.apache.arrow.flatbuf.DateUnit;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startDate(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.DateUnit} unit
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.DateUnit unit
*/
static addUnit(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.DateUnit): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endDate(builder: flatbuffers.Builder): flatbuffers.Offset;
static createDate(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.DateUnit): flatbuffers.Offset;
}

@@ -850,49 +839,50 @@ }

class Time {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Time}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Time
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Time;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Time=} obj
* @returns {Time}
* @param flatbuffers.ByteBuffer bb
* @param Time= obj
* @returns Time
*/
static getRootAsTime(bb: flatbuffers.ByteBuffer, obj?: Time): Time;
/**
* @returns {org.apache.arrow.flatbuf.TimeUnit}
* @param flatbuffers.ByteBuffer bb
* @param Time= obj
* @returns Time
*/
static getSizePrefixedRootAsTime(bb: flatbuffers.ByteBuffer, obj?: Time): Time;
/**
* @returns org.apache.arrow.flatbuf.TimeUnit
*/
unit(): org.apache.arrow.flatbuf.TimeUnit;
/**
* @returns {number}
* @returns number
*/
bitWidth(): number;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startTime(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.TimeUnit} unit
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.TimeUnit unit
*/
static addUnit(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.TimeUnit): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} bitWidth
* @param flatbuffers.Builder builder
* @param number bitWidth
*/
static addBitWidth(builder: flatbuffers.Builder, bitWidth: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endTime(builder: flatbuffers.Builder): flatbuffers.Offset;
static createTime(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.TimeUnit, bitWidth: number): flatbuffers.Offset;
}

@@ -912,25 +902,25 @@ }

class Timestamp {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Timestamp}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Timestamp
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Timestamp;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Timestamp=} obj
* @returns {Timestamp}
* @param flatbuffers.ByteBuffer bb
* @param Timestamp= obj
* @returns Timestamp
*/
static getRootAsTimestamp(bb: flatbuffers.ByteBuffer, obj?: Timestamp): Timestamp;
/**
* @returns {org.apache.arrow.flatbuf.TimeUnit}
* @param flatbuffers.ByteBuffer bb
* @param Timestamp= obj
* @returns Timestamp
*/
static getSizePrefixedRootAsTimestamp(bb: flatbuffers.ByteBuffer, obj?: Timestamp): Timestamp;
/**
* @returns org.apache.arrow.flatbuf.TimeUnit
*/
unit(): org.apache.arrow.flatbuf.TimeUnit;

@@ -959,4 +949,4 @@ /**

*
* @param {flatbuffers.Encoding=} optionalEncoding
* @returns {string|Uint8Array|null}
* @param flatbuffers.Encoding= optionalEncoding
* @returns string|Uint8Array|null
*/

@@ -966,20 +956,21 @@ timezone(): string | null;

/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startTimestamp(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.TimeUnit} unit
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.TimeUnit unit
*/
static addUnit(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.TimeUnit): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} timezoneOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset timezoneOffset
*/
static addTimezone(builder: flatbuffers.Builder, timezoneOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endTimestamp(builder: flatbuffers.Builder): flatbuffers.Offset;
static createTimestamp(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.TimeUnit, timezoneOffset: flatbuffers.Offset): flatbuffers.Offset;
}

@@ -992,102 +983,87 @@ }

class Interval {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Interval}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Interval
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Interval;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Interval=} obj
* @returns {Interval}
* @param flatbuffers.ByteBuffer bb
* @param Interval= obj
* @returns Interval
*/
static getRootAsInterval(bb: flatbuffers.ByteBuffer, obj?: Interval): Interval;
/**
* @returns {org.apache.arrow.flatbuf.IntervalUnit}
* @param flatbuffers.ByteBuffer bb
* @param Interval= obj
* @returns Interval
*/
static getSizePrefixedRootAsInterval(bb: flatbuffers.ByteBuffer, obj?: Interval): Interval;
/**
* @returns org.apache.arrow.flatbuf.IntervalUnit
*/
unit(): org.apache.arrow.flatbuf.IntervalUnit;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startInterval(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.IntervalUnit} unit
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.IntervalUnit unit
*/
static addUnit(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.IntervalUnit): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endInterval(builder: flatbuffers.Builder): flatbuffers.Offset;
static createInterval(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.IntervalUnit): flatbuffers.Offset;
}
}
/**
* ----------------------------------------------------------------------
* represents the physical layout of a buffer
* buffers have fixed width slots of a given type
*
* @constructor
*/
export declare namespace org.apache.arrow.flatbuf {
class VectorLayout {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
class Duration {
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {VectorLayout}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Duration
*/
__init(i: number, bb: flatbuffers.ByteBuffer): VectorLayout;
__init(i: number, bb: flatbuffers.ByteBuffer): Duration;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {VectorLayout=} obj
* @returns {VectorLayout}
* @param flatbuffers.ByteBuffer bb
* @param Duration= obj
* @returns Duration
*/
static getRootAsVectorLayout(bb: flatbuffers.ByteBuffer, obj?: VectorLayout): VectorLayout;
static getRootAsDuration(bb: flatbuffers.ByteBuffer, obj?: Duration): Duration;
/**
* the width of a slot in the buffer (typically 1, 8, 16, 32 or 64)
*
* @returns {number}
* @param flatbuffers.ByteBuffer bb
* @param Duration= obj
* @returns Duration
*/
bitWidth(): number;
static getSizePrefixedRootAsDuration(bb: flatbuffers.ByteBuffer, obj?: Duration): Duration;
/**
* the purpose of the vector
*
* @returns {org.apache.arrow.flatbuf.VectorType}
* @returns org.apache.arrow.flatbuf.TimeUnit
*/
type(): org.apache.arrow.flatbuf.VectorType;
unit(): org.apache.arrow.flatbuf.TimeUnit;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startVectorLayout(builder: flatbuffers.Builder): void;
static startDuration(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {number} bitWidth
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.TimeUnit unit
*/
static addBitWidth(builder: flatbuffers.Builder, bitWidth: number): void;
static addUnit(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.TimeUnit): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.VectorType} type
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static addType(builder: flatbuffers.Builder, type: org.apache.arrow.flatbuf.VectorType): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
*/
static endVectorLayout(builder: flatbuffers.Builder): flatbuffers.Offset;
static endDuration(builder: flatbuffers.Builder): flatbuffers.Offset;
static createDuration(builder: flatbuffers.Builder, unit: org.apache.arrow.flatbuf.TimeUnit): flatbuffers.Offset;
}

@@ -1104,31 +1080,31 @@ }

class KeyValue {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {KeyValue}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns KeyValue
*/
__init(i: number, bb: flatbuffers.ByteBuffer): KeyValue;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {KeyValue=} obj
* @returns {KeyValue}
* @param flatbuffers.ByteBuffer bb
* @param KeyValue= obj
* @returns KeyValue
*/
static getRootAsKeyValue(bb: flatbuffers.ByteBuffer, obj?: KeyValue): KeyValue;
/**
* @param {flatbuffers.Encoding=} optionalEncoding
* @returns {string|Uint8Array|null}
* @param flatbuffers.ByteBuffer bb
* @param KeyValue= obj
* @returns KeyValue
*/
static getSizePrefixedRootAsKeyValue(bb: flatbuffers.ByteBuffer, obj?: KeyValue): KeyValue;
/**
* @param flatbuffers.Encoding= optionalEncoding
* @returns string|Uint8Array|null
*/
key(): string | null;
key(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
/**
* @param {flatbuffers.Encoding=} optionalEncoding
* @returns {string|Uint8Array|null}
* @param flatbuffers.Encoding= optionalEncoding
* @returns string|Uint8Array|null
*/

@@ -1138,20 +1114,21 @@ value(): string | null;

/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startKeyValue(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} keyOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset keyOffset
*/
static addKey(builder: flatbuffers.Builder, keyOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} valueOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset valueOffset
*/
static addValue(builder: flatbuffers.Builder, valueOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endKeyValue(builder: flatbuffers.Builder): flatbuffers.Offset;
static createKeyValue(builder: flatbuffers.Builder, keyOffset: flatbuffers.Offset, valueOffset: flatbuffers.Offset): flatbuffers.Offset;
}

@@ -1167,23 +1144,23 @@ }

class DictionaryEncoding {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {DictionaryEncoding}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns DictionaryEncoding
*/
__init(i: number, bb: flatbuffers.ByteBuffer): DictionaryEncoding;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {DictionaryEncoding=} obj
* @returns {DictionaryEncoding}
* @param flatbuffers.ByteBuffer bb
* @param DictionaryEncoding= obj
* @returns DictionaryEncoding
*/
static getRootAsDictionaryEncoding(bb: flatbuffers.ByteBuffer, obj?: DictionaryEncoding): DictionaryEncoding;
/**
* @param flatbuffers.ByteBuffer bb
* @param DictionaryEncoding= obj
* @returns DictionaryEncoding
*/
static getSizePrefixedRootAsDictionaryEncoding(bb: flatbuffers.ByteBuffer, obj?: DictionaryEncoding): DictionaryEncoding;
/**
* The known dictionary id in the application where this data is used. In

@@ -1193,3 +1170,3 @@ * the file or streaming formats, the dictionary ids are found in the

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -1201,4 +1178,4 @@ id(): flatbuffers.Long;

*
* @param {org.apache.arrow.flatbuf.Int=} obj
* @returns {org.apache.arrow.flatbuf.Int|null}
* @param org.apache.arrow.flatbuf.Int= obj
* @returns org.apache.arrow.flatbuf.Int|null
*/

@@ -1212,29 +1189,30 @@ indexType(obj?: org.apache.arrow.flatbuf.Int): org.apache.arrow.flatbuf.Int | null;

*
* @returns {boolean}
* @returns boolean
*/
isOrdered(): boolean;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startDictionaryEncoding(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} id
* @param flatbuffers.Builder builder
* @param flatbuffers.Long id
*/
static addId(builder: flatbuffers.Builder, id: flatbuffers.Long): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} indexTypeOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset indexTypeOffset
*/
static addIndexType(builder: flatbuffers.Builder, indexTypeOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {boolean} isOrdered
* @param flatbuffers.Builder builder
* @param boolean isOrdered
*/
static addIsOrdered(builder: flatbuffers.Builder, isOrdered: boolean): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endDictionaryEncoding(builder: flatbuffers.Builder): flatbuffers.Offset;
static createDictionaryEncoding(builder: flatbuffers.Builder, id: flatbuffers.Long, indexTypeOffset: flatbuffers.Offset, isOrdered: boolean): flatbuffers.Offset;
}

@@ -1247,6 +1225,2 @@ }

*
* - children is only for nested Arrow arrays
* - For primitive types, children will have length 0
* - nullable should default to true in general
*
* @constructor

@@ -1256,162 +1230,146 @@ */

class Field {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Field}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Field
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Field;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Field=} obj
* @returns {Field}
* @param flatbuffers.ByteBuffer bb
* @param Field= obj
* @returns Field
*/
static getRootAsField(bb: flatbuffers.ByteBuffer, obj?: Field): Field;
/**
* @param {flatbuffers.Encoding=} optionalEncoding
* @returns {string|Uint8Array|null}
* @param flatbuffers.ByteBuffer bb
* @param Field= obj
* @returns Field
*/
static getSizePrefixedRootAsField(bb: flatbuffers.ByteBuffer, obj?: Field): Field;
/**
* Name is not required, in i.e. a List
*
* @param flatbuffers.Encoding= optionalEncoding
* @returns string|Uint8Array|null
*/
name(): string | null;
name(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
/**
* @returns {boolean}
* Whether or not this field can contain nulls. Should be true in general.
*
* @returns boolean
*/
nullable(): boolean;
/**
* @returns {org.apache.arrow.flatbuf.Type}
* @returns org.apache.arrow.flatbuf.Type
*/
typeType(): org.apache.arrow.flatbuf.Type;
/**
* @param {flatbuffers.Table} obj
* @returns {?flatbuffers.Table}
* This is the type of the decoded value if the field is dictionary encoded.
*
* @param flatbuffers.Table obj
* @returns ?flatbuffers.Table
*/
type<T extends flatbuffers.Table>(obj: T): T | null;
/**
* @param {org.apache.arrow.flatbuf.DictionaryEncoding=} obj
* @returns {org.apache.arrow.flatbuf.DictionaryEncoding|null}
* Present only if the field is dictionary encoded.
*
* @param org.apache.arrow.flatbuf.DictionaryEncoding= obj
* @returns org.apache.arrow.flatbuf.DictionaryEncoding|null
*/
dictionary(obj?: org.apache.arrow.flatbuf.DictionaryEncoding): org.apache.arrow.flatbuf.DictionaryEncoding | null;
/**
* @param {number} index
* @param {org.apache.arrow.flatbuf.Field=} obj
* @returns {org.apache.arrow.flatbuf.Field}
* children apply only to nested data types like Struct, List and Union. For
* primitive types children will have length 0.
*
* @param number index
* @param org.apache.arrow.flatbuf.Field= obj
* @returns org.apache.arrow.flatbuf.Field
*/
children(index: number, obj?: org.apache.arrow.flatbuf.Field): org.apache.arrow.flatbuf.Field | null;
/**
* @returns {number}
* @returns number
*/
childrenLength(): number;
/**
* layout of buffers produced for this type (as derived from the Type)
* does not include children
* each recordbatch will return instances of those Buffers.
* User-defined metadata
*
* @param {number} index
* @param {org.apache.arrow.flatbuf.VectorLayout=} obj
* @returns {org.apache.arrow.flatbuf.VectorLayout}
* @param number index
* @param org.apache.arrow.flatbuf.KeyValue= obj
* @returns org.apache.arrow.flatbuf.KeyValue
*/
layout(index: number, obj?: org.apache.arrow.flatbuf.VectorLayout): org.apache.arrow.flatbuf.VectorLayout | null;
/**
* @returns {number}
*/
layoutLength(): number;
/**
* @param {number} index
* @param {org.apache.arrow.flatbuf.KeyValue=} obj
* @returns {org.apache.arrow.flatbuf.KeyValue}
*/
customMetadata(index: number, obj?: org.apache.arrow.flatbuf.KeyValue): org.apache.arrow.flatbuf.KeyValue | null;
/**
* @returns {number}
* @returns number
*/
customMetadataLength(): number;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startField(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} nameOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset nameOffset
*/
static addName(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {boolean} nullable
* @param flatbuffers.Builder builder
* @param boolean nullable
*/
static addNullable(builder: flatbuffers.Builder, nullable: boolean): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.Type} typeType
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.Type typeType
*/
static addTypeType(builder: flatbuffers.Builder, typeType: org.apache.arrow.flatbuf.Type): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} typeOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset typeOffset
*/
static addType(builder: flatbuffers.Builder, typeOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} dictionaryOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset dictionaryOffset
*/
static addDictionary(builder: flatbuffers.Builder, dictionaryOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} childrenOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset childrenOffset
*/
static addChildren(builder: flatbuffers.Builder, childrenOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {Array.<flatbuffers.Offset>} data
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param Array.<flatbuffers.Offset> data
* @returns flatbuffers.Offset
*/
static createChildrenVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startChildrenVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} layoutOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset customMetadataOffset
*/
static addLayout(builder: flatbuffers.Builder, layoutOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {Array.<flatbuffers.Offset>} data
* @returns {flatbuffers.Offset}
*/
static createLayoutVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
*/
static startLayoutVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} customMetadataOffset
*/
static addCustomMetadata(builder: flatbuffers.Builder, customMetadataOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {Array.<flatbuffers.Offset>} data
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param Array.<flatbuffers.Offset> data
* @returns flatbuffers.Offset
*/
static createCustomMetadataVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startCustomMetadataVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endField(builder: flatbuffers.Builder): flatbuffers.Offset;
static createField(builder: flatbuffers.Builder, nameOffset: flatbuffers.Offset, nullable: boolean, typeType: org.apache.arrow.flatbuf.Type, typeOffset: flatbuffers.Offset, dictionaryOffset: flatbuffers.Offset, childrenOffset: flatbuffers.Offset, customMetadataOffset: flatbuffers.Offset): flatbuffers.Offset;
}

@@ -1427,14 +1385,8 @@ }

class Buffer {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Buffer}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Buffer
*/

@@ -1446,3 +1398,3 @@ __init(i: number, bb: flatbuffers.ByteBuffer): Buffer;

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/

@@ -1454,10 +1406,10 @@ offset(): flatbuffers.Long;

*
* @returns {flatbuffers.Long}
* @returns flatbuffers.Long
*/
length(): flatbuffers.Long;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Long} offset
* @param {flatbuffers.Long} length
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param flatbuffers.Long offset
* @param flatbuffers.Long length
* @returns flatbuffers.Offset
*/

@@ -1475,23 +1427,23 @@ static createBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Long, length: flatbuffers.Long): flatbuffers.Offset;

class Schema {
/**
* @type {flatbuffers.ByteBuffer}
*/
bb: flatbuffers.ByteBuffer;
/**
* @type {number}
*/
bb: flatbuffers.ByteBuffer | null;
bb_pos: number;
/**
* @param {number} i
* @param {flatbuffers.ByteBuffer} bb
* @returns {Schema}
* @param number i
* @param flatbuffers.ByteBuffer bb
* @returns Schema
*/
__init(i: number, bb: flatbuffers.ByteBuffer): Schema;
/**
* @param {flatbuffers.ByteBuffer} bb
* @param {Schema=} obj
* @returns {Schema}
* @param flatbuffers.ByteBuffer bb
* @param Schema= obj
* @returns Schema
*/
static getRootAsSchema(bb: flatbuffers.ByteBuffer, obj?: Schema): Schema;
/**
* @param flatbuffers.ByteBuffer bb
* @param Schema= obj
* @returns Schema
*/
static getSizePrefixedRootAsSchema(bb: flatbuffers.ByteBuffer, obj?: Schema): Schema;
/**
* endianness of the buffer

@@ -1501,77 +1453,83 @@ * it is Little Endian by default

*
* @returns {org.apache.arrow.flatbuf.Endianness}
* @returns org.apache.arrow.flatbuf.Endianness
*/
endianness(): org.apache.arrow.flatbuf.Endianness;
/**
* @param {number} index
* @param {org.apache.arrow.flatbuf.Field=} obj
* @returns {org.apache.arrow.flatbuf.Field}
* @param number index
* @param org.apache.arrow.flatbuf.Field= obj
* @returns org.apache.arrow.flatbuf.Field
*/
fields(index: number, obj?: org.apache.arrow.flatbuf.Field): org.apache.arrow.flatbuf.Field | null;
/**
* @returns {number}
* @returns number
*/
fieldsLength(): number;
/**
* @param {number} index
* @param {org.apache.arrow.flatbuf.KeyValue=} obj
* @returns {org.apache.arrow.flatbuf.KeyValue}
* @param number index
* @param org.apache.arrow.flatbuf.KeyValue= obj
* @returns org.apache.arrow.flatbuf.KeyValue
*/
customMetadata(index: number, obj?: org.apache.arrow.flatbuf.KeyValue): org.apache.arrow.flatbuf.KeyValue | null;
/**
* @returns {number}
* @returns number
*/
customMetadataLength(): number;
/**
* @param {flatbuffers.Builder} builder
* @param flatbuffers.Builder builder
*/
static startSchema(builder: flatbuffers.Builder): void;
/**
* @param {flatbuffers.Builder} builder
* @param {org.apache.arrow.flatbuf.Endianness} endianness
* @param flatbuffers.Builder builder
* @param org.apache.arrow.flatbuf.Endianness endianness
*/
static addEndianness(builder: flatbuffers.Builder, endianness: org.apache.arrow.flatbuf.Endianness): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} fieldsOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset fieldsOffset
*/
static addFields(builder: flatbuffers.Builder, fieldsOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {Array.<flatbuffers.Offset>} data
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param Array.<flatbuffers.Offset> data
* @returns flatbuffers.Offset
*/
static createFieldsVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startFieldsVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} customMetadataOffset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset customMetadataOffset
*/
static addCustomMetadata(builder: flatbuffers.Builder, customMetadataOffset: flatbuffers.Offset): void;
/**
* @param {flatbuffers.Builder} builder
* @param {Array.<flatbuffers.Offset>} data
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @param Array.<flatbuffers.Offset> data
* @returns flatbuffers.Offset
*/
static createCustomMetadataVector(builder: flatbuffers.Builder, data: flatbuffers.Offset[]): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
* @param flatbuffers.Builder builder
* @param number numElems
*/
static startCustomMetadataVector(builder: flatbuffers.Builder, numElems: number): void;
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}
* @param flatbuffers.Builder builder
* @returns flatbuffers.Offset
*/
static endSchema(builder: flatbuffers.Builder): flatbuffers.Offset;
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} offset
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishSchemaBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
/**
* @param flatbuffers.Builder builder
* @param flatbuffers.Offset offset
*/
static finishSizePrefixedSchemaBuffer(builder: flatbuffers.Builder, offset: flatbuffers.Offset): void;
static createSchema(builder: flatbuffers.Builder, endianness: org.apache.arrow.flatbuf.Endianness, fieldsOffset: flatbuffers.Offset, customMetadataOffset: flatbuffers.Offset): flatbuffers.Offset;
}
}

@@ -6,2 +6,4 @@ import { Data } from './data';

import * as vecs from './vector/index';
import * as builders from './builder/index';
import { BuilderOptions } from './builder/index';
/** @ignore */ declare type FloatArray = Float32Array | Float64Array;

@@ -12,2 +14,3 @@ /** @ignore */ declare type IntArray = Int8Array | Int16Array | Int32Array;

export declare type TypedArray = FloatArray | IntArray | UintArray;
/** @ignore */
export declare type BigIntArray = BigInt64Array | BigUint64Array;

@@ -63,3 +66,5 @@ /** @ignore */

/** @ignore */
export declare type VectorCtorArgs<T extends Vector<R>, R extends DataType = any, TArgs extends any[] = any[], TCtor extends new (data: Data<R>, ...args: TArgs) => T = new (data: Data<R>, ...args: TArgs) => T> = TCtor extends new (data: Data<R>, ...args: infer TArgs) => T ? TArgs : never;
export declare type VectorCtorArgs<T extends VectorType<R>, R extends DataType = any, TArgs extends any[] = any[], TCtor extends new (data: Data<R>, ...args: TArgs) => T = new (data: Data<R>, ...args: TArgs) => T> = TCtor extends new (data: Data<R>, ...args: infer TArgs) => T ? TArgs : never;
/** @ignore */
export declare type BuilderCtorArgs<T extends BuilderType<R, any>, R extends DataType = any, TArgs extends any[] = any[], TCtor extends new (type: R, ...args: TArgs) => T = new (type: R, ...args: TArgs) => T> = TCtor extends new (type: R, ...args: infer TArgs) => T ? TArgs : never;
/**

@@ -71,15 +76,250 @@ * Obtain the constructor function of an instance type

/** @ignore */
export declare type VectorCtorType<T extends Vector<R>, R extends DataType = any, TCtor extends new (data: Data<R>, ...args: VectorCtorArgs<T, R>) => T = new (data: Data<R>, ...args: VectorCtorArgs<T, R>) => T> = TCtor extends new (data: Data<R>, ...args: VectorCtorArgs<T, R>) => T ? TCtor : never;
export declare type VectorCtorType<T extends VectorType<R>, R extends DataType = any, TCtor extends new (data: Data<R>, ...args: VectorCtorArgs<T, R>) => T = new (data: Data<R>, ...args: VectorCtorArgs<T, R>) => T> = TCtor extends new (data: Data<R>, ...args: VectorCtorArgs<T, R>) => T ? TCtor : never;
/** @ignore */
export declare type Vector<T extends Type | DataType = any> = T extends Type ? TypeToVector<T> : T extends DataType ? DataTypeToVector<T> : vecs.BaseVector<any>;
export declare type BuilderCtorType<T extends BuilderType<R, any>, R extends DataType = any, TCtor extends new (options: BuilderOptions<R, any>) => T = new (options: BuilderOptions<R, any>) => T> = TCtor extends new (options: BuilderOptions<R, any>) => T ? TCtor : never;
/** @ignore */
export declare type VectorCtor<T extends Type | DataType | Vector> = T extends Vector ? VectorCtorType<T> : T extends Type ? VectorCtorType<Vector<T>> : T extends DataType ? VectorCtorType<Vector<T['TType']>> : VectorCtorType<vecs.BaseVector>;
export declare type VectorType<T extends Type | DataType = any> = T extends Type ? TypeToVector<T> : T extends DataType ? DataTypeToVector<T> : vecs.BaseVector<any>;
/** @ignore */
export declare type DataTypeCtor<T extends Type | DataType | Vector = any> = T extends DataType ? ConstructorType<T> : T extends Vector ? ConstructorType<T['type']> : T extends Type ? ConstructorType<TypeToDataType<T>> : never;
export declare type BuilderType<T extends Type | DataType = any, TNull = any> = T extends Type ? TypeToBuilder<T, TNull> : T extends DataType ? DataTypeToBuilder<T, TNull> : builders.Builder<any, TNull>;
/** @ignore */
declare type TypeToVector<T extends Type> = T extends Type.Null ? vecs.NullVector : T extends Type.Bool ? vecs.BoolVector : T extends Type.Int8 ? vecs.Int8Vector : T extends Type.Int16 ? vecs.Int16Vector : T extends Type.Int32 ? vecs.Int32Vector : T extends Type.Int64 ? vecs.Int64Vector : T extends Type.Uint8 ? vecs.Uint8Vector : T extends Type.Uint16 ? vecs.Uint16Vector : T extends Type.Uint32 ? vecs.Uint32Vector : T extends Type.Uint64 ? vecs.Uint64Vector : T extends Type.Int ? vecs.IntVector : T extends Type.Float16 ? vecs.Float16Vector : T extends Type.Float32 ? vecs.Float32Vector : T extends Type.Float64 ? vecs.Float64Vector : T extends Type.Float ? vecs.FloatVector : T extends Type.Utf8 ? vecs.Utf8Vector : T extends Type.Binary ? vecs.BinaryVector : T extends Type.FixedSizeBinary ? vecs.FixedSizeBinaryVector : T extends Type.Date ? vecs.DateVector : T extends Type.DateDay ? vecs.DateDayVector : T extends Type.DateMillisecond ? vecs.DateMillisecondVector : T extends Type.Timestamp ? vecs.TimestampVector : T extends Type.TimestampSecond ? vecs.TimestampSecondVector : T extends Type.TimestampMillisecond ? vecs.TimestampMillisecondVector : T extends Type.TimestampMicrosecond ? vecs.TimestampMicrosecondVector : T extends Type.TimestampNanosecond ? vecs.TimestampNanosecondVector : T extends Type.Time ? vecs.TimeVector : T extends Type.TimeSecond ? vecs.TimeSecondVector : T extends Type.TimeMillisecond ? vecs.TimeMillisecondVector : T extends Type.TimeMicrosecond ? vecs.TimeMicrosecondVector : T extends Type.TimeNanosecond ? vecs.TimeNanosecondVector : T extends Type.Decimal ? vecs.DecimalVector : T extends Type.Union ? vecs.UnionVector : T extends Type.DenseUnion ? vecs.DenseUnionVector : T extends Type.SparseUnion ? vecs.SparseUnionVector : T extends Type.Interval ? vecs.IntervalVector : T extends Type.IntervalDayTime ? vecs.IntervalDayTimeVector : T extends Type.IntervalYearMonth ? vecs.IntervalYearMonthVector : T extends Type.Map ? vecs.MapVector : T extends Type.List ? vecs.ListVector : T extends Type.Struct ? vecs.StructVector : T extends Type.Dictionary ? vecs.DictionaryVector : T extends Type.FixedSizeList ? vecs.FixedSizeListVector : vecs.BaseVector;
export declare type VectorCtor<T extends Type | DataType | VectorType> = T extends VectorType ? VectorCtorType<T> : T extends Type ? VectorCtorType<VectorType<T>> : T extends DataType ? VectorCtorType<VectorType<T['TType']>> : VectorCtorType<vecs.BaseVector>;
/** @ignore */
declare type DataTypeToVector<T extends DataType = any> = T extends type.Null ? vecs.NullVector : T extends type.Bool ? vecs.BoolVector : T extends type.Int8 ? vecs.Int8Vector : T extends type.Int16 ? vecs.Int16Vector : T extends type.Int32 ? vecs.Int32Vector : T extends type.Int64 ? vecs.Int64Vector : T extends type.Uint8 ? vecs.Uint8Vector : T extends type.Uint16 ? vecs.Uint16Vector : T extends type.Uint32 ? vecs.Uint32Vector : T extends type.Uint64 ? vecs.Uint64Vector : T extends type.Int ? vecs.IntVector : T extends type.Float16 ? vecs.Float16Vector : T extends type.Float32 ? vecs.Float32Vector : T extends type.Float64 ? vecs.Float64Vector : T extends type.Float ? vecs.FloatVector : T extends type.Utf8 ? vecs.Utf8Vector : T extends type.Binary ? vecs.BinaryVector : T extends type.FixedSizeBinary ? vecs.FixedSizeBinaryVector : T extends type.Date_ ? vecs.DateVector : T extends type.DateDay ? vecs.DateDayVector : T extends type.DateMillisecond ? vecs.DateMillisecondVector : T extends type.Timestamp ? vecs.TimestampVector : T extends type.TimestampSecond ? vecs.TimestampSecondVector : T extends type.TimestampMillisecond ? vecs.TimestampMillisecondVector : T extends type.TimestampMicrosecond ? vecs.TimestampMicrosecondVector : T extends type.TimestampNanosecond ? vecs.TimestampNanosecondVector : T extends type.Time ? vecs.TimeVector : T extends type.TimeSecond ? vecs.TimeSecondVector : T extends type.TimeMillisecond ? vecs.TimeMillisecondVector : T extends type.TimeMicrosecond ? vecs.TimeMicrosecondVector : T extends type.TimeNanosecond ? vecs.TimeNanosecondVector : T extends type.Decimal ? vecs.DecimalVector : T extends type.Union ? vecs.UnionVector : T extends type.DenseUnion ? vecs.DenseUnionVector : T extends type.SparseUnion ? vecs.SparseUnionVector : T extends type.Interval ? vecs.IntervalVector : T extends type.IntervalDayTime ? vecs.IntervalDayTimeVector : T extends type.IntervalYearMonth ? vecs.IntervalYearMonthVector : T extends type.Map_ ? vecs.MapVector<T['dataTypes']> : T extends type.List ? vecs.ListVector<T['valueType']> : T extends type.Struct ? vecs.StructVector<T['dataTypes']> : T extends type.Dictionary ? vecs.DictionaryVector<T['valueType'], T['indices']> : T extends type.FixedSizeList ? vecs.FixedSizeListVector<T['valueType']> : vecs.BaseVector<T>;
export declare type BuilderCtor<T extends Type | DataType = any> = T extends Type ? BuilderCtorType<BuilderType<T>> : T extends DataType ? BuilderCtorType<BuilderType<T>> : BuilderCtorType<builders.Builder>;
/** @ignore */
export declare type TypeToDataType<T extends Type> = T extends Type.Null ? type.Null : T extends Type.Bool ? type.Bool : T extends Type.Int ? type.Int : T extends Type.Int16 ? type.Int16 : T extends Type.Int32 ? type.Int32 : T extends Type.Int64 ? type.Int64 : T extends Type.Uint8 ? type.Uint8 : T extends Type.Uint16 ? type.Uint16 : T extends Type.Uint32 ? type.Uint32 : T extends Type.Uint64 ? type.Uint64 : T extends Type.Int8 ? type.Int8 : T extends Type.Float16 ? type.Float16 : T extends Type.Float32 ? type.Float32 : T extends Type.Float64 ? type.Float64 : T extends Type.Float ? type.Float : T extends Type.Utf8 ? type.Utf8 : T extends Type.Binary ? type.Binary : T extends Type.FixedSizeBinary ? type.FixedSizeBinary : T extends Type.Date ? type.Date_ : T extends Type.DateDay ? type.DateDay : T extends Type.DateMillisecond ? type.DateMillisecond : T extends Type.Timestamp ? type.Timestamp : T extends Type.TimestampSecond ? type.TimestampSecond : T extends Type.TimestampMillisecond ? type.TimestampMillisecond : T extends Type.TimestampMicrosecond ? type.TimestampMicrosecond : T extends Type.TimestampNanosecond ? type.TimestampNanosecond : T extends Type.Time ? type.Time : T extends Type.TimeSecond ? type.TimeSecond : T extends Type.TimeMillisecond ? type.TimeMillisecond : T extends Type.TimeMicrosecond ? type.TimeMicrosecond : T extends Type.TimeNanosecond ? type.TimeNanosecond : T extends Type.Decimal ? type.Decimal : T extends Type.Union ? type.Union : T extends Type.DenseUnion ? type.DenseUnion : T extends Type.SparseUnion ? type.SparseUnion : T extends Type.Interval ? type.Interval : T extends Type.IntervalDayTime ? type.IntervalDayTime : T extends Type.IntervalYearMonth ? type.IntervalYearMonth : T extends Type.Map ? type.Map_ : T extends Type.List ? type.List : T extends Type.Struct ? type.Struct : T extends Type.Dictionary ? type.Dictionary : T extends Type.FixedSizeList ? type.FixedSizeList : DataType;
export declare type DataTypeCtor<T extends Type | DataType | VectorType = any> = T extends DataType ? ConstructorType<T> : T extends VectorType ? ConstructorType<T['type']> : T extends Type ? ConstructorType<TypeToDataType<T>> : never;
/** @ignore */
declare type TypeToVector<T extends Type> = {
[key: number]: any;
[Type.Null]: vecs.NullVector;
[Type.Bool]: vecs.BoolVector;
[Type.Int8]: vecs.Int8Vector;
[Type.Int16]: vecs.Int16Vector;
[Type.Int32]: vecs.Int32Vector;
[Type.Int64]: vecs.Int64Vector;
[Type.Uint8]: vecs.Uint8Vector;
[Type.Uint16]: vecs.Uint16Vector;
[Type.Uint32]: vecs.Uint32Vector;
[Type.Uint64]: vecs.Uint64Vector;
[Type.Int]: vecs.IntVector;
[Type.Float16]: vecs.Float16Vector;
[Type.Float32]: vecs.Float32Vector;
[Type.Float64]: vecs.Float64Vector;
[Type.Float]: vecs.FloatVector;
[Type.Utf8]: vecs.Utf8Vector;
[Type.Binary]: vecs.BinaryVector;
[Type.FixedSizeBinary]: vecs.FixedSizeBinaryVector;
[Type.Date]: vecs.DateVector;
[Type.DateDay]: vecs.DateDayVector;
[Type.DateMillisecond]: vecs.DateMillisecondVector;
[Type.Timestamp]: vecs.TimestampVector;
[Type.TimestampSecond]: vecs.TimestampSecondVector;
[Type.TimestampMillisecond]: vecs.TimestampMillisecondVector;
[Type.TimestampMicrosecond]: vecs.TimestampMicrosecondVector;
[Type.TimestampNanosecond]: vecs.TimestampNanosecondVector;
[Type.Time]: vecs.TimeVector;
[Type.TimeSecond]: vecs.TimeSecondVector;
[Type.TimeMillisecond]: vecs.TimeMillisecondVector;
[Type.TimeMicrosecond]: vecs.TimeMicrosecondVector;
[Type.TimeNanosecond]: vecs.TimeNanosecondVector;
[Type.Decimal]: vecs.DecimalVector;
[Type.Union]: vecs.UnionVector;
[Type.DenseUnion]: vecs.DenseUnionVector;
[Type.SparseUnion]: vecs.SparseUnionVector;
[Type.Interval]: vecs.IntervalVector;
[Type.IntervalDayTime]: vecs.IntervalDayTimeVector;
[Type.IntervalYearMonth]: vecs.IntervalYearMonthVector;
[Type.Map]: vecs.MapVector;
[Type.List]: vecs.ListVector;
[Type.Struct]: vecs.StructVector;
[Type.Dictionary]: vecs.DictionaryVector;
[Type.FixedSizeList]: vecs.FixedSizeListVector;
}[T];
/** @ignore */
declare type DataTypeToVector<T extends DataType = any> = {
[key: number]: any;
[Type.Null]: T extends type.Null ? vecs.NullVector : vecs.BaseVector<T>;
[Type.Bool]: T extends type.Bool ? vecs.BoolVector : vecs.BaseVector<T>;
[Type.Int8]: T extends type.Int8 ? vecs.Int8Vector : vecs.BaseVector<T>;
[Type.Int16]: T extends type.Int16 ? vecs.Int16Vector : vecs.BaseVector<T>;
[Type.Int32]: T extends type.Int32 ? vecs.Int32Vector : vecs.BaseVector<T>;
[Type.Int64]: T extends type.Int64 ? vecs.Int64Vector : vecs.BaseVector<T>;
[Type.Uint8]: T extends type.Uint8 ? vecs.Uint8Vector : vecs.BaseVector<T>;
[Type.Uint16]: T extends type.Uint16 ? vecs.Uint16Vector : vecs.BaseVector<T>;
[Type.Uint32]: T extends type.Uint32 ? vecs.Uint32Vector : vecs.BaseVector<T>;
[Type.Uint64]: T extends type.Uint64 ? vecs.Uint64Vector : vecs.BaseVector<T>;
[Type.Int]: T extends type.Int ? vecs.IntVector : vecs.BaseVector<T>;
[Type.Float16]: T extends type.Float16 ? vecs.Float16Vector : vecs.BaseVector<T>;
[Type.Float32]: T extends type.Float32 ? vecs.Float32Vector : vecs.BaseVector<T>;
[Type.Float64]: T extends type.Float64 ? vecs.Float64Vector : vecs.BaseVector<T>;
[Type.Float]: T extends type.Float ? vecs.FloatVector : vecs.BaseVector<T>;
[Type.Utf8]: T extends type.Utf8 ? vecs.Utf8Vector : vecs.BaseVector<T>;
[Type.Binary]: T extends type.Binary ? vecs.BinaryVector : vecs.BaseVector<T>;
[Type.FixedSizeBinary]: T extends type.FixedSizeBinary ? vecs.FixedSizeBinaryVector : vecs.BaseVector<T>;
[Type.Date]: T extends type.Date_ ? vecs.DateVector : vecs.BaseVector<T>;
[Type.DateDay]: T extends type.DateDay ? vecs.DateDayVector : vecs.BaseVector<T>;
[Type.DateMillisecond]: T extends type.DateMillisecond ? vecs.DateMillisecondVector : vecs.BaseVector<T>;
[Type.Timestamp]: T extends type.Timestamp ? vecs.TimestampVector : vecs.BaseVector<T>;
[Type.TimestampSecond]: T extends type.TimestampSecond ? vecs.TimestampSecondVector : vecs.BaseVector<T>;
[Type.TimestampMillisecond]: T extends type.TimestampMillisecond ? vecs.TimestampMillisecondVector : vecs.BaseVector<T>;
[Type.TimestampMicrosecond]: T extends type.TimestampMicrosecond ? vecs.TimestampMicrosecondVector : vecs.BaseVector<T>;
[Type.TimestampNanosecond]: T extends type.TimestampNanosecond ? vecs.TimestampNanosecondVector : vecs.BaseVector<T>;
[Type.Time]: T extends type.Time ? vecs.TimeVector : vecs.BaseVector<T>;
[Type.TimeSecond]: T extends type.TimeSecond ? vecs.TimeSecondVector : vecs.BaseVector<T>;
[Type.TimeMillisecond]: T extends type.TimeMillisecond ? vecs.TimeMillisecondVector : vecs.BaseVector<T>;
[Type.TimeMicrosecond]: T extends type.TimeMicrosecond ? vecs.TimeMicrosecondVector : vecs.BaseVector<T>;
[Type.TimeNanosecond]: T extends type.TimeNanosecond ? vecs.TimeNanosecondVector : vecs.BaseVector<T>;
[Type.Decimal]: T extends type.Decimal ? vecs.DecimalVector : vecs.BaseVector<T>;
[Type.Union]: T extends type.Union ? vecs.UnionVector : vecs.BaseVector<T>;
[Type.DenseUnion]: T extends type.DenseUnion ? vecs.DenseUnionVector : vecs.BaseVector<T>;
[Type.SparseUnion]: T extends type.SparseUnion ? vecs.SparseUnionVector : vecs.BaseVector<T>;
[Type.Interval]: T extends type.Interval ? vecs.IntervalVector : vecs.BaseVector<T>;
[Type.IntervalDayTime]: T extends type.IntervalDayTime ? vecs.IntervalDayTimeVector : vecs.BaseVector<T>;
[Type.IntervalYearMonth]: T extends type.IntervalYearMonth ? vecs.IntervalYearMonthVector : vecs.BaseVector<T>;
[Type.Map]: T extends type.Map_ ? vecs.MapVector<T['dataTypes']> : vecs.BaseVector<T>;
[Type.List]: T extends type.List ? vecs.ListVector<T['valueType']> : vecs.BaseVector<T>;
[Type.Struct]: T extends type.Struct ? vecs.StructVector<T['dataTypes']> : vecs.BaseVector<T>;
[Type.Dictionary]: T extends type.Dictionary ? vecs.DictionaryVector<T['valueType'], T['indices']> : vecs.BaseVector<T>;
[Type.FixedSizeList]: T extends type.FixedSizeList ? vecs.FixedSizeListVector<T['valueType']> : vecs.BaseVector<T>;
}[T['TType']];
/** @ignore */
export declare type TypeToDataType<T extends Type> = {
[key: number]: type.DataType;
[Type.Null]: type.Null;
[Type.Bool]: type.Bool;
[Type.Int]: type.Int;
[Type.Int16]: type.Int16;
[Type.Int32]: type.Int32;
[Type.Int64]: type.Int64;
[Type.Uint8]: type.Uint8;
[Type.Uint16]: type.Uint16;
[Type.Uint32]: type.Uint32;
[Type.Uint64]: type.Uint64;
[Type.Int8]: type.Int8;
[Type.Float16]: type.Float16;
[Type.Float32]: type.Float32;
[Type.Float64]: type.Float64;
[Type.Float]: type.Float;
[Type.Utf8]: type.Utf8;
[Type.Binary]: type.Binary;
[Type.FixedSizeBinary]: type.FixedSizeBinary;
[Type.Date]: type.Date_;
[Type.DateDay]: type.DateDay;
[Type.DateMillisecond]: type.DateMillisecond;
[Type.Timestamp]: type.Timestamp;
[Type.TimestampSecond]: type.TimestampSecond;
[Type.TimestampMillisecond]: type.TimestampMillisecond;
[Type.TimestampMicrosecond]: type.TimestampMicrosecond;
[Type.TimestampNanosecond]: type.TimestampNanosecond;
[Type.Time]: type.Time;
[Type.TimeSecond]: type.TimeSecond;
[Type.TimeMillisecond]: type.TimeMillisecond;
[Type.TimeMicrosecond]: type.TimeMicrosecond;
[Type.TimeNanosecond]: type.TimeNanosecond;
[Type.Decimal]: type.Decimal;
[Type.Union]: type.Union;
[Type.DenseUnion]: type.DenseUnion;
[Type.SparseUnion]: type.SparseUnion;
[Type.Interval]: type.Interval;
[Type.IntervalDayTime]: type.IntervalDayTime;
[Type.IntervalYearMonth]: type.IntervalYearMonth;
[Type.Map]: type.Map_;
[Type.List]: type.List;
[Type.Struct]: type.Struct;
[Type.Dictionary]: type.Dictionary;
[Type.FixedSizeList]: type.FixedSizeList;
}[T];
/** @ignore */
declare type TypeToBuilder<T extends Type = any, TNull = any> = {
[key: number]: builders.Builder;
[Type.Null]: builders.NullBuilder<TNull>;
[Type.Bool]: builders.BoolBuilder<TNull>;
[Type.Int8]: builders.Int8Builder<TNull>;
[Type.Int16]: builders.Int16Builder<TNull>;
[Type.Int32]: builders.Int32Builder<TNull>;
[Type.Int64]: builders.Int64Builder<TNull>;
[Type.Uint8]: builders.Uint8Builder<TNull>;
[Type.Uint16]: builders.Uint16Builder<TNull>;
[Type.Uint32]: builders.Uint32Builder<TNull>;
[Type.Uint64]: builders.Uint64Builder<TNull>;
[Type.Int]: builders.IntBuilder<any, TNull>;
[Type.Float16]: builders.Float16Builder<TNull>;
[Type.Float32]: builders.Float32Builder<TNull>;
[Type.Float64]: builders.Float64Builder<TNull>;
[Type.Float]: builders.FloatBuilder<any, TNull>;
[Type.Utf8]: builders.Utf8Builder<TNull>;
[Type.Binary]: builders.BinaryBuilder<TNull>;
[Type.FixedSizeBinary]: builders.FixedSizeBinaryBuilder<TNull>;
[Type.Date]: builders.DateBuilder<any, TNull>;
[Type.DateDay]: builders.DateDayBuilder<TNull>;
[Type.DateMillisecond]: builders.DateMillisecondBuilder<TNull>;
[Type.Timestamp]: builders.TimestampBuilder<any, TNull>;
[Type.TimestampSecond]: builders.TimestampSecondBuilder<TNull>;
[Type.TimestampMillisecond]: builders.TimestampMillisecondBuilder<TNull>;
[Type.TimestampMicrosecond]: builders.TimestampMicrosecondBuilder<TNull>;
[Type.TimestampNanosecond]: builders.TimestampNanosecondBuilder<TNull>;
[Type.Time]: builders.TimeBuilder<any, TNull>;
[Type.TimeSecond]: builders.TimeSecondBuilder<TNull>;
[Type.TimeMillisecond]: builders.TimeMillisecondBuilder<TNull>;
[Type.TimeMicrosecond]: builders.TimeMicrosecondBuilder<TNull>;
[Type.TimeNanosecond]: builders.TimeNanosecondBuilder<TNull>;
[Type.Decimal]: builders.DecimalBuilder<TNull>;
[Type.Union]: builders.UnionBuilder<any, TNull>;
[Type.DenseUnion]: builders.DenseUnionBuilder<any, TNull>;
[Type.SparseUnion]: builders.SparseUnionBuilder<any, TNull>;
[Type.Interval]: builders.IntervalBuilder<any, TNull>;
[Type.IntervalDayTime]: builders.IntervalDayTimeBuilder<TNull>;
[Type.IntervalYearMonth]: builders.IntervalYearMonthBuilder<TNull>;
[Type.Map]: builders.MapBuilder<any, TNull>;
[Type.List]: builders.ListBuilder<any, TNull>;
[Type.Struct]: builders.StructBuilder<any, TNull>;
[Type.Dictionary]: builders.DictionaryBuilder<any, TNull>;
[Type.FixedSizeList]: builders.FixedSizeListBuilder<any, TNull>;
}[T];
/** @ignore */
declare type DataTypeToBuilder<T extends DataType = any, TNull = any> = {
[key: number]: builders.Builder<any, TNull>;
[Type.Null]: T extends type.Null ? builders.NullBuilder<TNull> : builders.Builder<any, TNull>;
[Type.Bool]: T extends type.Bool ? builders.BoolBuilder<TNull> : builders.Builder<any, TNull>;
[Type.Int8]: T extends type.Int8 ? builders.Int8Builder<TNull> : builders.Builder<any, TNull>;
[Type.Int16]: T extends type.Int16 ? builders.Int16Builder<TNull> : builders.Builder<any, TNull>;
[Type.Int32]: T extends type.Int32 ? builders.Int32Builder<TNull> : builders.Builder<any, TNull>;
[Type.Int64]: T extends type.Int64 ? builders.Int64Builder<TNull> : builders.Builder<any, TNull>;
[Type.Uint8]: T extends type.Uint8 ? builders.Uint8Builder<TNull> : builders.Builder<any, TNull>;
[Type.Uint16]: T extends type.Uint16 ? builders.Uint16Builder<TNull> : builders.Builder<any, TNull>;
[Type.Uint32]: T extends type.Uint32 ? builders.Uint32Builder<TNull> : builders.Builder<any, TNull>;
[Type.Uint64]: T extends type.Uint64 ? builders.Uint64Builder<TNull> : builders.Builder<any, TNull>;
[Type.Int]: T extends type.Int ? builders.IntBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.Float16]: T extends type.Float16 ? builders.Float16Builder<TNull> : builders.Builder<any, TNull>;
[Type.Float32]: T extends type.Float32 ? builders.Float32Builder<TNull> : builders.Builder<any, TNull>;
[Type.Float64]: T extends type.Float64 ? builders.Float64Builder<TNull> : builders.Builder<any, TNull>;
[Type.Float]: T extends type.Float ? builders.FloatBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.Utf8]: T extends type.Utf8 ? builders.Utf8Builder<TNull> : builders.Builder<any, TNull>;
[Type.Binary]: T extends type.Binary ? builders.BinaryBuilder<TNull> : builders.Builder<any, TNull>;
[Type.FixedSizeBinary]: T extends type.FixedSizeBinary ? builders.FixedSizeBinaryBuilder<TNull> : builders.Builder<any, TNull>;
[Type.Date]: T extends type.Date_ ? builders.DateBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.DateDay]: T extends type.DateDay ? builders.DateDayBuilder<TNull> : builders.Builder<any, TNull>;
[Type.DateMillisecond]: T extends type.DateMillisecond ? builders.DateMillisecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.Timestamp]: T extends type.Timestamp ? builders.TimestampBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.TimestampSecond]: T extends type.TimestampSecond ? builders.TimestampSecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.TimestampMillisecond]: T extends type.TimestampMillisecond ? builders.TimestampMillisecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.TimestampMicrosecond]: T extends type.TimestampMicrosecond ? builders.TimestampMicrosecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.TimestampNanosecond]: T extends type.TimestampNanosecond ? builders.TimestampNanosecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.Time]: T extends type.Time ? builders.TimeBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.TimeSecond]: T extends type.TimeSecond ? builders.TimeSecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.TimeMillisecond]: T extends type.TimeMillisecond ? builders.TimeMillisecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.TimeMicrosecond]: T extends type.TimeMicrosecond ? builders.TimeMicrosecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.TimeNanosecond]: T extends type.TimeNanosecond ? builders.TimeNanosecondBuilder<TNull> : builders.Builder<any, TNull>;
[Type.Decimal]: T extends type.Decimal ? builders.DecimalBuilder<TNull> : builders.Builder<any, TNull>;
[Type.Union]: T extends type.Union ? builders.UnionBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.DenseUnion]: T extends type.DenseUnion ? builders.DenseUnionBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.SparseUnion]: T extends type.SparseUnion ? builders.SparseUnionBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.Interval]: T extends type.Interval ? builders.IntervalBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.IntervalDayTime]: T extends type.IntervalDayTime ? builders.IntervalDayTimeBuilder<TNull> : builders.Builder<any, TNull>;
[Type.IntervalYearMonth]: T extends type.IntervalYearMonth ? builders.IntervalYearMonthBuilder<TNull> : builders.Builder<any, TNull>;
[Type.Map]: T extends type.Map_ ? builders.MapBuilder<T['dataTypes'], TNull> : builders.Builder<any, TNull>;
[Type.List]: T extends type.List ? builders.ListBuilder<T['valueType'], TNull> : builders.Builder<any, TNull>;
[Type.Struct]: T extends type.Struct ? builders.StructBuilder<T['dataTypes'], TNull> : builders.Builder<any, TNull>;
[Type.Dictionary]: T extends type.Dictionary ? builders.DictionaryBuilder<T, TNull> : builders.Builder<any, TNull>;
[Type.FixedSizeList]: T extends type.FixedSizeList ? builders.FixedSizeListBuilder<T['valueType'], TNull> : builders.Builder<any, TNull>;
}[T['TType']];
export {};

@@ -17,3 +17,4 @@ // Licensed to the Apache Software Foundation (ASF) under one

// under the License.
import { Type } from './enum';
//# sourceMappingURL=interfaces.mjs.map

@@ -202,3 +202,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

const { reader, source } = this;
reader && (yield reader['cancel'](reason));
reader && (yield reader['cancel'](reason).catch(() => { }));
source && (source['locked'] && this.releaseLock());

@@ -205,0 +205,0 @@ });

@@ -67,4 +67,4 @@ // Licensed to the Apache Software Foundation (ASF) under one

this._pending = (() => tslib_1.__awaiter(this, void 0, void 0, function* () {
this.size = (yield file.stat()).size;
delete this._pending;
this.size = (yield file.stat()).size;
}))();

@@ -71,0 +71,0 @@ }

@@ -83,2 +83,5 @@ // Licensed to the Apache Software Foundation (ASF) under one

}
else if (isReadableDOMStream(source)) {
this.source = new AsyncByteStreamSource(streamAdapters.fromDOMStream(source));
}
else if (isFetchResponse(source)) {

@@ -96,5 +99,2 @@ this.source = new AsyncByteStreamSource(streamAdapters.fromDOMStream(source.body));

}
else if (isReadableDOMStream(source)) {
this.source = new AsyncByteStreamSource(streamAdapters.fromDOMStream(source));
}
}

@@ -101,0 +101,0 @@ [Symbol.asyncIterator]() { return this; }

@@ -195,11 +195,9 @@ // Licensed to the Apache Software Foundation (ASF) under one

next() {
const { _json, _batchIndex, _dictionaryIndex } = this;
const numBatches = _json.batches.length;
const numDictionaries = _json.dictionaries.length;
const { _json } = this;
if (!this._schema) {
this._schema = true;
const message = Message.fromJSON(_json.schema, MessageHeader.Schema);
return { value: message, done: _batchIndex >= numBatches && _dictionaryIndex >= numDictionaries };
return { done: false, value: message };
}
if (_dictionaryIndex < numDictionaries) {
if (this._dictionaryIndex < _json.dictionaries.length) {
const batch = _json.dictionaries[this._dictionaryIndex++];

@@ -210,3 +208,3 @@ this._body = batch['data']['columns'];

}
if (_batchIndex < numBatches) {
if (this._batchIndex < _json.batches.length) {
const batch = _json.batches[this._batchIndex++];

@@ -213,0 +211,0 @@ this._body = batch['columns'];

import { Schema, Field } from '../../schema';
import { DataType, Dictionary } from '../../type';
import { DataType } from '../../type';
import { DictionaryBatch, RecordBatch } from './message';
/** @ignore */
export declare function schemaFromJSON(_schema: any, dictionaries?: Map<number, DataType>, dictionaryFields?: Map<number, Field<Dictionary>[]>): Schema<any>;
export declare function schemaFromJSON(_schema: any, dictionaries?: Map<number, DataType>): Schema<any>;
/** @ignore */

@@ -11,2 +11,2 @@ export declare function recordBatchFromJSON(b: any): RecordBatch;

/** @ignore */
export declare function fieldFromJSON(_field: any, dictionaries?: Map<number, DataType>, dictionaryFields?: Map<number, Field<Dictionary>[]>): Field<any>;
export declare function fieldFromJSON(_field: any, dictionaries?: Map<number, DataType>): Field<any>;

@@ -18,8 +18,8 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Schema, Field } from '../../schema';
import { DataType, Dictionary, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Union, Bool, Null, Int, Float, Date_, Time, Interval, Timestamp, Int32, } from '../../type';
import { Dictionary, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Union, Bool, Null, Int, Float, Date_, Time, Interval, Timestamp, Int32, } from '../../type';
import { DictionaryBatch, RecordBatch, FieldNode, BufferRegion } from './message';
import { TimeUnit, Precision, IntervalUnit, UnionMode, DateUnit } from '../../enum';
/** @ignore */
export function schemaFromJSON(_schema, dictionaries = new Map(), dictionaryFields = new Map()) {
return new Schema(schemaFieldsFromJSON(_schema, dictionaries, dictionaryFields), customMetadataFromJSON(_schema['customMetadata']), dictionaries, dictionaryFields);
export function schemaFromJSON(_schema, dictionaries = new Map()) {
return new Schema(schemaFieldsFromJSON(_schema, dictionaries), customMetadataFromJSON(_schema['customMetadata']), dictionaries);
}

@@ -35,8 +35,8 @@ /** @ignore */

/** @ignore */
function schemaFieldsFromJSON(_schema, dictionaries, dictionaryFields) {
return (_schema['fields'] || []).filter(Boolean).map((f) => Field.fromJSON(f, dictionaries, dictionaryFields));
function schemaFieldsFromJSON(_schema, dictionaries) {
return (_schema['fields'] || []).filter(Boolean).map((f) => Field.fromJSON(f, dictionaries));
}
/** @ignore */
function fieldChildrenFromJSON(_field, dictionaries, dictionaryFields) {
return (_field['children'] || []).filter(Boolean).map((f) => Field.fromJSON(f, dictionaries, dictionaryFields));
function fieldChildrenFromJSON(_field, dictionaries) {
return (_field['children'] || []).filter(Boolean).map((f) => Field.fromJSON(f, dictionaries));
}

@@ -68,3 +68,3 @@ /** @ignore */

/** @ignore */
export function fieldFromJSON(_field, dictionaries, dictionaryFields) {
export function fieldFromJSON(_field, dictionaries) {
let id;

@@ -76,6 +76,5 @@ let keys;

let dictType;
let dictField;
// If no dictionary encoding, or in the process of decoding the children of a dictionary-encoded field
if (!dictionaries || !dictionaryFields || !(dictMeta = _field['dictionary'])) {
type = typeFromJSON(_field, fieldChildrenFromJSON(_field, dictionaries, dictionaryFields));
// If no dictionary encoding
if (!dictionaries || !(dictMeta = _field['dictionary'])) {
type = typeFromJSON(_field, fieldChildrenFromJSON(_field, dictionaries));
field = new Field(_field['name'], type, _field['nullable'], customMetadataFromJSON(_field['customMetadata']));

@@ -90,6 +89,5 @@ }

keys = (keys = dictMeta['indexType']) ? indexTypeFromJSON(keys) : new Int32();
dictionaries.set(id, type = typeFromJSON(_field, fieldChildrenFromJSON(_field)));
dictionaries.set(id, type = typeFromJSON(_field, fieldChildrenFromJSON(_field, dictionaries)));
dictType = new Dictionary(type, keys, id, dictMeta['isOrdered']);
dictField = new Field(_field['name'], dictType, _field['nullable'], customMetadataFromJSON(_field['customMetadata']));
dictionaryFields.set(id, [field = dictField]);
field = new Field(_field['name'], dictType, _field['nullable'], customMetadataFromJSON(_field['customMetadata']));
}

@@ -102,4 +100,3 @@ // If dictionary encoded, and have already seen this dictionary Id in the schema, then reuse the

dictType = new Dictionary(dictionaries.get(id), keys, id, dictMeta['isOrdered']);
dictField = new Field(_field['name'], dictType, _field['nullable'], customMetadataFromJSON(_field['customMetadata']));
dictionaryFields.get(id).push(field = dictField);
field = new Field(_field['name'], dictType, _field['nullable'], customMetadataFromJSON(_field['customMetadata']));
}

@@ -120,3 +117,3 @@ return field || null;

switch (typeId) {
case 'NONE': return new DataType();
case 'NONE': return new Null();
case 'null': return new Null();

@@ -123,0 +120,0 @@ case 'binary': return new Binary();

@@ -16,4 +16,7 @@ import { flatbuffers } from 'flatbuffers';

import _DictionaryBatch = Message_.org.apache.arrow.flatbuf.DictionaryBatch;
import { DataType, Dictionary } from '../../type';
/** @ignore */
import { DataType } from '../../type';
/**
* @ignore
* @private
**/
export declare class Message<T extends MessageHeader = any> {

@@ -43,3 +46,6 @@ /** @nocollapse */

}
/** @ignore */
/**
* @ignore
* @private
**/
export declare class RecordBatch {

@@ -54,3 +60,6 @@ protected _length: number;

}
/** @ignore */
/**
* @ignore
* @private
**/
export declare class DictionaryBatch {

@@ -68,3 +77,6 @@ protected _id: number;

}
/** @ignore */
/**
* @ignore
* @private
**/
export declare class BufferRegion {

@@ -75,3 +87,6 @@ offset: number;

}
/** @ignore */
/**
* @ignore
* @private
**/
export declare class FieldNode {

@@ -115,3 +130,3 @@ length: number;

/** @ignore */
declare function decodeSchema(_schema: _Schema, dictionaries?: Map<number, DataType>, dictionaryFields?: Map<number, Field<Dictionary>[]>): Schema<any>;
declare function decodeSchema(_schema: _Schema, dictionaries?: Map<number, DataType>): Schema<any>;
/** @ignore */

@@ -126,3 +141,3 @@ declare function decodeRecordBatch(batch: _RecordBatch, version?: MetadataVersion): RecordBatch;

/** @ignore */
declare function decodeField(f: _Field, dictionaries?: Map<number, DataType>, dictionaryFields?: Map<number, Field<Dictionary>[]>): Field<any>;
declare function decodeField(f: _Field, dictionaries?: Map<number, DataType>): Field<any>;
/** @ignore */

@@ -129,0 +144,0 @@ declare function encodeSchema(b: Builder, schema: Schema): number;

@@ -39,3 +39,6 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { DataType, Dictionary, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Union, Bool, Null, Int, Float, Date_, Time, Interval, Timestamp, Int32, } from '../../type';
/** @ignore */
/**
* @ignore
* @private
**/
export class Message {

@@ -108,3 +111,6 @@ constructor(bodyLength, version, headerType, header) {

}
/** @ignore */
/**
* @ignore
* @private
**/
export class RecordBatch {

@@ -120,3 +126,6 @@ get nodes() { return this._nodes; }

}
/** @ignore */
/**
* @ignore
* @private
**/
export class DictionaryBatch {

@@ -135,3 +144,6 @@ get id() { return this._id; }

}
/** @ignore */
/**
* @ignore
* @private
**/
export class BufferRegion {

@@ -143,3 +155,6 @@ constructor(offset, length) {

}
/** @ignore */
/**
* @ignore
* @private
**/
export class FieldNode {

@@ -190,5 +205,5 @@ constructor(length, nullCount) {

/** @ignore */
function decodeSchema(_schema, dictionaries = new Map(), dictionaryFields = new Map()) {
const fields = decodeSchemaFields(_schema, dictionaries, dictionaryFields);
return new Schema(fields, decodeCustomMetadata(_schema), dictionaries, dictionaryFields);
function decodeSchema(_schema, dictionaries = new Map()) {
const fields = decodeSchemaFields(_schema, dictionaries);
return new Schema(fields, decodeCustomMetadata(_schema), dictionaries);
}

@@ -238,7 +253,7 @@ /** @ignore */

/** @ignore */
function decodeSchemaFields(schema, dictionaries, dictionaryFields) {
function decodeSchemaFields(schema, dictionaries) {
const fields = [];
for (let f, i = -1, j = -1, n = schema.fieldsLength(); ++i < n;) {
if (f = schema.fields(i)) {
fields[++j] = Field.decode(f, dictionaries, dictionaryFields);
fields[++j] = Field.decode(f, dictionaries);
}

@@ -249,7 +264,7 @@ }

/** @ignore */
function decodeFieldChildren(field, dictionaries, dictionaryFields) {
function decodeFieldChildren(field, dictionaries) {
const children = [];
for (let f, i = -1, j = -1, n = field.childrenLength(); ++i < n;) {
if (f = field.children(i)) {
children[++j] = Field.decode(f, dictionaries, dictionaryFields);
children[++j] = Field.decode(f, dictionaries);
}

@@ -260,3 +275,3 @@ }

/** @ignore */
function decodeField(f, dictionaries, dictionaryFields) {
function decodeField(f, dictionaries) {
let id;

@@ -268,6 +283,5 @@ let field;

let dictMeta;
let dictField;
// If no dictionary encoding, or in the process of decoding the children of a dictionary-encoded field
if (!dictionaries || !dictionaryFields || !(dictMeta = f.dictionary())) {
type = decodeFieldType(f, decodeFieldChildren(f, dictionaries, dictionaryFields));
// If no dictionary encoding
if (!dictionaries || !(dictMeta = f.dictionary())) {
type = decodeFieldType(f, decodeFieldChildren(f, dictionaries));
field = new Field(f.name(), type, f.nullable(), decodeCustomMetadata(f));

@@ -282,6 +296,5 @@ }

keys = (keys = dictMeta.indexType()) ? decodeIndexType(keys) : new Int32();
dictionaries.set(id, type = decodeFieldType(f, decodeFieldChildren(f)));
dictionaries.set(id, type = decodeFieldType(f, decodeFieldChildren(f, dictionaries)));
dictType = new Dictionary(type, keys, id, dictMeta.isOrdered());
dictField = new Field(f.name(), dictType, f.nullable(), decodeCustomMetadata(f));
dictionaryFields.set(id, [field = dictField]);
field = new Field(f.name(), dictType, f.nullable(), decodeCustomMetadata(f));
}

@@ -294,4 +307,3 @@ // If dictionary encoded, and have already seen this dictionary Id in the schema, then reuse the

dictType = new Dictionary(dictionaries.get(id), keys, id, dictMeta.isOrdered());
dictField = new Field(f.name(), dictType, f.nullable(), decodeCustomMetadata(f));
dictionaryFields.get(id).push(field = dictField);
field = new Field(f.name(), dictType, f.nullable(), decodeCustomMetadata(f));
}

@@ -320,3 +332,3 @@ return field || null;

switch (typeId) {
case Type.NONE: return new DataType();
case Type.NONE: return new Null();
case Type.Null: return new Null();

@@ -323,0 +335,0 @@ case Type.Binary: return new Binary();

@@ -8,3 +8,2 @@ /// <reference types="node" />

import { Message } from './metadata/message';
import { RecordBatch } from '../recordbatch';
import * as metadata from './metadata/message';

@@ -14,2 +13,3 @@ import { ArrayBufferViewInput } from '../util/buffer';

import { RandomAccessFile, AsyncRandomAccessFile } from '../io/file';
import { RecordBatch } from '../recordbatch';
import { FileHandle, ArrowJSONLike, ReadableInterop } from '../io/interfaces';

@@ -16,0 +16,0 @@ import { MessageReader, AsyncMessageReader } from './message';

@@ -22,6 +22,6 @@ // Licensed to the Apache Software Foundation (ASF) under one

import streamAdapters from '../io/adapters';
import { RecordBatch } from '../recordbatch';
import { ByteStream, AsyncByteStream } from '../io/stream';
import { RandomAccessFile, AsyncRandomAccessFile } from '../io/file';
import { VectorLoader, JSONVectorLoader } from '../visitor/vectorloader';
import { RecordBatch, _InternalEmptyPlaceholderRecordBatch } from '../recordbatch';
import { ITERATOR_DONE, ReadableInterop, } from '../io/interfaces';

@@ -209,13 +209,12 @@ import { MessageReader, AsyncMessageReader, JSONMessageReader, checkForMagicArrowString, magicLength, magicAndPadding, magicX2AndPadding } from './message';

const { dictionaries, schema } = this;
if (isDelta || !dictionaries.get(id)) {
const dictionary = dictionaries.get(id);
if (isDelta || !dictionary) {
const type = schema.dictionaries.get(id);
const vector = (isDelta ? dictionaries.get(id).concat(Vector.new(this._loadVectors(data, body, [type])[0])) :
return (dictionary && isDelta ? dictionary.concat(Vector.new(this._loadVectors(data, body, [type])[0])) :
Vector.new(this._loadVectors(data, body, [type])[0]));
(schema.dictionaryFields.get(id) || []).forEach(({ type }) => type.dictionaryVector = vector);
return vector;
}
return dictionaries.get(id);
return dictionary;
}
_loadVectors(header, body, types) {
return new VectorLoader(body, header.nodes, header.buffers).visitMany(types);
return new VectorLoader(body, header.nodes, header.buffers, this.dictionaries).visitMany(types);
}

@@ -288,2 +287,6 @@ }

}
if (this.schema && this._recordBatchIndex === 0) {
this._recordBatchIndex++;
return { done: false, value: new _InternalEmptyPlaceholderRecordBatch(this.schema) };
}
return this.return();

@@ -367,2 +370,6 @@ }

}
if (this.schema && this._recordBatchIndex === 0) {
this._recordBatchIndex++;
return { done: false, value: new _InternalEmptyPlaceholderRecordBatch(this.schema) };
}
return yield this.return();

@@ -539,3 +546,3 @@ });

_loadVectors(header, body, types) {
return new JSONVectorLoader(body, header.nodes, header.buffers).visitMany(types);
return new JSONVectorLoader(body, header.nodes, header.buffers, this.dictionaries).visitMany(types);
}

@@ -542,0 +549,0 @@ }

/// <reference types="node" />
import { Table } from '../table';
import { Vector } from '../vector';
import { Schema, Field } from '../schema';
import { DataType } from '../type';
import { Schema } from '../schema';
import { Message } from './metadata/message';
import { RecordBatch } from '../recordbatch';
import { DataType, Dictionary } from '../type';
import { FileBlock } from './metadata/file';

@@ -12,2 +11,3 @@ import { MessageHeader } from '../enum';

import { ArrayBufferViewInput } from '../util/buffer';
import { RecordBatch } from '../recordbatch';
import { Writable, ReadableInterop, ReadableDOMStreamOptions } from '../io/interfaces';

@@ -43,2 +43,3 @@ export declare class RecordBatchWriter<T extends {

protected _recordBatchBlocks: FileBlock[];
protected _dictionaryDeltaOffsets: Map<number, number>;
toString(sync: true): string;

@@ -64,9 +65,9 @@ toString(sync?: false): Promise<string>;

protected _writeSchema(schema: Schema<T>): this;
protected _writeFooter(): this;
protected _writeFooter(schema: Schema<T>): this;
protected _writeMagic(): this;
protected _writePadding(nBytes: number): this;
protected _writeRecordBatch(records: RecordBatch<T>): this;
protected _writeRecordBatch(batch: RecordBatch<T>): this;
protected _writeDictionaryBatch(dictionary: Vector, id: number, isDelta?: boolean): this;
protected _writeBodyBuffers(buffers: ArrayBufferView[]): this;
protected _writeDictionaries(dictionaryFields: Map<number, Field<Dictionary<any, any>>[]>): this;
protected _writeDictionaries(batch: RecordBatch<T>): this;
}

@@ -79,3 +80,3 @@ /** @ignore */

[key: string]: DataType;
} = any>(this: typeof RecordBatchWriter, input: Table<T> | Iterable<RecordBatch<T>>, options?: {
} = any>(input: Table<T> | Iterable<RecordBatch<T>>, options?: {
autoDestroy: true;

@@ -85,3 +86,3 @@ }): RecordBatchStreamWriter<T>;

[key: string]: DataType;
} = any>(this: typeof RecordBatchWriter, input: AsyncIterable<RecordBatch<T>>, options?: {
} = any>(input: AsyncIterable<RecordBatch<T>>, options?: {
autoDestroy: true;

@@ -91,3 +92,3 @@ }): Promise<RecordBatchStreamWriter<T>>;

[key: string]: DataType;
} = any>(this: typeof RecordBatchWriter, input: PromiseLike<AsyncIterable<RecordBatch<T>>>, options?: {
} = any>(input: PromiseLike<AsyncIterable<RecordBatch<T>>>, options?: {
autoDestroy: true;

@@ -97,3 +98,3 @@ }): Promise<RecordBatchStreamWriter<T>>;

[key: string]: DataType;
} = any>(this: typeof RecordBatchWriter, input: PromiseLike<Table<T> | Iterable<RecordBatch<T>>>, options?: {
} = any>(input: PromiseLike<Table<T> | Iterable<RecordBatch<T>>>, options?: {
autoDestroy: true;

@@ -108,15 +109,15 @@ }): Promise<RecordBatchStreamWriter<T>>;

[key: string]: DataType;
} = any>(this: typeof RecordBatchWriter, input: Table<T> | Iterable<RecordBatch<T>>): RecordBatchFileWriter<T>;
} = any>(input: Table<T> | Iterable<RecordBatch<T>>): RecordBatchFileWriter<T>;
static writeAll<T extends {
[key: string]: DataType;
} = any>(this: typeof RecordBatchWriter, input: AsyncIterable<RecordBatch<T>>): Promise<RecordBatchFileWriter<T>>;
} = any>(input: AsyncIterable<RecordBatch<T>>): Promise<RecordBatchFileWriter<T>>;
static writeAll<T extends {
[key: string]: DataType;
} = any>(this: typeof RecordBatchWriter, input: PromiseLike<AsyncIterable<RecordBatch<T>>>): Promise<RecordBatchFileWriter<T>>;
} = any>(input: PromiseLike<AsyncIterable<RecordBatch<T>>>): Promise<RecordBatchFileWriter<T>>;
static writeAll<T extends {
[key: string]: DataType;
} = any>(this: typeof RecordBatchWriter, input: PromiseLike<Table<T> | Iterable<RecordBatch<T>>>): Promise<RecordBatchFileWriter<T>>;
} = any>(input: PromiseLike<Table<T> | Iterable<RecordBatch<T>>>): Promise<RecordBatchFileWriter<T>>;
constructor();
protected _writeSchema(schema: Schema<T>): this;
protected _writeFooter(): this;
protected _writeFooter(schema: Schema<T>): this;
}

@@ -139,9 +140,11 @@ /** @ignore */

} = any>(this: typeof RecordBatchWriter, input: PromiseLike<Table<T> | Iterable<RecordBatch<T>>>): Promise<RecordBatchJSONWriter<T>>;
private _recordBatches;
private _dictionaries;
constructor();
protected _writeMessage(): this;
protected _writeSchema(schema: Schema<T>): this;
protected _writeDictionaries(dictionaryFields: Map<number, Field<Dictionary<any, any>>[]>): this;
protected _writeDictionaries(batch: RecordBatch<T>): this;
protected _writeDictionaryBatch(dictionary: Vector, id: number, isDelta?: boolean): this;
protected _writeRecordBatch(records: RecordBatch<T>): this;
protected _writeRecordBatch(batch: RecordBatch<T>): this;
close(): void;
}

@@ -21,8 +21,6 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Column } from '../column';
import { DataType } from '../type';
import { Field } from '../schema';
import { Chunked } from '../vector/chunked';
import { Message } from './metadata/message';
import { RecordBatch } from '../recordbatch';
import * as metadata from './metadata/message';
import { DataType } from '../type';
import { FileBlock, Footer } from './metadata/file';

@@ -35,2 +33,3 @@ import { MessageHeader, MetadataVersion } from '../enum';

import { toUint8Array } from '../util/buffer';
import { RecordBatch, _InternalEmptyPlaceholderRecordBatch } from '../recordbatch';
import { ReadableInterop } from '../io/interfaces';

@@ -48,2 +47,3 @@ import { isPromise, isAsyncIterable, isWritableDOMStream, isWritableNodeStream, isIterable } from '../util/compat';

this._recordBatchBlocks = [];
this._dictionaryDeltaOffsets = new Map();
this._autoDestroy = options && (typeof options.autoDestroy === 'boolean') ? options.autoDestroy : true;

@@ -107,3 +107,3 @@ }

if (this._started && this._schema) {
this._writeFooter();
this._writeFooter(this._schema);
}

@@ -113,2 +113,3 @@ this._started = false;

this._recordBatchBlocks = [];
this._dictionaryDeltaOffsets = new Map();
if (!schema || !(schema.compareTo(this._schema))) {

@@ -148,3 +149,5 @@ if (schema === null) {

if (payload instanceof RecordBatch) {
this._writeRecordBatch(payload);
if (!(payload instanceof _InternalEmptyPlaceholderRecordBatch)) {
this._writeRecordBatch(payload);
}
}

@@ -190,7 +193,6 @@ else if (payload instanceof Table) {

_writeSchema(schema) {
return this
._writeMessage(Message.from(schema))
._writeDictionaries(schema.dictionaryFields);
return this._writeMessage(Message.from(schema));
}
_writeFooter() {
// @ts-ignore
_writeFooter(schema) {
return this._writePadding(4); // eos bytes

@@ -204,7 +206,8 @@ }

}
_writeRecordBatch(records) {
const { byteLength, nodes, bufferRegions, buffers } = VectorAssembler.assemble(records);
const recordBatch = new metadata.RecordBatch(records.length, nodes, bufferRegions);
_writeRecordBatch(batch) {
const { byteLength, nodes, bufferRegions, buffers } = VectorAssembler.assemble(batch);
const recordBatch = new metadata.RecordBatch(batch.length, nodes, bufferRegions);
const message = Message.from(recordBatch, byteLength);
return this
._writeDictionaries(batch)
._writeMessage(message)

@@ -214,2 +217,3 @@ ._writeBodyBuffers(buffers);

_writeDictionaryBatch(dictionary, id, isDelta = false) {
this._dictionaryDeltaOffsets.set(id, dictionary.length + (this._dictionaryDeltaOffsets.get(id) || 0));
const { byteLength, nodes, bufferRegions, buffers } = VectorAssembler.assemble(dictionary);

@@ -236,12 +240,10 @@ const recordBatch = new metadata.RecordBatch(dictionary.length, nodes, bufferRegions);

}
_writeDictionaries(dictionaryFields) {
for (const [id, fields] of dictionaryFields) {
const vector = fields[0].type.dictionaryVector;
if (!(vector instanceof Chunked)) {
this._writeDictionaryBatch(vector, id, false);
}
else {
const chunks = vector.chunks;
for (let i = -1, n = chunks.length; ++i < n;) {
this._writeDictionaryBatch(chunks[i], id, i > 0);
_writeDictionaries(batch) {
for (let [id, dictionary] of batch.dictionaries) {
let offset = this._dictionaryDeltaOffsets.get(id) || 0;
if (offset === 0 || (dictionary = dictionary.slice(offset)).length > 0) {
const chunks = 'chunks' in dictionary ? dictionary.chunks : [dictionary];
for (const chunk of chunks) {
this._writeDictionaryBatch(chunk, id, offset > 0);
offset += chunk.length;
}

@@ -257,3 +259,10 @@ }

static writeAll(input, options) {
return new RecordBatchStreamWriter(options).writeAll(input);
const writer = new RecordBatchStreamWriter(options);
if (isPromise(input)) {
return input.then((x) => writer.writeAll(x));
}
else if (isAsyncIterable(input)) {
return writeAllAsync(writer, input);
}
return writeAll(writer, input);
}

@@ -269,12 +278,19 @@ }

static writeAll(input) {
return new RecordBatchFileWriter().writeAll(input);
const writer = new RecordBatchFileWriter();
if (isPromise(input)) {
return input.then((x) => writer.writeAll(x));
}
else if (isAsyncIterable(input)) {
return writeAllAsync(writer, input);
}
return writeAll(writer, input);
}
// @ts-ignore
_writeSchema(schema) {
return this
._writeMagic()._writePadding(2)
._writeDictionaries(schema.dictionaryFields);
return this._writeMagic()._writePadding(2);
}
_writeFooter() {
const buffer = Footer.encode(new Footer(this._schema, MetadataVersion.V4, this._recordBatchBlocks, this._dictionaryBlocks));
_writeFooter(schema) {
const buffer = Footer.encode(new Footer(schema, MetadataVersion.V4, this._recordBatchBlocks, this._dictionaryBlocks));
return this
._writePadding(4) // EOS bytes for sequential readers
._write(buffer) // Write the flatbuffer

@@ -290,2 +306,4 @@ ._write(Int32Array.of(buffer.byteLength)) // then the footer size suffix

this._autoDestroy = true;
this._recordBatches = [];
this._dictionaries = [];
}

@@ -298,30 +316,43 @@ /** @nocollapse */

_writeSchema(schema) {
return this._write(`{\n "schema": ${JSON.stringify({ fields: schema.fields.map(fieldToJSON) }, null, 2)}`)._writeDictionaries(schema.dictionaryFields);
return this._write(`{\n "schema": ${JSON.stringify({ fields: schema.fields.map(fieldToJSON) }, null, 2)}`);
}
_writeDictionaries(dictionaryFields) {
this._write(`,\n "dictionaries": [\n`);
super._writeDictionaries(dictionaryFields);
return this._write(`\n ]`);
_writeDictionaries(batch) {
if (batch.dictionaries.size > 0) {
this._dictionaries.push(batch);
}
return this;
}
_writeDictionaryBatch(dictionary, id, isDelta = false) {
this._dictionaryDeltaOffsets.set(id, dictionary.length + (this._dictionaryDeltaOffsets.get(id) || 0));
this._write(this._dictionaryBlocks.length === 0 ? ` ` : `,\n `);
this._write(`${dictionaryBatchToJSON(this._schema, dictionary, id, isDelta)}`);
this._write(`${dictionaryBatchToJSON(dictionary, id, isDelta)}`);
this._dictionaryBlocks.push(new FileBlock(0, 0, 0));
return this;
}
_writeRecordBatch(records) {
this._write(this._recordBatchBlocks.length === 0
? `,\n "batches": [\n `
: `,\n `);
this._write(`${recordBatchToJSON(records)}`);
this._recordBatchBlocks.push(new FileBlock(0, 0, 0));
_writeRecordBatch(batch) {
this._writeDictionaries(batch);
this._recordBatches.push(batch);
return this;
}
close() {
if (this._recordBatchBlocks.length > 0) {
if (this._dictionaries.length > 0) {
this._write(`,\n "dictionaries": [\n`);
for (const batch of this._dictionaries) {
super._writeDictionaries(batch);
}
this._write(`\n ]`);
}
if (this._recordBatches.length > 0) {
for (let i = -1, n = this._recordBatches.length; ++i < n;) {
this._write(i === 0 ? `,\n "batches": [\n ` : `,\n `);
this._write(`${recordBatchToJSON(this._recordBatches[i])}`);
this._recordBatchBlocks.push(new FileBlock(0, 0, 0));
}
this._write(`\n ]`);
}
if (this._schema) {
this._write(`\n}`);
}
this._dictionaries = [];
this._recordBatches = [];
return super.close();

@@ -345,4 +376,4 @@ }

var batches_1, batches_1_1;
var e_1, _a;
return tslib_1.__awaiter(this, void 0, void 0, function* () {
var e_1, _a;
try {

@@ -379,5 +410,4 @@ for (batches_1 = tslib_1.__asyncValues(batches); batches_1_1 = yield batches_1.next(), !batches_1_1.done;) {

/** @ignore */
function dictionaryBatchToJSON(schema, dictionary, id, isDelta = false) {
const f = schema.dictionaryFields.get(id)[0];
const field = new Field(f.name, f.type.dictionary, f.nullable, f.metadata);
function dictionaryBatchToJSON(dictionary, id, isDelta = false) {
const field = new Field(`${id}`, dictionary.type, dictionary.nullCount > 0);
const columns = JSONVectorAssembler.assemble(new Column(field, [dictionary]));

@@ -384,0 +414,0 @@ return JSON.stringify({

@@ -409,33 +409,2 @@

This project includes code from the mapbox/variant project, BSD 3-clause
license
Copyright (c) MapBox
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
- Neither the name "MapBox" nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
This project includes code from the FlatBuffers project

@@ -713,2 +682,30 @@

The file cpp/src/arrow/vendored/variant.hpp has the following license
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
The files in cpp/src/arrow/vendored/xxhash/ have the following license

@@ -748,3 +745,3 @@ (BSD 2-Clause License)

The files in dev/tasks/conda-recipes/variants have the following license
The files under dev/tasks/conda-recipes have the following license

@@ -782,2 +779,30 @@ BSD 3-clause license

The files in cpp/src/arrow/vendored/utf8cpp/ have the following license
Copyright 2006 Nemanja Trifunovic
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
This project includes code from Apache Kudu.

@@ -864,1 +889,64 @@

License: Zope Public License (ZPL) Version 2.1.
---------------------------------------------------------------------------------
This project include code from Google's Asylo project.
* cpp/src/arrow/result.h is based on status_or.h
Copyright (c) Copyright 2017 Asylo authors
Homepage: https://asylo.dev/
License: Apache 2.0
---------------------------------------------------------------------------------
This project includes code from Google's protobuf project
* cpp/src/arrow/result.h ARROW_ASSIGN_OR_RAISE is based off ASSIGN_OR_RETURN
Copyright 2008 Google Inc. All rights reserved.
Homepage: https://developers.google.com/protocol-buffers/
License:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Code generated by the Protocol Buffer compiler is owned by the owner
of the input file used when generating it. This code is not
standalone and requires a support library to be linked with it. This
support library is itself covered by the above license.
--------------------------------------------------------------------------------
This project includes code from the rtools-backports project.
* ci/PKGBUILD and ci/appveyor-build-r.sh are based on code
from the rtools-backports project.
Copyright: Copyright (c) 2013 - 2019, Алексей and Jeroen Ooms.
All rights reserved.
Homepage: https://github.com/r-windows/rtools-backports
License: 3-clause BSD
{
"version": "0.13.0",
"version": "0.14.0",
"name": "@apache-arrow/es2015-esm",

@@ -28,11 +28,11 @@ "browser": "Arrow.dom.js",

"dependencies": {
"@types/flatbuffers": "^1.9.0",
"@types/node": "^10.12.18",
"@types/flatbuffers": "^1.9.1",
"@types/node": "^12.0.4",
"@types/text-encoding-utf-8": "^1.0.1",
"command-line-args": "5.0.2",
"command-line-usage": "5.0.5",
"flatbuffers": "^1.10.2",
"json-bignum": "0.0.3",
"pad-left": "2.1.0",
"text-encoding-utf-8": "1.0.2",
"flatbuffers": "1.11.0",
"json-bignum": "^0.0.3",
"pad-left": "^2.1.0",
"text-encoding-utf-8": "^1.0.2",
"tslib": "^1.9.3"

@@ -39,0 +39,0 @@ },

@@ -38,3 +38,3 @@ <!---

Apache Arrow is the emerging standard for large in-memory columnar data ([Spark](https://spark.apache.org/), [Pandas](http://wesmckinney.com/blog/pandas-and-apache-arrow/), [Drill](https://drill.apache.org/), [Graphistry](https://www.graphistry.com), ...). By standardizing on a common binary interchange format, big data systems can reduce the costs and friction associated with cross-system communication.
Apache Arrow is the emerging standard for large in-memory columnar data ([Spark](https://spark.apache.org/), [Pandas](https://wesmckinney.com/blog/pandas-and-apache-arrow/), [Drill](https://drill.apache.org/), [Graphistry](https://www.graphistry.com), ...). By standardizing on a common binary interchange format, big data systems can reduce the costs and friction associated with cross-system communication.

@@ -211,3 +211,3 @@ # Get Started

issues][3] for the Apache Arrow project. Comment on the issue and/or contact
[dev@arrow.apache.org](http://mail-archives.apache.org/mod_mbox/arrow-dev/)
[dev@arrow.apache.org](https://mail-archives.apache.org/mod_mbox/arrow-dev/)
with your questions and ideas.

@@ -217,3 +217,3 @@

it on JIRA, or email the mailing list
[dev@arrow.apache.org](http://mail-archives.apache.org/mod_mbox/arrow-dev/)
[dev@arrow.apache.org](https://mail-archives.apache.org/mod_mbox/arrow-dev/)

@@ -264,8 +264,8 @@ ## Packaging

* [Perspective](https://github.com/jpmorganchase/perspective) -- Perspective is a streaming data visualization engine by J.P. Morgan for JavaScript for building real-time & user-configurable analytics entirely in the browser.
* [Falcon](https://github.com/uwdata/falcon) is a visualization tool for linked interactions across multiple aggregate visualizations of millions or billions of records.
* [Falcon](https://github.com/uwdata/falcon) is a visualization tool for linked interactions across multiple aggregate visualizations of millions or billions of records.
## Companies & Organizations
* [CCRi](http://www.ccri.com/) -- Commonwealth Computer Research Inc, or CCRi, is a Central Virginia based data science and software engineering company
* [GOAI](http://gpuopenanalytics.com/) -- GPU Open Analytics Initiative standardizes on Arrow as part of creating common data frameworks that enable developers and statistical researchers to accelerate data science on GPUs
* [CCRi](https://www.ccri.com/) -- Commonwealth Computer Research Inc, or CCRi, is a Central Virginia based data science and software engineering company
* [GOAI](https://gpuopenanalytics.com/) -- GPU Open Analytics Initiative standardizes on Arrow as part of creating common data frameworks that enable developers and statistical researchers to accelerate data science on GPUs
* [Graphistry, Inc.](https://www.graphistry.com/) - An end-to-end GPU accelerated visual investigation platform used by teams for security, anti-fraud, and related investigations. Graphistry uses Arrow in its NodeJS GPU backend and client libraries, and is an early contributing member to GOAI and Arrow\[JS\] working to bring these technologies to the enterprise.

@@ -283,2 +283,2 @@

[6]: https://beta.observablehq.com/@lmeyerov/manipulating-flat-arrays-arrow-style
[7]: http://arrow.apache.org/docs/js/
[7]: https://arrow.apache.org/docs/js/

@@ -5,5 +5,6 @@ import { Data } from './data';

import { Schema, Field } from './schema';
import { DataType, Struct } from './type';
import { StructVector } from './vector/struct';
import { MapVector } from './vector/index';
import { DataType, Struct, Map_ } from './type';
import { Clonable, Sliceable, Applicative } from './vector';
import { VectorBuilderOptions, VectorBuilderOptionsAsync } from './vector/index';
declare type VectorMap = {

@@ -21,15 +22,15 @@ [key: string]: Vector;

} = any> {
concat(...others: Vector<Struct<T>>[]): Table<T>;
concat(...others: Vector<Map_<T>>[]): Table<T>;
slice(begin?: number, end?: number): RecordBatch<T>;
clone(data: Data<Struct<T>>, children?: Vector[]): RecordBatch<T>;
clone(data: Data<Map_<T>>, children?: Vector[]): RecordBatch<T>;
}
export declare class RecordBatch<T extends {
[key: string]: DataType;
} = any> extends StructVector<T> implements Clonable<RecordBatch<T>>, Sliceable<RecordBatch<T>>, Applicative<Struct<T>, Table<T>> {
static from<T extends VectorMap = any>(children: T): RecordBatch<{
[P in keyof T]: T[P]['type'];
}>;
} = any> extends MapVector<T> implements Clonable<RecordBatch<T>>, Sliceable<RecordBatch<T>>, Applicative<Map_<T>, Table<T>> {
static from<T extends {
[key: string]: DataType;
} = any>(children: ChildData<T>, fields?: Fields<T>): RecordBatch<T>;
} = any, TNull = any>(options: VectorBuilderOptions<Struct<T> | Map_<T>, TNull>): Table<T>;
static from<T extends {
[key: string]: DataType;
} = any, TNull = any>(options: VectorBuilderOptionsAsync<Struct<T> | Map_<T>, TNull>): Promise<Table<T>>;
static new<T extends VectorMap = any>(children: T): RecordBatch<{

@@ -42,6 +43,8 @@ [P in keyof T]: T[P]['type'];

protected _schema: Schema;
protected _dictionaries?: Map<number, Vector>;
constructor(schema: Schema<T>, length: number, children: (Data | Vector)[]);
constructor(schema: Schema<T>, data: Data<Struct<T>>, children?: Vector[]);
constructor(schema: Schema<T>, data: Data<Map_<T>>, children?: Vector[]);
readonly schema: Schema<any>;
readonly numCols: number;
readonly dictionaries: Map<number, Vector<any>>;
select<K extends keyof T = any>(...columnNames: K[]): RecordBatch<{

@@ -54,2 +57,15 @@ [key: string]: any;

}
/**
* An internal class used by the `RecordBatchReader` and `RecordBatchWriter`
* implementations to differentiate between a stream with valid zero-length
* RecordBatches, and a stream with a Schema message, but no RecordBatches.
* @see https://github.com/apache/arrow/pull/4373
* @ignore
* @private
*/
export declare class _InternalEmptyPlaceholderRecordBatch<T extends {
[key: string]: DataType;
} = any> extends RecordBatch<T> {
constructor(schema: Schema<T>);
}
export {};

@@ -20,9 +20,11 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Vector } from './vector';
import { Visitor } from './visitor';
import { Schema } from './schema';
import { Struct } from './type';
import { isIterable } from './util/compat';
import { Chunked } from './vector/chunked';
import { StructVector } from './vector/struct';
import { MapVector } from './vector/index';
import { selectFieldArgs } from './util/args';
import { DataType, Map_ } from './type';
import { ensureSameLengthData } from './util/recordbatch';
export class RecordBatch extends StructVector {
export class RecordBatch extends MapVector {
constructor(...args) {

@@ -38,3 +40,3 @@ let data;

const [, length, childData] = args;
data = Data.Struct(new Struct(fields), 0, length, 0, null, childData);
data = Data.Map(new Map_(fields), 0, length, 0, null, childData);
}

@@ -45,4 +47,7 @@ super(data, children);

/** @nocollapse */
static from(...args) {
return RecordBatch.new(args[0], args[1]);
static from(options) {
if (isIterable(options['values'])) {
return Table.from(options);
}
return Table.from(options);
}

@@ -64,2 +69,5 @@ /** @nocollapse */

get numCols() { return this._schema.fields.length; }
get dictionaries() {
return this._dictionaries || (this._dictionaries = DictionaryCollector.collect(this));
}
select(...columnNames) {

@@ -75,3 +83,43 @@ const nameToIndex = this._schema.fields.reduce((m, f, i) => m.set(f.name, i), new Map());

}
/**
* An internal class used by the `RecordBatchReader` and `RecordBatchWriter`
* implementations to differentiate between a stream with valid zero-length
* RecordBatches, and a stream with a Schema message, but no RecordBatches.
* @see https://github.com/apache/arrow/pull/4373
* @ignore
* @private
*/
/* tslint:disable:class-name */
export class _InternalEmptyPlaceholderRecordBatch extends RecordBatch {
constructor(schema) {
super(schema, 0, schema.fields.map((f) => Data.new(f.type, 0, 0, 0)));
}
}
/** @ignore */
class DictionaryCollector extends Visitor {
constructor() {
super(...arguments);
this.dictionaries = new Map();
}
static collect(batch) {
return new DictionaryCollector().visit(batch.data, new Map_(batch.schema.fields)).dictionaries;
}
visit(data, type) {
if (DataType.isDictionary(type)) {
return this.visitDictionary(data, type);
}
else {
data.childData.forEach((child, i) => this.visit(child, type.children[i].type));
}
return this;
}
visitDictionary(data, type) {
const dictionary = data.dictionary;
if (dictionary && dictionary.length > 0) {
this.dictionaries.set(type.id, dictionary);
}
return this;
}
}
//# sourceMappingURL=recordbatch.mjs.map
import { Data } from './data';
import { Vector } from './vector';
import { DataType, Dictionary } from './type';
import { DataType } from './type';
declare type VectorMap = {

@@ -37,4 +37,3 @@ [key: string]: Vector;

readonly dictionaries: Map<number, DataType>;
readonly dictionaryFields: Map<number, Field<Dictionary>[]>;
constructor(fields?: Field[], metadata?: Map<string, string> | null, dictionaries?: Map<number, DataType> | null, dictionaryFields?: Map<number, Field<Dictionary>[]> | null);
constructor(fields?: Field[], metadata?: Map<string, string> | null, dictionaries?: Map<number, DataType> | null);
readonly [Symbol.toStringTag]: string;

@@ -41,0 +40,0 @@ toString(): string;

@@ -17,15 +17,14 @@ // Licensed to the Apache Software Foundation (ASF) under one

// under the License.
import { DataType } from './type';
import { selectArgs } from './util/args';
import { DataType, Dictionary } from './type';
import { selectFieldArgs } from './util/args';
import { instance as comparer } from './visitor/typecomparator';
export class Schema {
constructor(fields = [], metadata, dictionaries, dictionaryFields) {
constructor(fields = [], metadata, dictionaries) {
this.fields = (fields || []);
this.metadata = metadata || new Map();
if (!dictionaries || !dictionaryFields) {
({ dictionaries, dictionaryFields } = generateDictionaryMap(fields, dictionaries || new Map(), dictionaryFields || new Map()));
if (!dictionaries) {
dictionaries = generateDictionaryMap(fields);
}
this.dictionaries = dictionaries;
this.dictionaryFields = dictionaryFields;
}

@@ -58,4 +57,2 @@ /** @nocollapse */

const curFields = [...this.fields];
const curDictionaries = [...this.dictionaries];
const curDictionaryFields = this.dictionaryFields;
const metadata = mergeMaps(mergeMaps(new Map(), this.metadata), other.metadata);

@@ -68,13 +65,4 @@ const newFields = other.fields.filter((f2) => {

});
const { dictionaries, dictionaryFields } = generateDictionaryMap(newFields, new Map(), new Map());
const newDictionaries = [...dictionaries].filter(([y]) => !curDictionaries.every(([x]) => x === y));
const newDictionaryFields = [...dictionaryFields].map(([id, newDictFields]) => {
return [id, [...(curDictionaryFields.get(id) || []), ...newDictFields.map((f) => {
const i = newFields.findIndex((f2) => f.name === f2.name);
const { dictionary, indices, isOrdered, dictionaryVector } = f.type;
const type = new Dictionary(dictionary, indices, id, isOrdered, dictionaryVector);
return newFields[i] = f.clone({ type });
})]];
});
return new Schema([...curFields, ...newFields], metadata, new Map([...curDictionaries, ...newDictionaries]), new Map([...curDictionaryFields, ...newDictionaryFields]));
const newDictionaries = generateDictionaryMap(newFields, new Map());
return new Schema([...curFields, ...newFields], metadata, new Map([...this.dictionaries, ...newDictionaries]));
}

@@ -119,3 +107,3 @@ }

/** @ignore */
function generateDictionaryMap(fields, dictionaries, dictionaryFields) {
function generateDictionaryMap(fields, dictionaries = new Map()) {
for (let i = -1, n = fields.length; ++i < n;) {

@@ -125,8 +113,4 @@ const field = fields[i];

if (DataType.isDictionary(type)) {
if (!dictionaryFields.get(type.id)) {
dictionaryFields.set(type.id, []);
}
if (!dictionaries.has(type.id)) {
dictionaries.set(type.id, type.dictionary);
dictionaryFields.get(type.id).push(field);
}

@@ -137,7 +121,7 @@ else if (dictionaries.get(type.id) !== type.dictionary) {

}
if (type.children) {
generateDictionaryMap(type.children, dictionaries, dictionaryFields);
if (type.children && type.children.length > 0) {
generateDictionaryMap(type.children, dictionaries);
}
}
return { dictionaries, dictionaryFields };
return dictionaries;
}

@@ -149,3 +133,2 @@ // Add these here so they're picked up by the externs creator

Schema.prototype.dictionaries = null;
Schema.prototype.dictionaryFields = null;
Field.prototype.type = null;

@@ -152,0 +135,0 @@ Field.prototype.name = null;

@@ -7,5 +7,6 @@ import { Data } from './data';

import { RecordBatchReader } from './ipc/reader';
import { DataType, RowLike, Struct, Map_ } from './type';
import { Clonable, Sliceable, Applicative } from './vector';
import { Vector, Chunked } from './vector/index';
import { DataType, RowLike, Struct } from './type';
import { Clonable, Sliceable, Applicative } from './vector';
import { VectorBuilderOptions, VectorBuilderOptionsAsync } from './vector/index';
declare type VectorMap = {

@@ -29,3 +30,3 @@ [key: string]: Vector;

slice(begin?: number, end?: number): Table<T>;
concat(...others: Vector<Struct<T>>[]): Table<T>;
concat(...others: Vector<Map_<T>>[]): Table<T>;
clone(chunks?: RecordBatch<T>[], offsets?: Uint32Array): Table<T>;

@@ -38,12 +39,10 @@ scan(next: import('./compute/dataframe').NextFunc, bind?: import('./compute/dataframe').BindFunc): void;

[key: string]: DataType;
} = any> extends Chunked<Struct<T>> implements DataFrame<T>, Clonable<Table<T>>, Sliceable<Table<T>>, Applicative<Struct<T>, Table<T>> {
} = any> extends Chunked<Map_<T>> implements DataFrame<T>, Clonable<Table<T>>, Sliceable<Table<T>>, Applicative<Map_<T>, Table<T>> {
/** @nocollapse */
static empty<T extends {
[key: string]: DataType;
} = any>(): Table<T>;
} = {}>(schema?: Schema<T>): Table<T>;
static from(): Table<{}>;
static from<T extends {
[key: string]: DataType;
} = any>(): Table<T>;
static from<T extends {
[key: string]: DataType;
} = any>(source: RecordBatchReader<T>): Table<T>;

@@ -71,2 +70,8 @@ static from<T extends {

} = any>(source: PromiseLike<RecordBatchReader<T>>): Promise<Table<T>>;
static from<T extends {
[key: string]: DataType;
} = any, TNull = any>(options: VectorBuilderOptions<Struct<T> | Map_<T>, TNull>): Table<T>;
static from<T extends {
[key: string]: DataType;
} = any, TNull = any>(options: VectorBuilderOptionsAsync<Struct<T> | Map_<T>, TNull>): Promise<Table<T>>;
/** @nocollapse */

@@ -77,5 +82,9 @@ static fromAsync<T extends {

/** @nocollapse */
static fromMap<T extends {
[key: string]: DataType;
} = any>(vector: Vector<Map_<T>>): Table<T>;
/** @nocollapse */
static fromStruct<T extends {
[key: string]: DataType;
} = any>(struct: Vector<Struct<T>>): Table<T>;
} = any>(vector: Vector<Struct<T>>): Table<T>;
/**

@@ -155,3 +164,3 @@ * @summary Create a new Table from a collection of Columns or Vectors,

getChildAt<R extends DataType = any>(index: number): Column<R> | null;
serialize(encoding?: string, stream?: boolean): Uint8Array;
serialize(encoding?: string, stream?: boolean): any;
count(): number;

@@ -158,0 +167,0 @@ select<K extends keyof T = any>(...columnNames: K[]): Table<{

@@ -18,13 +18,12 @@ // Licensed to the Apache Software Foundation (ASF) under one

import * as tslib_1 from "tslib";
import { Data } from './data';
import { Column } from './column';
import { Schema } from './schema';
import { isPromise } from './util/compat';
import { RecordBatch } from './recordbatch';
import { RecordBatch, _InternalEmptyPlaceholderRecordBatch } from './recordbatch';
import { RecordBatchReader } from './ipc/reader';
import { Chunked } from './vector/index';
import { Struct } from './type';
import { Struct, Map_ } from './type';
import { selectColumnArgs, selectArgs } from './util/args';
import { isPromise, isIterable, isAsyncIterable } from './util/compat';
import { distributeColumnsIntoRecordBatches } from './util/recordbatch';
import { distributeVectorsIntoRecordBatches } from './util/recordbatch';
import { Chunked, MapVector, StructVector } from './vector/index';
import { RecordBatchFileWriter, RecordBatchStreamWriter } from './ipc/writer';

@@ -41,6 +40,4 @@ export class Table extends Chunked {

}
if (!chunks[0]) {
chunks[0] = new RecordBatch(schema, 0, schema.fields.map((f) => Data.new(f.type, 0, 0)));
}
super(new Struct(schema.fields), chunks);
chunks[0] || (chunks[0] = new _InternalEmptyPlaceholderRecordBatch(schema));
super(new Map_(schema.fields), chunks);
this._schema = schema;

@@ -50,9 +47,17 @@ this._chunks = chunks;

/** @nocollapse */
static empty() { return new Table(new Schema([]), []); }
static empty(schema = new Schema([])) { return new Table(schema, []); }
/** @nocollapse */
static from(source) {
if (!source) {
static from(input) {
if (!input) {
return Table.empty();
}
let reader = RecordBatchReader.from(source);
if (typeof input === 'object') {
let table = isIterable(input['values']) ? tableFromIterable(input)
: isAsyncIterable(input['values']) ? tableFromAsyncIterable(input)
: null;
if (table !== null) {
return table;
}
}
let reader = RecordBatchReader.from(input);
if (isPromise(reader)) {

@@ -95,6 +100,10 @@ return (() => tslib_1.__awaiter(this, void 0, void 0, function* () { return yield Table.from(yield reader); }))();

/** @nocollapse */
static fromStruct(struct) {
return Table.new(struct.data.childData, struct.type.children);
static fromMap(vector) {
return Table.new(vector.data.childData, vector.type.children);
}
/** @nocollapse */
static fromStruct(vector) {
return Table.new(vector.data.childData, vector.type.children);
}
/** @nocollapse */
static new(...cols) {

@@ -141,6 +150,6 @@ return new Table(...distributeColumnsIntoRecordBatches(selectColumnArgs(cols)));

serialize(encoding = 'binary', stream = true) {
const writer = !stream
const Writer = !stream
? RecordBatchFileWriter
: RecordBatchStreamWriter;
return writer.writeAll(this._chunks).toUint8Array(true);
return Writer.writeAll(this).toUint8Array(true);
}

@@ -176,3 +185,23 @@ count() {

}
function tableFromIterable(input) {
const { type } = input;
if (type instanceof Map_) {
return Table.fromMap(MapVector.from(input));
}
else if (type instanceof Struct) {
return Table.fromStruct(StructVector.from(input));
}
return null;
}
function tableFromAsyncIterable(input) {
const { type } = input;
if (type instanceof Map_) {
return MapVector.from(input).then((vector) => Table.fromMap(vector));
}
else if (type instanceof Struct) {
return StructVector.from(input).then((vector) => Table.fromStruct(vector));
}
return null;
}
//# sourceMappingURL=table.mjs.map
import { Field } from './schema';
import { Vector } from './vector';
import { flatbuffers } from 'flatbuffers';
import { TypedArrayConstructor } from './interfaces';
import { Vector as VType, TypeToDataType } from './interfaces';
import { VectorType as V, TypeToDataType } from './interfaces';
import Long = flatbuffers.Long;

@@ -34,3 +33,7 @@ import { Type, Precision, UnionMode, DateUnit, TimeUnit, IntervalUnit } from './enum';

}
export declare class DataType<TType extends Type = Type, TChildren extends {
/**
* An abstract base class for classes that encapsulate metadata about each of
* the logical types that Arrow can represent.
*/
export declare abstract class DataType<TType extends Type = Type, TChildren extends {
[key: string]: DataType;

@@ -61,2 +64,3 @@ } = any> {

}
/** @ignore */
export interface Null extends DataType<Type.Null> {

@@ -66,2 +70,3 @@ TArray: void;

}
/** @ignore */
export declare class Null extends DataType<Type.Null> {

@@ -80,3 +85,3 @@ toString(): string;

TArray: IntArray;
TValue: number | Int32Array | Uint32Array;
TValue: number | bigint | Int32Array | Uint32Array;
};

@@ -105,3 +110,3 @@ [Type.Int8]: {

TArray: Int32Array;
TValue: Int32Array;
TValue: bigint | Int32Array | Uint32Array;
};

@@ -130,5 +135,6 @@ [Type.Uint8]: {

TArray: Uint32Array;
TValue: Uint32Array;
TValue: bigint | Int32Array | Uint32Array;
};
};
/** @ignore */
interface Int_<T extends Ints = Ints> extends DataType<T> {

@@ -138,2 +144,3 @@ TArray: IType[T]['TArray'];

}
/** @ignore */
declare class Int_<T extends Ints = Ints> extends DataType<T> {

@@ -149,23 +156,31 @@ readonly isSigned: IType[T]['isSigned'];

export { Int_ as Int };
/** @ignore */
export declare class Int8 extends Int_<Type.Int8> {
constructor();
}
/** @ignore */
export declare class Int16 extends Int_<Type.Int16> {
constructor();
}
/** @ignore */
export declare class Int32 extends Int_<Type.Int32> {
constructor();
}
/** @ignore */
export declare class Int64 extends Int_<Type.Int64> {
constructor();
}
/** @ignore */
export declare class Uint8 extends Int_<Type.Uint8> {
constructor();
}
/** @ignore */
export declare class Uint16 extends Int_<Type.Uint16> {
constructor();
}
/** @ignore */
export declare class Uint32 extends Int_<Type.Uint32> {
constructor();
}
/** @ignore */
export declare class Uint64 extends Int_<Type.Uint64> {

@@ -199,2 +214,3 @@ constructor();

};
/** @ignore */
export interface Float<T extends Floats = Floats> extends DataType<T> {

@@ -204,2 +220,3 @@ TArray: FType[T]['TArray'];

}
/** @ignore */
export declare class Float<T extends Floats = Floats> extends DataType<T> {

@@ -213,15 +230,21 @@ readonly precision: Precision;

}
/** @ignore */
export declare class Float16 extends Float<Type.Float16> {
constructor();
}
/** @ignore */
export declare class Float32 extends Float<Type.Float32> {
constructor();
}
/** @ignore */
export declare class Float64 extends Float<Type.Float64> {
constructor();
}
/** @ignore */
export interface Binary extends DataType<Type.Binary> {
TArray: Uint8Array;
TValue: Uint8Array;
ArrayType: TypedArrayConstructor<Uint8Array>;
}
/** @ignore */
export declare class Binary extends DataType<Type.Binary> {

@@ -233,7 +256,9 @@ constructor();

}
/** @ignore */
export interface Utf8 extends DataType<Type.Utf8> {
TArray: Uint8Array;
TValue: string;
ArrayType: typeof Uint8Array;
ArrayType: TypedArrayConstructor<Uint8Array>;
}
/** @ignore */
export declare class Utf8 extends DataType<Type.Utf8> {

@@ -245,7 +270,9 @@ constructor();

}
/** @ignore */
export interface Bool extends DataType<Type.Bool> {
TArray: Uint8Array;
TValue: boolean;
ArrayType: typeof Uint8Array;
ArrayType: TypedArrayConstructor<Uint8Array>;
}
/** @ignore */
export declare class Bool extends DataType<Type.Bool> {

@@ -257,7 +284,9 @@ constructor();

}
/** @ignore */
export interface Decimal extends DataType<Type.Decimal> {
TArray: Uint32Array;
TValue: Uint32Array;
ArrayType: typeof Uint32Array;
ArrayType: TypedArrayConstructor<Uint32Array>;
}
/** @ignore */
export declare class Decimal extends DataType<Type.Decimal> {

@@ -273,7 +302,9 @@ readonly scale: number;

export declare type Dates = Type.Date | Type.DateDay | Type.DateMillisecond;
/** @ignore */
export interface Date_<T extends Dates = Dates> extends DataType<T> {
TArray: Int32Array;
TValue: Date;
ArrayType: typeof Int32Array;
ArrayType: TypedArrayConstructor<Int32Array>;
}
/** @ignore */
export declare class Date_<T extends Dates = Dates> extends DataType<T> {

@@ -286,5 +317,7 @@ readonly unit: DateUnit;

}
/** @ignore */
export declare class DateDay extends Date_<Type.DateDay> {
constructor();
}
/** @ignore */
export declare class DateMillisecond extends Date_<Type.DateMillisecond> {

@@ -318,7 +351,9 @@ constructor();

};
/** @ignore */
interface Time_<T extends Times = Times> extends DataType<T> {
TArray: Int32Array;
TValue: TimesType[T]['TValue'];
ArrayType: typeof Int32Array;
ArrayType: TypedArrayConstructor<Int32Array>;
}
/** @ignore */
declare class Time_<T extends Times = Times> extends DataType<T> {

@@ -333,11 +368,15 @@ readonly unit: TimesType[T]['unit'];

export { Time_ as Time };
/** @ignore */
export declare class TimeSecond extends Time_<Type.TimeSecond> {
constructor();
}
/** @ignore */
export declare class TimeMillisecond extends Time_<Type.TimeMillisecond> {
constructor();
}
/** @ignore */
export declare class TimeMicrosecond extends Time_<Type.TimeMicrosecond> {
constructor();
}
/** @ignore */
export declare class TimeNanosecond extends Time_<Type.TimeNanosecond> {

@@ -348,7 +387,9 @@ constructor();

declare type Timestamps = Type.Timestamp | Type.TimestampSecond | Type.TimestampMillisecond | Type.TimestampMicrosecond | Type.TimestampNanosecond;
/** @ignore */
interface Timestamp_<T extends Timestamps = Timestamps> extends DataType<T> {
TArray: Int32Array;
TValue: number;
ArrayType: typeof Int32Array;
ArrayType: TypedArrayConstructor<Int32Array>;
}
/** @ignore */
declare class Timestamp_<T extends Timestamps = Timestamps> extends DataType<T> {

@@ -363,11 +404,15 @@ readonly unit: TimeUnit;

export { Timestamp_ as Timestamp };
/** @ignore */
export declare class TimestampSecond extends Timestamp_<Type.TimestampSecond> {
constructor(timezone?: string | null);
}
/** @ignore */
export declare class TimestampMillisecond extends Timestamp_<Type.TimestampMillisecond> {
constructor(timezone?: string | null);
}
/** @ignore */
export declare class TimestampMicrosecond extends Timestamp_<Type.TimestampMicrosecond> {
constructor(timezone?: string | null);
}
/** @ignore */
export declare class TimestampNanosecond extends Timestamp_<Type.TimestampNanosecond> {

@@ -378,7 +423,9 @@ constructor(timezone?: string | null);

declare type Intervals = Type.Interval | Type.IntervalDayTime | Type.IntervalYearMonth;
/** @ignore */
interface Interval_<T extends Intervals = Intervals> extends DataType<T> {
TArray: Int32Array;
TValue: Int32Array;
ArrayType: typeof Int32Array;
ArrayType: TypedArrayConstructor<Int32Array>;
}
/** @ignore */
declare class Interval_<T extends Intervals = Intervals> extends DataType<T> {

@@ -392,8 +439,11 @@ readonly unit: IntervalUnit;

export { Interval_ as Interval };
/** @ignore */
export declare class IntervalDayTime extends Interval_<Type.IntervalDayTime> {
constructor();
}
/** @ignore */
export declare class IntervalYearMonth extends Interval_<Type.IntervalYearMonth> {
constructor();
}
/** @ignore */
export interface List<T extends DataType = any> extends DataType<Type.List, {

@@ -403,4 +453,5 @@ [0]: T;

TArray: IterableArrayLike<T>;
TValue: VType<T>;
TValue: V<T>;
}
/** @ignore */
export declare class List<T extends DataType = any> extends DataType<Type.List, {

@@ -418,2 +469,3 @@ [0]: T;

}
/** @ignore */
export interface Struct<T extends {

@@ -426,2 +478,3 @@ [key: string]: DataType;

}
/** @ignore */
export declare class Struct<T extends {

@@ -438,6 +491,9 @@ [key: string]: DataType;

declare type Unions = Type.Union | Type.DenseUnion | Type.SparseUnion;
/** @ignore */
interface Union_<T extends Unions = Unions> extends DataType<T> {
TArray: Int32Array;
TValue: any[];
TArray: Int8Array;
TValue: any;
ArrayType: TypedArrayConstructor<Int8Array>;
}
/** @ignore */
declare class Union_<T extends Unions = Unions> extends DataType<T> {

@@ -456,13 +512,17 @@ readonly mode: UnionMode;

export { Union_ as Union };
/** @ignore */
export declare class DenseUnion extends Union_<Type.DenseUnion> {
constructor(typeIds: number[] | Int32Array, children: Field[]);
}
/** @ignore */
export declare class SparseUnion extends Union_<Type.SparseUnion> {
constructor(typeIds: number[] | Int32Array, children: Field[]);
}
/** @ignore */
export interface FixedSizeBinary extends DataType<Type.FixedSizeBinary> {
TArray: Uint8Array;
TValue: Uint8Array;
ArrayType: typeof Uint8Array;
ArrayType: TypedArrayConstructor<Uint8Array>;
}
/** @ignore */
export declare class FixedSizeBinary extends DataType<Type.FixedSizeBinary> {

@@ -475,6 +535,8 @@ readonly byteWidth: number;

}
/** @ignore */
export interface FixedSizeList<T extends DataType = any> extends DataType<Type.FixedSizeList> {
TArray: IterableArrayLike<T['TArray']>;
TValue: VType<T>;
TValue: V<T>;
}
/** @ignore */
export declare class FixedSizeList<T extends DataType = any> extends DataType<Type.FixedSizeList, {

@@ -493,9 +555,11 @@ [0]: T;

}
/** @ignore */
export interface Map_<T extends {
[key: string]: DataType;
} = any> extends DataType<Type.Map> {
TArray: Uint8Array;
TArray: IterableArrayLike<RowLike<T>>;
TValue: RowLike<T>;
dataTypes: T;
}
/** @ignore */
export declare class Map_<T extends {

@@ -513,2 +577,3 @@ [key: string]: DataType;

export declare type TKeys = Int8 | Int16 | Int32 | Uint8 | Uint16 | Uint32;
/** @ignore */
export interface Dictionary<T extends DataType = any, TKey extends TKeys = TKeys> extends DataType<Type.Dictionary> {

@@ -518,2 +583,3 @@ TArray: TKey['TArray'];

}
/** @ignore */
export declare class Dictionary<T extends DataType = any, TKey extends TKeys = TKeys> extends DataType<Type.Dictionary> {

@@ -524,4 +590,3 @@ readonly id: number;

readonly isOrdered: boolean;
dictionaryVector: Vector<T>;
constructor(dictionary: T, indices: TKey, id?: Long | number | null, isOrdered?: boolean | null, dictionaryVector?: Vector<T>);
constructor(dictionary: T, indices: TKey, id?: Long | number | null, isOrdered?: boolean | null);
readonly typeId: Type.Dictionary;

@@ -541,1 +606,3 @@ readonly children: Field<any>[];

export declare type IntArray = Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array;
/** @ignore */
export declare function strideForType(type: DataType): number;

@@ -19,2 +19,6 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Type, Precision, UnionMode, DateUnit, TimeUnit, IntervalUnit } from './enum';
/**
* An abstract base class for classes that encapsulate metadata about each of
* the logical types that Arrow can represent.
*/
export class DataType {

@@ -49,2 +53,3 @@ /** @nocollapse */ static isNull(x) { return x && x.typeId === Type.Null; }

})(DataType.prototype);
/** @ignore */
export class Null extends DataType {

@@ -57,2 +62,3 @@ toString() { return `Null`; }

})(Null.prototype);
/** @ignore */
class Int_ extends DataType {

@@ -82,23 +88,31 @@ constructor(isSigned, bitWidth) {

export { Int_ as Int };
/** @ignore */
export class Int8 extends Int_ {
constructor() { super(true, 8); }
}
/** @ignore */
export class Int16 extends Int_ {
constructor() { super(true, 16); }
}
/** @ignore */
export class Int32 extends Int_ {
constructor() { super(true, 32); }
}
/** @ignore */
export class Int64 extends Int_ {
constructor() { super(true, 64); }
}
/** @ignore */
export class Uint8 extends Int_ {
constructor() { super(false, 8); }
}
/** @ignore */
export class Uint16 extends Int_ {
constructor() { super(false, 16); }
}
/** @ignore */
export class Uint32 extends Int_ {
constructor() { super(false, 32); }
}
/** @ignore */
export class Uint64 extends Int_ {

@@ -115,2 +129,3 @@ constructor() { super(false, 64); }

Object.defineProperty(Uint64.prototype, 'ArrayType', { value: Uint32Array });
/** @ignore */
export class Float extends DataType {

@@ -136,8 +151,11 @@ constructor(precision) {

})(Float.prototype);
/** @ignore */
export class Float16 extends Float {
constructor() { super(Precision.HALF); }
}
/** @ignore */
export class Float32 extends Float {
constructor() { super(Precision.SINGLE); }
}
/** @ignore */
export class Float64 extends Float {

@@ -149,2 +167,3 @@ constructor() { super(Precision.DOUBLE); }

Object.defineProperty(Float64.prototype, 'ArrayType', { value: Float64Array });
/** @ignore */
export class Binary extends DataType {

@@ -161,2 +180,3 @@ constructor() {

})(Binary.prototype);
/** @ignore */
export class Utf8 extends DataType {

@@ -173,2 +193,3 @@ constructor() {

})(Utf8.prototype);
/** @ignore */
export class Bool extends DataType {

@@ -185,2 +206,3 @@ constructor() {

})(Bool.prototype);
/** @ignore */
export class Decimal extends DataType {

@@ -201,2 +223,3 @@ constructor(scale, precision) {

})(Decimal.prototype);
/** @ignore */
export class Date_ extends DataType {

@@ -215,8 +238,11 @@ constructor(unit) {

})(Date_.prototype);
/** @ignore */
export class DateDay extends Date_ {
constructor() { super(DateUnit.DAY); }
}
/** @ignore */
export class DateMillisecond extends Date_ {
constructor() { super(DateUnit.MILLISECOND); }
}
/** @ignore */
class Time_ extends DataType {

@@ -238,14 +264,19 @@ constructor(unit, bitWidth) {

export { Time_ as Time };
/** @ignore */
export class TimeSecond extends Time_ {
constructor() { super(TimeUnit.SECOND, 32); }
}
/** @ignore */
export class TimeMillisecond extends Time_ {
constructor() { super(TimeUnit.MILLISECOND, 32); }
}
/** @ignore */
export class TimeMicrosecond extends Time_ {
constructor() { super(TimeUnit.MICROSECOND, 64); }
}
/** @ignore */
export class TimeNanosecond extends Time_ {
constructor() { super(TimeUnit.NANOSECOND, 64); }
}
/** @ignore */
class Timestamp_ extends DataType {

@@ -267,14 +298,19 @@ constructor(unit, timezone) {

export { Timestamp_ as Timestamp };
/** @ignore */
export class TimestampSecond extends Timestamp_ {
constructor(timezone) { super(TimeUnit.SECOND, timezone); }
}
/** @ignore */
export class TimestampMillisecond extends Timestamp_ {
constructor(timezone) { super(TimeUnit.MILLISECOND, timezone); }
}
/** @ignore */
export class TimestampMicrosecond extends Timestamp_ {
constructor(timezone) { super(TimeUnit.MICROSECOND, timezone); }
}
/** @ignore */
export class TimestampNanosecond extends Timestamp_ {
constructor(timezone) { super(TimeUnit.NANOSECOND, timezone); }
}
/** @ignore */
class Interval_ extends DataType {

@@ -294,8 +330,11 @@ constructor(unit) {

export { Interval_ as Interval };
/** @ignore */
export class IntervalDayTime extends Interval_ {
constructor() { super(IntervalUnit.DAY_TIME); }
}
/** @ignore */
export class IntervalYearMonth extends Interval_ {
constructor() { super(IntervalUnit.YEAR_MONTH); }
}
/** @ignore */
export class List extends DataType {

@@ -316,2 +355,3 @@ constructor(child) {

})(List.prototype);
/** @ignore */
export class Struct extends DataType {

@@ -330,2 +370,3 @@ constructor(children) {

})(Struct.prototype);
/** @ignore */
class Union_ extends DataType {

@@ -351,6 +392,7 @@ constructor(mode, typeIds, children) {

proto.typeIdToChildIndex = null;
proto.ArrayType = Int32Array;
proto.ArrayType = Int8Array;
return proto[Symbol.toStringTag] = 'Union';
})(Union_.prototype);
export { Union_ as Union };
/** @ignore */
export class DenseUnion extends Union_ {

@@ -361,2 +403,3 @@ constructor(typeIds, children) {

}
/** @ignore */
export class SparseUnion extends Union_ {

@@ -367,2 +410,3 @@ constructor(typeIds, children) {

}
/** @ignore */
export class FixedSizeBinary extends DataType {

@@ -381,2 +425,3 @@ constructor(byteWidth) {

})(FixedSizeBinary.prototype);
/** @ignore */
export class FixedSizeList extends DataType {

@@ -399,2 +444,3 @@ constructor(listSize, child) {

})(FixedSizeList.prototype);
/** @ignore */
export class Map_ extends DataType {

@@ -416,4 +462,5 @@ constructor(children, keysSorted = false) {

const getId = ((atomicDictionaryId) => () => ++atomicDictionaryId)(-1);
/** @ignore */
export class Dictionary extends DataType {
constructor(dictionary, indices, id, isOrdered, dictionaryVector) {
constructor(dictionary, indices, id, isOrdered) {
super();

@@ -423,3 +470,2 @@ this.indices = indices;

this.isOrdered = isOrdered || false;
this.dictionaryVector = dictionaryVector;
this.id = id == null ? getId() : typeof id === 'number' ? id : id.low;

@@ -438,6 +484,20 @@ }

proto.dictionary = null;
proto.dictionaryVector = null;
return proto[Symbol.toStringTag] = 'Dictionary';
})(Dictionary.prototype);
/** @ignore */
export function strideForType(type) {
let t = type;
switch (type.typeId) {
case Type.Decimal: return 4;
case Type.Timestamp: return 2;
case Type.Date: return 1 + t.unit;
case Type.Interval: return 1 + t.unit;
case Type.Int: return 1 + +(t.bitWidth > 32);
case Type.Time: return 1 + +(t.bitWidth > 32);
case Type.FixedSizeList: return t.listSize;
case Type.FixedSizeBinary: return t.byteWidth;
default: return 1;
}
}
//# sourceMappingURL=type.mjs.map

@@ -139,3 +139,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

if (val instanceof Column && (values[++valueIndex] = val)) {
fields[++fieldIndex] = val.field.clone(keys[idx], val.type, val.nullCount > 0);
fields[++fieldIndex] = val.field.clone(keys[idx], val.type, true);
}

@@ -145,7 +145,7 @@ else {

if (val instanceof DataType && (values[++valueIndex] = val)) {
fields[++fieldIndex] = Field.new(field, val);
fields[++fieldIndex] = Field.new(field, val, true);
}
else if (val && val.type && (values[++valueIndex] = val)) {
val instanceof Data && (values[valueIndex] = val = Vector.new(val));
fields[++fieldIndex] = Field.new(field, val.type, val.nullCount > 0);
fields[++fieldIndex] = Field.new(field, val.type, true);
}

@@ -152,0 +152,0 @@ }

@@ -0,17 +1,28 @@

import { ArrayBufferViewInput } from './buffer';
import { TypedArray, TypedArrayConstructor } from '../interfaces';
import { BigIntArray, BigIntArrayConstructor } from '../interfaces';
import { ArrayBufferViewInput } from './buffer';
/** @ignore */
declare type BigNumArray = IntArray | UintArray;
export declare const isArrowBigNumSymbol: unique symbol;
/** @ignore */ declare type BigNumArray = IntArray | UintArray;
/** @ignore */ declare type IntArray = Int8Array | Int16Array | Int32Array;
/** @ignore */ declare type UintArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray;
/** @ignore */
declare type IntArray = Int8Array | Int16Array | Int32Array;
export declare let bignumToString: {
<T extends BN<BigNumArray>>(a: T): string;
};
/** @ignore */
declare type UintArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray;
export declare let bignumToBigInt: {
<T extends BN<BigNumArray>>(a: T): bigint;
};
/** @ignore */
export declare class BN<T extends BigNumArray> {
static new<T extends BigNumArray>(input: ArrayBufferViewInput, signed?: boolean): T;
/** @nocollapse */
static signed<T extends IntArray>(input: ArrayBufferViewInput): T;
static new<T extends BigNumArray>(num: T, isSigned?: boolean): (T & BN<T>);
/** @nocollapse */
static unsigned<T extends UintArray>(input: ArrayBufferViewInput): T;
constructor(input: ArrayBufferViewInput, signed?: boolean);
static signed<T extends IntArray>(num: T): (T & BN<T>);
/** @nocollapse */
static unsigned<T extends UintArray>(num: T): (T & BN<T>);
/** @nocollapse */
static decimal<T extends UintArray>(num: T): (T & BN<T>);
constructor(num: T, isSigned?: boolean);
}

@@ -22,2 +33,3 @@ /** @ignore */

readonly signed: boolean;
readonly TypedArray: TypedArrayConstructor<TypedArray>;
readonly BigIntArray: BigIntArrayConstructor<BigIntArray>;

@@ -40,3 +52,3 @@ [Symbol.toStringTag]: 'Int8Array' | 'Int16Array' | 'Int32Array' | 'Uint8Array' | 'Uint16Array' | 'Uint32Array' | 'Uint8ClampedArray';

toJSON(): string;
[Symbol.toPrimitive](hint: any): number | string | bigint;
[Symbol.toPrimitive](hint?: any): number | string | bigint;
}

@@ -43,0 +55,0 @@ /** @ignore */

@@ -20,56 +20,51 @@ // Licensed to the Apache Software Foundation (ASF) under one

/** @ignore */
const BigNumNMixin = {
toJSON() { return `"${bignumToString(this)}"`; },
valueOf() { return bignumToNumber(this); },
toString() { return bignumToString(this); },
[Symbol.toPrimitive](hint) {
switch (hint) {
case 'number': return bignumToNumber(this);
case 'string': return bignumToString(this);
case 'default': return bignumToBigInt(this);
}
return bignumToString(this);
export const isArrowBigNumSymbol = Symbol.for('isArrowBigNum');
/** @ignore */
function BigNum(x, ...xs) {
if (xs.length === 0) {
return Object.setPrototypeOf(toArrayBufferView(this['TypedArray'], x), this.constructor.prototype);
}
return Object.setPrototypeOf(new this['TypedArray'](x, ...xs), this.constructor.prototype);
}
BigNum.prototype[isArrowBigNumSymbol] = true;
BigNum.prototype.toJSON = function () { return `"${bignumToString(this)}"`; };
BigNum.prototype.valueOf = function () { return bignumToNumber(this); };
BigNum.prototype.toString = function () { return bignumToString(this); };
BigNum.prototype[Symbol.toPrimitive] = function (hint = 'default') {
switch (hint) {
case 'number': return bignumToNumber(this);
case 'string': return bignumToString(this);
case 'default': return bignumToBigInt(this);
}
return bignumToString(this);
};
/** @ignore */
const SignedBigNumNMixin = Object.assign({}, BigNumNMixin, { signed: true, BigIntArray: BigInt64Array });
function SignedBigNum(...args) { return BigNum.apply(this, args); }
/** @ignore */
const UnsignedBigNumNMixin = Object.assign({}, BigNumNMixin, { signed: false, BigIntArray: BigUint64Array });
function UnsignedBigNum(...args) { return BigNum.apply(this, args); }
/** @ignore */
export class BN {
constructor(input, signed = input instanceof Int32Array) {
return BN.new(input, signed);
}
/** @nocollapse */
static new(input, signed = (input instanceof Int8Array || input instanceof Int16Array || input instanceof Int32Array)) {
return (signed === true) ? BN.signed(input) : BN.unsigned(input);
}
/** @nocollapse */
static signed(input) {
const Ctor = ArrayBuffer.isView(input) ? input.constructor : Int32Array;
const { buffer, byteOffset, length } = toArrayBufferView(Ctor, input);
const bn = new Ctor(buffer, byteOffset, length);
return Object.assign(bn, SignedBigNumNMixin);
}
/** @nocollapse */
static unsigned(input) {
const Ctor = ArrayBuffer.isView(input) ? input.constructor : Uint32Array;
const { buffer, byteOffset, length } = toArrayBufferView(Ctor, input);
const bn = new Ctor(buffer, byteOffset, length);
return Object.assign(bn, UnsignedBigNumNMixin);
}
}
function DecimalBigNum(...args) { return BigNum.apply(this, args); }
Object.setPrototypeOf(SignedBigNum.prototype, Object.create(Int32Array.prototype));
Object.setPrototypeOf(UnsignedBigNum.prototype, Object.create(Uint32Array.prototype));
Object.setPrototypeOf(DecimalBigNum.prototype, Object.create(Uint32Array.prototype));
Object.assign(SignedBigNum.prototype, BigNum.prototype, { 'constructor': SignedBigNum, 'signed': true, 'TypedArray': Int32Array, 'BigIntArray': BigInt64Array });
Object.assign(UnsignedBigNum.prototype, BigNum.prototype, { 'constructor': UnsignedBigNum, 'signed': false, 'TypedArray': Uint32Array, 'BigIntArray': BigUint64Array });
Object.assign(DecimalBigNum.prototype, BigNum.prototype, { 'constructor': DecimalBigNum, 'signed': true, 'TypedArray': Uint32Array, 'BigIntArray': BigUint64Array });
/** @ignore */
function bignumToNumber({ buffer, byteOffset, length }) {
let int64 = 0;
let words = new Uint32Array(buffer, byteOffset, length);
for (let i = 0, n = words.length; i < n;) {
int64 += words[i++] + (words[i++] * (Math.pow(i, 32)));
function bignumToNumber(bn) {
let { buffer, byteOffset, length, 'signed': signed } = bn;
let words = new Int32Array(buffer, byteOffset, length);
let number = 0, i = 0, n = words.length, hi, lo;
while (i < n) {
lo = words[i++];
hi = words[i++];
signed || (hi = hi >>> 0);
number += (lo >>> 0) + (hi * (Math.pow(i, 32)));
}
return int64;
return number;
}
/** @ignore */
let bignumToString;
export let bignumToString;
/** @ignore */
let bignumToBigInt;
export let bignumToBigInt;
if (!BigIntAvailable) {

@@ -80,9 +75,10 @@ bignumToString = decimalToString;

else {
bignumToBigInt = ((a) => a.length === 2 ? new a.BigIntArray(a.buffer, a.byteOffset, 1)[0] : decimalToString(a));
bignumToString = ((a) => a.length === 2 ? `${new a.BigIntArray(a.buffer, a.byteOffset, 1)[0]}` : decimalToString(a));
bignumToBigInt = ((a) => a.byteLength === 8 ? new a['BigIntArray'](a.buffer, a.byteOffset, 1)[0] : decimalToString(a));
bignumToString = ((a) => a.byteLength === 8 ? `${new a['BigIntArray'](a.buffer, a.byteOffset, 1)[0]}` : decimalToString(a));
}
/** @ignore */
function decimalToString(a) {
let digits = '';
let base64 = new Uint32Array(2);
let base32 = new Uint16Array(a.buffer, a.byteOffset, a.length * 2);
let base32 = new Uint16Array(a.buffer, a.byteOffset, a.byteLength / 2);
let checks = new Uint32Array((base32 = new Uint16Array(base32).reverse()).buffer);

@@ -101,3 +97,39 @@ let i = -1, n = base32.length - 1;

}
/** @ignore */
export class BN {
constructor(num, isSigned) {
return BN.new(num, isSigned);
}
/** @nocollapse */
static new(num, isSigned) {
switch (isSigned) {
case true: return new SignedBigNum(num);
case false: return new UnsignedBigNum(num);
}
switch (num.constructor) {
case Int8Array:
case Int16Array:
case Int32Array:
case BigInt64Array:
return new SignedBigNum(num);
}
if (num.byteLength === 16) {
return new DecimalBigNum(num);
}
return new UnsignedBigNum(num);
}
/** @nocollapse */
static signed(num) {
return new SignedBigNum(num);
}
/** @nocollapse */
static unsigned(num) {
return new UnsignedBigNum(num);
}
/** @nocollapse */
static decimal(num) {
return new DecimalBigNum(num);
}
}
//# sourceMappingURL=bn.mjs.map

@@ -31,12 +31,7 @@ // Licensed to the Apache Software Foundation (ASF) under one

y = chunks[i];
// continue x and y don't share the same underlying ArrayBuffer
if (!x || !y || x.buffer !== y.buffer) {
// continue if x and y don't share the same underlying ArrayBuffer, or if x isn't before y
if (!x || !y || x.buffer !== y.buffer || y.byteOffset < x.byteOffset) {
y && (result[++j] = y);
continue;
}
// swap if y starts before x
if (y.byteOffset < x.byteOffset) {
x = chunks[i];
y = result[j];
}
({ byteOffset: xOffset, byteLength: xLen } = x);

@@ -90,2 +85,10 @@ ({ byteOffset: yOffset, byteLength: yLen } = y);

let value = isIteratorResult(input) ? input.value : input;
if (value instanceof ArrayBufferViewCtor) {
if (ArrayBufferViewCtor === Uint8Array) {
// Node's `Buffer` class passes the `instanceof Uint8Array` check, but we need
// a real Uint8Array, since Buffer#slice isn't the same as Uint8Array#slice :/
return new ArrayBufferViewCtor(value.buffer, value.byteOffset, value.byteLength);
}
return value;
}
if (!value) {

@@ -97,8 +100,2 @@ return new ArrayBufferViewCtor(0);

}
if (value instanceof ArrayBufferViewCtor) {
return value.constructor === ArrayBufferViewCtor ? value :
// Node's `Buffer` class passes the `instanceof Uint8Array` check, but we need
// a real Uint8Array, since Buffer#slice isn't the same as Uint8Array#slice :/
new ArrayBufferViewCtor(value.buffer, value.byteOffset, value.byteLength / ArrayBufferViewCtor.BYTES_PER_ELEMENT);
}
if (value instanceof ArrayBuffer) {

@@ -105,0 +102,0 @@ return new ArrayBufferViewCtor(value);

@@ -114,5 +114,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

return isObject(x) &&
isFunction(x['tee']) &&
isFunction(x['cancel']) &&
isFunction(x['pipeTo']) &&
isFunction(x['getReader']) &&

@@ -119,0 +117,0 @@ !(x instanceof ReadableInterop);

@@ -0,1 +1,2 @@

/** @ignore */
export declare class BaseInt64 {

@@ -13,2 +14,3 @@ protected buffer: Uint32Array;

}
/** @ignore */
export declare class Uint64 extends BaseInt64 {

@@ -30,2 +32,3 @@ times(other: Uint64): Uint64;

}
/** @ignore */
export declare class Int64 extends BaseInt64 {

@@ -49,2 +52,3 @@ negate(): Int64;

}
/** @ignore */
export declare class Int128 {

@@ -51,0 +55,0 @@ private buffer;

@@ -38,2 +38,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

100000000];
/** @ignore */
export class BaseInt64 {

@@ -96,2 +97,3 @@ constructor(buffer) {

}
/** @ignore */
export class Uint64 extends BaseInt64 {

@@ -154,2 +156,3 @@ times(other) {

}
/** @ignore */
export class Int64 extends BaseInt64 {

@@ -229,2 +232,3 @@ negate() {

}
/** @ignore */
export class Int128 {

@@ -231,0 +235,0 @@ constructor(buffer) {

/** @ignore */
export declare const decodeUtf8: ((input?: ArrayBuffer | ArrayBufferView | undefined, options?: TextDecodeOptions | undefined) => string) | ((input: ArrayBuffer | SharedArrayBuffer | ArrayBufferView) => string);
export declare const decodeUtf8: (input: ArrayBuffer | SharedArrayBuffer | ArrayBufferView) => string;
/** @ignore */
export declare const encodeUtf8: (input?: string | undefined) => Uint8Array;
export declare const encodeUtf8: (value?: string | undefined) => Uint8Array;

@@ -26,4 +26,4 @@ // Licensed to the Apache Software Foundation (ASF) under one

if (useNativeEncoders || !_Buffer) {
const decoder = new TextDecoder();
return decoder.decode.bind(decoder);
const decoder = new TextDecoder('utf-8');
return (buffer) => decoder.decode(buffer);
}

@@ -39,3 +39,3 @@ return (input) => {

const encoder = new TextEncoder();
return encoder.encode.bind(encoder);
return (value) => encoder.encode(value);
}

@@ -42,0 +42,0 @@ return (input = '') => toUint8Array(_Buffer.from(input, 'utf8'));

@@ -47,2 +47,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

const big0 = BigIntAvailable ? BigInt(0) : 0;
const isNaNFast = (value) => value !== value;
/** @ignore */

@@ -53,2 +54,6 @@ export function createElementComparator(search) {

if (typeofSearch !== 'object' || search === null) {
// Compare NaN
if (isNaNFast(search)) {
return isNaNFast;
}
return typeofSearch !== 'bigint'

@@ -55,0 +60,0 @@ ? (value) => value === search

@@ -5,7 +5,7 @@ import { Data } from './data';

/** @ignore */
export interface Clonable<R extends Vector> {
export interface Clonable<R extends AbstractVector> {
clone(...args: any[]): R;
}
/** @ignore */
export interface Sliceable<R extends Vector> {
export interface Sliceable<R extends AbstractVector> {
slice(begin?: number, end?: number): R;

@@ -30,2 +30,3 @@ }

abstract readonly nullCount: number;
abstract readonly byteLength: number;
abstract readonly numChildren: number;

@@ -32,0 +33,0 @@ abstract readonly ArrayType: T['ArrayType'];

import { Data } from '../data';
import { AbstractVector, Vector } from '../vector';
import { DataType } from '../type';
import { Chunked } from './chunked';
import { Vector as VType } from '../interfaces';
import { Clonable, Sliceable, Applicative } from '../vector';
export interface BaseVector<T extends DataType = any> extends Clonable<VType<T>>, Sliceable<VType<T>>, Applicative<T, Chunked<T>> {
slice(begin?: number, end?: number): VType<T>;
import { VectorType as V } from '../interfaces';
import { AbstractVector, Vector, Clonable, Sliceable, Applicative } from '../vector';
/** @ignore */
export interface BaseVector<T extends DataType = any> extends Clonable<V<T>>, Sliceable<V<T>>, Applicative<T, Chunked<T>> {
slice(begin?: number, end?: number): V<T>;
concat(...others: Vector<T>[]): Chunked<T>;
clone<R extends DataType = T>(data: Data<R>, children?: Vector<R>[]): VType<R>;
clone<R extends DataType = T>(data: Data<R>, children?: Vector<R>[]): V<R>;
}
export declare abstract class BaseVector<T extends DataType = any> extends AbstractVector<T> implements Clonable<VType<T>>, Sliceable<VType<T>>, Applicative<T, Chunked<T>> {
/** @ignore */
export declare abstract class BaseVector<T extends DataType = any> extends AbstractVector<T> implements Clonable<V<T>>, Sliceable<V<T>>, Applicative<T, Chunked<T>> {
protected _children?: Vector[];

@@ -23,2 +24,3 @@ constructor(data: Data<T>, children?: Vector[]);

readonly nullCount: number;
readonly byteLength: number;
readonly VectorName: string;

@@ -25,0 +27,0 @@ readonly ArrayType: T['ArrayType'];

@@ -17,5 +17,7 @@ // Licensed to the Apache Software Foundation (ASF) under one

// under the License.
import { AbstractVector, Vector } from '../vector';
import { Type } from '../enum';
import { Chunked } from './chunked';
import { clampRange } from '../util/vector';
import { AbstractVector, Vector } from '../vector';
/** @ignore */
export class BaseVector extends AbstractVector {

@@ -34,4 +36,5 @@ constructor(data, children) {

get nullCount() { return this.data.nullCount; }
get VectorName() { return this.constructor.name; }
get ArrayType() { return this.data.ArrayType; }
get byteLength() { return this.data.byteLength; }
get VectorName() { return `${Type[this.typeId]}Vector`; }
get ArrayType() { return this.type.ArrayType; }
get values() { return this.data.values; }

@@ -67,3 +70,2 @@ get typeIds() { return this.data.typeIds; }

}
// @ts-ignore
toJSON() { return [...this]; }

@@ -70,0 +72,0 @@ _sliceInternal(self, begin, end) {

import { BaseVector } from './base';
import { Binary } from '../type';
/** @ignore */
export declare class BinaryVector extends BaseVector<Binary> {
asUtf8(): import("./utf8").Utf8Vector;
}

@@ -20,2 +20,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Utf8 } from '../type';
/** @ignore */
export class BinaryVector extends BaseVector {

@@ -22,0 +23,0 @@ asUtf8() {

import { Bool } from '../type';
import { Chunked } from './chunked';
import { BaseVector } from './base';
import { VectorBuilderOptions } from './index';
import { VectorBuilderOptionsAsync } from './index';
/** @ignore */
export declare class BoolVector extends BaseVector<Bool> {
/** @nocollapse */
static from(data: Iterable<boolean>): BoolVector;
static from<TNull = any>(input: Iterable<boolean | TNull>): BoolVector;
static from<TNull = any>(input: AsyncIterable<boolean | TNull>): Promise<BoolVector>;
static from<TNull = any>(input: VectorBuilderOptions<Bool, TNull>): Chunked<Bool>;
static from<TNull = any>(input: VectorBuilderOptionsAsync<Bool, TNull>): Promise<Chunked<Bool>>;
}

@@ -17,17 +17,10 @@ // Licensed to the Apache Software Foundation (ASF) under one

// under the License.
import { Data } from '../data';
import { Bool } from '../type';
import { Vector } from '../vector';
import { BaseVector } from './base';
import { packBools } from '../util/bit';
import { vectorFromValuesWithType } from './index';
/** @ignore */
export class BoolVector extends BaseVector {
/** @nocollapse */
static from(data) {
let length = 0, bitmap = packBools(function* () {
for (let x of data) {
length++;
yield x;
}
}());
return Vector.new(Data.Bool(new Bool(), 0, length, 0, null, bitmap));
static from(input) {
return vectorFromValuesWithType(() => new Bool(), input);
}

@@ -34,0 +27,0 @@ }

@@ -6,3 +6,3 @@ import { Data } from '../data';

/** @ignore */
declare type ChunkedDict<T extends DataType> = T extends Dictionary ? T['dictionaryVector'] : null | never;
declare type ChunkedDict<T extends DataType> = T extends Dictionary ? Vector<T['dictionary']> : null | never;
/** @ignore */

@@ -30,2 +30,3 @@ declare type ChunkedKeys<T extends DataType> = T extends Dictionary ? Vector<T['indices']> | Chunked<T['indices']> : null | never;

readonly typeId: T['TType'];
readonly VectorName: string;
readonly data: Data<T>;

@@ -35,2 +36,3 @@ readonly ArrayType: any;

readonly stride: number;
readonly byteLength: number;
readonly nullCount: number;

@@ -37,0 +39,0 @@ protected _indices?: ChunkedKeys<T>;

@@ -19,4 +19,4 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { DataType } from '../type';
import { selectChunkArgs } from '../util/args';
import { AbstractVector, Vector } from '../vector';
import { selectChunkArgs } from '../util/args';
/** @ignore */

@@ -46,2 +46,3 @@ export class Chunked extends AbstractVector {

get typeId() { return this._type.typeId; }
get VectorName() { return `Chunked<${this._type}>`; }
get data() {

@@ -53,2 +54,5 @@ return this._chunks[0] ? this._chunks[0].data : null;

get stride() { return this._chunks[0] ? this._chunks[0].stride : 1; }
get byteLength() {
return this._chunks.reduce((byteLength, chunk) => byteLength + chunk.byteLength, 0);
}
get nullCount() {

@@ -75,3 +79,3 @@ let nullCount = this._nullCount;

if (DataType.isDictionary(this._type)) {
return this._type.dictionaryVector;
return this._chunks[this._chunks.length - 1].data.dictionary;
}

@@ -155,3 +159,3 @@ return null;

const n = chunks.length;
let { ArrayType } = this._type;
let ArrayType = this._type.ArrayType;
if (n <= 0) {

@@ -158,0 +162,0 @@ return new ArrayType(0);

@@ -0,10 +1,25 @@

import { DateUnit } from '../enum';
import { Chunked } from './chunked';
import { BaseVector } from './base';
import { VectorType as V } from '../interfaces';
import { VectorBuilderOptions } from './index';
import { VectorBuilderOptionsAsync } from './index';
import { Date_, DateDay, DateMillisecond } from '../type';
/** @ignore */
declare type FromArgs<T extends Date_> = [Iterable<Date>, T['unit']];
/** @ignore */
export declare class DateVector<T extends Date_ = Date_> extends BaseVector<T> {
/** @nocollapse */
static from<T extends Date_ = DateMillisecond>(data: Date[], unit?: T['unit']): DateVector<Date_<import("../type").Dates>>;
static from<T extends DateUnit.DAY>(...args: FromArgs<DateDay>): V<DateDay>;
static from<T extends DateUnit.MILLISECOND>(...args: FromArgs<DateMillisecond>): V<DateMillisecond>;
static from<T extends Date_, TNull = any>(input: Iterable<Date | TNull>): V<T>;
static from<T extends Date_, TNull = any>(input: AsyncIterable<Date | TNull>): Promise<V<T>>;
static from<T extends Date_, TNull = any>(input: VectorBuilderOptions<T, TNull>): Chunked<T>;
static from<T extends Date_, TNull = any>(input: VectorBuilderOptionsAsync<T, TNull>): Promise<Chunked<T>>;
}
/** @ignore */
export declare class DateDayVector extends DateVector<DateDay> {
}
/** @ignore */
export declare class DateMillisecondVector extends DateVector<DateMillisecond> {
}
export {};

@@ -17,26 +17,20 @@ // Licensed to the Apache Software Foundation (ASF) under one

// under the License.
import { Data } from '../data';
import { Vector } from '../vector';
import { DateUnit } from '../enum';
import { BaseVector } from './base';
import * as IntUtil from '../util/int';
import { vectorFromValuesWithType } from './index';
import { DateDay, DateMillisecond } from '../type';
/** @ignore */
export class DateVector extends BaseVector {
/** @nocollapse */
static from(data, unit = DateUnit.MILLISECOND) {
switch (unit) {
case DateUnit.DAY: {
const values = Int32Array.from(data.map((d) => d.valueOf() / 86400000));
return Vector.new(Data.Date(new DateDay(), 0, data.length, 0, null, values));
}
case DateUnit.MILLISECOND: {
const values = IntUtil.Int64.convertArray(data.map((d) => d.valueOf()));
return Vector.new(Data.Date(new DateMillisecond(), 0, data.length, 0, null, values));
}
static from(...args) {
if (args.length === 2) {
return vectorFromValuesWithType(() => args[1] === DateUnit.DAY ? new DateDay() : new DateMillisecond(), args[0]);
}
throw new TypeError(`Unrecognized date unit "${DateUnit[unit]}"`);
return vectorFromValuesWithType(() => new DateMillisecond(), args[0]);
}
}
/** @ignore */
export class DateDayVector extends DateVector {
}
/** @ignore */
export class DateMillisecondVector extends DateVector {

@@ -43,0 +37,0 @@ }

import { Decimal } from '../type';
import { BaseVector } from './base';
/** @ignore */
export declare class DecimalVector extends BaseVector<Decimal> {
}

@@ -18,2 +18,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class DecimalVector extends BaseVector {

@@ -20,0 +21,0 @@ }

import { Data } from '../data';
import { Vector } from '../vector';
import { BaseVector } from './base';
import { Vector as V } from '../interfaces';
import { VectorType as V } from '../interfaces';
import { VectorBuilderOptions } from './index';
import { VectorBuilderOptionsAsync } from './index';
import { DataType, Dictionary, TKeys } from '../type';
/** @ignore */
declare type FromArgs<T extends DataType = any, TKey extends TKeys = TKeys> = [Vector<T>, TKey, ArrayLike<number> | TKey['TArray']];
/** @ignore */
export declare class DictionaryVector<T extends DataType = any, TKey extends TKeys = TKeys> extends BaseVector<Dictionary<T, TKey>> {
/** @nocollapse */
static from<T extends DataType<any>, TKey extends TKeys = TKeys>(values: Vector<T>, indices: TKey, keys: ArrayLike<number> | TKey['TArray']): Dictionary<T, TKey> extends Dictionary<any, TKeys> ? DictionaryVector<T, TKey> : BaseVector<Dictionary<T, TKey>>;
static from<T extends DataType = any, TKey extends TKeys = TKeys>(...args: FromArgs<T, TKey>): V<Dictionary<T, TKey>>;
static from<T extends DataType = any, TKey extends TKeys = TKeys>(input: VectorBuilderOptions<Dictionary<T, TKey>>): Vector<Dictionary<T, TKey>>;
static from<T extends DataType = any, TKey extends TKeys = TKeys>(input: VectorBuilderOptionsAsync<Dictionary<T, TKey>>): Promise<Vector<Dictionary<T, TKey>>>;
constructor(data: Data<Dictionary<T, TKey>>);
readonly indices: V<TKey>;
constructor(data: Data<Dictionary<T, TKey>>);
readonly dictionary: Vector<T>;

@@ -18,1 +24,2 @@ reverseLookup(value: T): number;

}
export {};

@@ -20,3 +20,5 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
import { vectorFromValuesWithType } from './index';
import { Dictionary } from '../type';
/** @ignore */
export class DictionaryVector extends BaseVector {

@@ -28,7 +30,11 @@ constructor(data) {

/** @nocollapse */
static from(values, indices, keys) {
const type = new Dictionary(values.type, indices, null, null, values);
return Vector.new(Data.Dictionary(type, 0, keys.length, 0, null, keys));
static from(...args) {
if (args.length === 3) {
const [values, indices, keys] = args;
const type = new Dictionary(values.type, indices, null, null);
return Vector.new(Data.Dictionary(type, 0, keys.length, 0, null, keys, values));
}
return vectorFromValuesWithType(() => args[0].type, args[0]);
}
get dictionary() { return this.data.type.dictionaryVector; }
get dictionary() { return this.data.dictionary; }
reverseLookup(value) { return this.dictionary.indexOf(value); }

@@ -35,0 +41,0 @@ getKey(idx) { return this.indices.get(idx); }

import { BaseVector } from './base';
import { FixedSizeBinary } from '../type';
/** @ignore */
export declare class FixedSizeBinaryVector extends BaseVector<FixedSizeBinary> {
}

@@ -18,2 +18,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class FixedSizeBinaryVector extends BaseVector {

@@ -20,0 +21,0 @@ }

import { BaseVector } from './base';
import { DataType, FixedSizeList } from '../type';
/** @ignore */
export declare class FixedSizeListVector<T extends DataType = any> extends BaseVector<FixedSizeList<T>> {
}

@@ -18,2 +18,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class FixedSizeListVector extends BaseVector {

@@ -20,0 +21,0 @@ }

import { BaseVector } from './base';
import { Vector as V } from '../interfaces';
import { VectorType as V } from '../interfaces';
import { Float, Float16, Float32, Float64 } from '../type';
/** @ignore */
export declare class FloatVector<T extends Float = Float> extends BaseVector<T> {

@@ -13,2 +14,3 @@ static from(this: typeof FloatVector, data: Float16['TArray']): Float16Vector;

}
/** @ignore */
export declare class Float16Vector extends FloatVector<Float16> {

@@ -18,5 +20,7 @@ toFloat32Array(): Float32Array;

}
/** @ignore */
export declare class Float32Vector extends FloatVector<Float32> {
}
/** @ignore */
export declare class Float64Vector extends FloatVector<Float64> {
}

@@ -22,2 +22,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { toFloat16Array, toFloat32Array, toFloat64Array } from '../util/buffer';
/** @ignore */
export class FloatVector extends BaseVector {

@@ -54,2 +55,3 @@ /** @nocollapse */

}
/** @ignore */
export class Float16Vector extends FloatVector {

@@ -65,4 +67,6 @@ // Since JS doesn't have half floats, `toArray()` returns a zero-copy slice

}
/** @ignore */
export class Float32Vector extends FloatVector {
}
/** @ignore */
export class Float64Vector extends FloatVector {

@@ -69,0 +73,0 @@ }

@@ -24,10 +24,16 @@ export { Row } from './row';

import { Data } from '../data';
import { Vector } from '../vector';
import { DataType } from '../type';
import { Vector as V, VectorCtorArgs } from '../interfaces';
import { IterableBuilderOptions } from '../builder';
import { VectorType as V, VectorCtorArgs } from '../interfaces';
declare module '../vector' {
namespace Vector {
export { newVector as new };
export { vectorFrom as from };
}
}
declare module './base' {
namespace BaseVector {
export { vectorFrom as from };
}
interface BaseVector<T extends DataType> {

@@ -44,1 +50,14 @@ get(index: number): T['TValue'] | null;

declare function newVector<T extends DataType>(data: Data<T>, ...args: VectorCtorArgs<V<T>>): V<T>;
/** @ignore */
export interface VectorBuilderOptions<T extends DataType, TNull = any> extends IterableBuilderOptions<T, TNull> {
values: Iterable<T['TValue'] | TNull>;
}
/** @ignore */
export interface VectorBuilderOptionsAsync<T extends DataType, TNull = any> extends IterableBuilderOptions<T, TNull> {
values: AsyncIterable<T['TValue'] | TNull>;
}
/** @ignore */
export declare function vectorFromValuesWithType<T extends DataType, TNull = any>(newDataType: () => T, input: Iterable<T['TValue'] | TNull> | AsyncIterable<T['TValue'] | TNull> | VectorBuilderOptions<T, TNull> | VectorBuilderOptionsAsync<T, TNull>): V<T> | Vector<T> | Promise<V<T>> | Promise<Vector<T>>;
/** @ignore */
declare function vectorFrom<T extends DataType = any, TNull = any>(input: VectorBuilderOptions<T, TNull>): Vector<T>;
declare function vectorFrom<T extends DataType = any, TNull = any>(input: VectorBuilderOptionsAsync<T, TNull>): Promise<Vector<T>>;

@@ -17,2 +17,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

// under the License.
import * as tslib_1 from "tslib";
export { Row } from './row';

@@ -40,6 +41,10 @@ export { Vector } from '../vector';

export { Utf8Vector } from './utf8';
import * as fn from '../util/fn';
import { Type } from '../enum';
import { Vector } from '../vector';
import { Chunked } from './chunked';
import { BaseVector } from './base';
import { setBool } from '../util/bit';
import { isIterable, isAsyncIterable } from '../util/compat';
import { Builder } from '../builder';
import { instance as getVisitor } from '../visitor/get';

@@ -54,6 +59,46 @@ import { instance as setVisitor } from '../visitor/set';

Vector.new = newVector;
/** @nocollapse */
Vector.from = vectorFrom;
/** @ignore */
function newVector(data, ...args) {
return new (getVectorConstructor.getVisitFn(data.type)())(data, ...args);
return new (getVectorConstructor.getVisitFn(data)())(data, ...args);
}
/** @ignore */
export function vectorFromValuesWithType(newDataType, input) {
if (isIterable(input)) {
return Vector.from({ 'nullValues': [null, undefined], type: newDataType(), 'values': input });
}
else if (isAsyncIterable(input)) {
return Vector.from({ 'nullValues': [null, undefined], type: newDataType(), 'values': input });
}
const { 'values': values = [], 'type': type = newDataType(), 'nullValues': nullValues = [null, undefined], } = Object.assign({}, input);
return isIterable(values)
? Vector.from(Object.assign({ nullValues }, input, { type }))
: Vector.from(Object.assign({ nullValues }, input, { type }));
}
function vectorFrom(input) {
const _a = Object.assign({ 'nullValues': [null, undefined] }, input), { 'values': values = [] } = _a, options = tslib_1.__rest(_a, ['values']);
if (isIterable(values)) {
const chunks = [...Builder.throughIterable(options)(values)];
return chunks.length === 1 ? chunks[0] : Chunked.concat(chunks);
}
return ((chunks) => tslib_1.__awaiter(this, void 0, void 0, function* () {
var e_1, _b;
const transform = Builder.throughAsyncIterable(options);
try {
for (var _c = tslib_1.__asyncValues(transform(values)), _d; _d = yield _c.next(), !_d.done;) {
const chunk = _d.value;
chunks.push(chunk);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_d && !_d.done && (_b = _c.return)) yield _b.call(_c);
}
finally { if (e_1) throw e_1.error; }
}
return chunks.length === 1 ? chunks[0] : Chunked.concat(chunks);
}))([]);
}
//

@@ -87,47 +132,15 @@ // We provide the following method implementations for code navigability purposes only.

Object.keys(Type)
.filter((typeId) => typeId !== Type.NONE && typeId !== Type[Type.NONE])
.map((T) => Type[T]).filter((T) => typeof T === 'number')
.map((T) => Type[T])
.filter((T) => typeof T === 'number')
.filter((typeId) => typeId !== Type.NONE)
.forEach((typeId) => {
let typeIds;
switch (typeId) {
case Type.Int:
typeIds = [Type.Int8, Type.Int16, Type.Int32, Type.Int64, Type.Uint8, Type.Uint16, Type.Uint32, Type.Uint64];
break;
case Type.Float:
typeIds = [Type.Float16, Type.Float32, Type.Float64];
break;
case Type.Date:
typeIds = [Type.DateDay, Type.DateMillisecond];
break;
case Type.Time:
typeIds = [Type.TimeSecond, Type.TimeMillisecond, Type.TimeMicrosecond, Type.TimeNanosecond];
break;
case Type.Timestamp:
typeIds = [Type.TimestampSecond, Type.TimestampMillisecond, Type.TimestampMicrosecond, Type.TimestampNanosecond];
break;
case Type.Interval:
typeIds = [Type.IntervalDayTime, Type.IntervalYearMonth];
break;
case Type.Union:
typeIds = [Type.DenseUnion, Type.SparseUnion];
break;
default:
typeIds = [typeId];
break;
}
typeIds.forEach((typeId) => {
const VectorCtor = getVectorConstructor.visit(typeId);
VectorCtor.prototype['get'] = partial1(getVisitor.getVisitFn(typeId));
VectorCtor.prototype['set'] = partial2(setVisitor.getVisitFn(typeId));
VectorCtor.prototype['indexOf'] = partial2(indexOfVisitor.getVisitFn(typeId));
VectorCtor.prototype['toArray'] = partial0(toArrayVisitor.getVisitFn(typeId));
VectorCtor.prototype['getByteWidth'] = partialType0(byteWidthVisitor.getVisitFn(typeId));
VectorCtor.prototype[Symbol.iterator] = partial0(iteratorVisitor.getVisitFn(typeId));
});
const VectorCtor = getVectorConstructor.visit(typeId);
VectorCtor.prototype['get'] = fn.partial1(getVisitor.getVisitFn(typeId));
VectorCtor.prototype['set'] = fn.partial2(setVisitor.getVisitFn(typeId));
VectorCtor.prototype['indexOf'] = fn.partial2(indexOfVisitor.getVisitFn(typeId));
VectorCtor.prototype['toArray'] = fn.partial0(toArrayVisitor.getVisitFn(typeId));
VectorCtor.prototype['getByteWidth'] = partialType0(byteWidthVisitor.getVisitFn(typeId));
VectorCtor.prototype[Symbol.iterator] = fn.partial0(iteratorVisitor.getVisitFn(typeId));
});
/** @ignore */
function partial0(visit) {
return function () { return visit(this); };
}
/** @ignore */
function partialType0(visit) {

@@ -137,10 +150,2 @@ return function () { return visit(this.type); };

/** @ignore */
function partial1(visit) {
return function (a) { return visit(this, a); };
}
/** @ignore */
function partial2(visit) {
return function (a, b) { return visit(this, a, b); };
}
/** @ignore */
function wrapNullableGet(fn) {

@@ -147,0 +152,0 @@ return function (i) { return this.isValid(i) ? fn.call(this, i) : null; };

import { BaseVector } from './base';
import { Vector as V } from '../interfaces';
import { VectorType as V } from '../interfaces';
import { Int, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64 } from '../type';
/** @ignore */
export declare class IntVector<T extends Int = Int> extends BaseVector<T> {

@@ -23,25 +24,31 @@ static from(this: typeof IntVector, data: Int8Array): Int8Vector;

}
/** @ignore */
export declare class Int8Vector extends IntVector<Int8> {
}
/** @ignore */
export declare class Int16Vector extends IntVector<Int16> {
}
/** @ignore */
export declare class Int32Vector extends IntVector<Int32> {
}
/** @ignore */
export declare class Int64Vector extends IntVector<Int64> {
toBigInt64Array(): BigInt64Array;
private _values64;
readonly values64: BigInt64Array;
}
/** @ignore */
export declare class Uint8Vector extends IntVector<Uint8> {
}
/** @ignore */
export declare class Uint16Vector extends IntVector<Uint16> {
}
/** @ignore */
export declare class Uint32Vector extends IntVector<Uint32> {
}
/** @ignore */
export declare class Uint64Vector extends IntVector<Uint64> {
toBigUint64Array(): BigUint64Array;
private _values64;
readonly values64: BigUint64Array;
}
export interface Int64Vector extends IntVector<Int64> {
indexOf(value: Int64['TValue'] | bigint | null, fromIndex?: number): number;
}
export interface Uint64Vector extends IntVector<Uint64> {
indexOf(value: Uint64['TValue'] | bigint | null, fromIndex?: number): number;
}

@@ -22,2 +22,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { toInt8Array, toInt16Array, toInt32Array, toUint8Array, toUint16Array, toUint32Array, toBigInt64Array, toBigUint64Array } from '../util/buffer';
/** @ignore */
export class IntVector extends BaseVector {

@@ -94,8 +95,12 @@ /** @nocollapse */

}
/** @ignore */
export class Int8Vector extends IntVector {
}
/** @ignore */
export class Int16Vector extends IntVector {
}
/** @ignore */
export class Int32Vector extends IntVector {
}
/** @ignore */
export class Int64Vector extends IntVector {

@@ -105,9 +110,16 @@ toBigInt64Array() {

}
get values64() {
return this._values64 || (this._values64 = this.toBigInt64Array());
}
}
/** @ignore */
export class Uint8Vector extends IntVector {
}
/** @ignore */
export class Uint16Vector extends IntVector {
}
/** @ignore */
export class Uint32Vector extends IntVector {
}
/** @ignore */
export class Uint64Vector extends IntVector {

@@ -117,4 +129,7 @@ toBigUint64Array() {

}
get values64() {
return this._values64 || (this._values64 = this.toBigUint64Array());
}
}
//# sourceMappingURL=int.mjs.map
import { BaseVector } from './base';
import { Interval, IntervalDayTime, IntervalYearMonth } from '../type';
/** @ignore */
export declare class IntervalVector<T extends Interval = Interval> extends BaseVector<T> {
}
/** @ignore */
export declare class IntervalDayTimeVector extends IntervalVector<IntervalDayTime> {
}
/** @ignore */
export declare class IntervalYearMonthVector extends IntervalVector<IntervalYearMonth> {
}

@@ -18,6 +18,9 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class IntervalVector extends BaseVector {
}
/** @ignore */
export class IntervalDayTimeVector extends IntervalVector {
}
/** @ignore */
export class IntervalYearMonthVector extends IntervalVector {

@@ -24,0 +27,0 @@ }

import { BaseVector } from './base';
import { DataType, List } from '../type';
/** @ignore */
export declare class ListVector<T extends DataType = any> extends BaseVector<List<T>> {
}

@@ -18,2 +18,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class ListVector extends BaseVector {

@@ -20,0 +21,0 @@ }

import { BaseVector } from './base';
import { RowProxyGenerator } from './row';
import { DataType, Map_ } from '../type';
/** @ignore */
export declare class MapVector<T extends {

@@ -5,0 +6,0 @@ [key: string]: DataType;

@@ -21,2 +21,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Struct } from '../type';
/** @ignore */
export class MapVector extends BaseVector {

@@ -23,0 +24,0 @@ asStruct() {

import { Null } from '../type';
import { BaseVector } from './base';
/** @ignore */
export declare class NullVector extends BaseVector<Null> {
}

@@ -18,2 +18,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class NullVector extends BaseVector {

@@ -20,0 +21,0 @@ }

@@ -8,2 +8,3 @@ import { Field } from '../schema';

/** @ignore */ export declare const kRowIndex: unique symbol;
/** @ignore */
export declare class Row<T extends {

@@ -19,3 +20,4 @@ [key: string]: DataType;

toJSON(): any;
toString(): any;
inspect(): string;
toString(): string;
}

@@ -33,3 +35,3 @@ /** @ignore */

private _bindGetter;
bind(rowIndex: number): any;
bind(rowIndex: number): Row<T>;
}

@@ -26,2 +26,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

/** @ignore */ const rowParentDescriptor = { writable: false, enumerable: false, configurable: false, value: null };
/** @ignore */
export class Row {

@@ -33,15 +34,19 @@ *[Symbol.iterator]() {

}
get(key) { return this[key]; }
get(key) {
return this[key];
}
toJSON() {
return DataType.isStruct(this[kParent].type) ? [...this] :
Object.getOwnPropertyNames(this).reduce((props, prop) => {
return (props[prop] = this[prop]) && props || props;
this[kParent].type.children.reduce((props, { name }) => {
return (props[name] = this[name]) && props || props;
}, {});
}
inspect() { return this.toString(); }
[Symbol.for('nodejs.util.inspect.custom')]() { return this.toString(); }
toString() {
return DataType.isStruct(this[kParent].type) ?
[...this].map((x) => valueToString(x)).join(', ') :
Object.getOwnPropertyNames(this).reduce((props, prop) => {
return (props[prop] = valueToString(this[prop])) && props || props;
}, {});
`[ ${[...this].map((x) => valueToString(x)).join(', ')} ]` :
`{ ${this[kParent].type.children.reduce((xs, { name }) => {
return [...xs, `"${name}": ${valueToString(this[name])}`];
}, []).join(', ')} }`;
}

@@ -48,0 +53,0 @@ }

import { BaseVector } from './base';
import { RowProxyGenerator } from './row';
import { DataType, Struct } from '../type';
/** @ignore */
export declare class StructVector<T extends {

@@ -5,0 +6,0 @@ [key: string]: DataType;

@@ -21,2 +21,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Map_ } from '../type';
/** @ignore */
export class StructVector extends BaseVector {

@@ -23,0 +24,0 @@ asMap(keysSorted = false) {

import { BaseVector } from './base';
import { Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond } from '../type';
/** @ignore */
export declare class TimeVector<T extends Time = Time> extends BaseVector<T> {
}
/** @ignore */
export declare class TimeSecondVector extends TimeVector<TimeSecond> {
}
/** @ignore */
export declare class TimeMillisecondVector extends TimeVector<TimeMillisecond> {
}
/** @ignore */
export declare class TimeMicrosecondVector extends TimeVector<TimeMicrosecond> {
}
/** @ignore */
export declare class TimeNanosecondVector extends TimeVector<TimeNanosecond> {
}

@@ -18,10 +18,15 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class TimeVector extends BaseVector {
}
/** @ignore */
export class TimeSecondVector extends TimeVector {
}
/** @ignore */
export class TimeMillisecondVector extends TimeVector {
}
/** @ignore */
export class TimeMicrosecondVector extends TimeVector {
}
/** @ignore */
export class TimeNanosecondVector extends TimeVector {

@@ -28,0 +33,0 @@ }

import { BaseVector } from './base';
import { Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond } from '../type';
/** @ignore */
export declare class TimestampVector<T extends Timestamp = Timestamp> extends BaseVector<T> {
}
/** @ignore */
export declare class TimestampSecondVector extends TimestampVector<TimestampSecond> {
}
/** @ignore */
export declare class TimestampMillisecondVector extends TimestampVector<TimestampMillisecond> {
}
/** @ignore */
export declare class TimestampMicrosecondVector extends TimestampVector<TimestampMicrosecond> {
}
/** @ignore */
export declare class TimestampNanosecondVector extends TimestampVector<TimestampNanosecond> {
}

@@ -18,10 +18,15 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class TimestampVector extends BaseVector {
}
/** @ignore */
export class TimestampSecondVector extends TimestampVector {
}
/** @ignore */
export class TimestampMillisecondVector extends TimestampVector {
}
/** @ignore */
export class TimestampMicrosecondVector extends TimestampVector {
}
/** @ignore */
export class TimestampNanosecondVector extends TimestampVector {

@@ -28,0 +33,0 @@ }

import { BaseVector } from './base';
import { Union, DenseUnion, SparseUnion } from '../type';
/** @ignore */
export declare class UnionVector<T extends Union = Union> extends BaseVector<T> {

@@ -8,6 +9,8 @@ readonly typeIdToChildIndex: {

}
/** @ignore */
export declare class DenseUnionVector extends UnionVector<DenseUnion> {
readonly valueOffsets: Int32Array;
}
/** @ignore */
export declare class SparseUnionVector extends UnionVector<SparseUnion> {
}

@@ -18,8 +18,11 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { BaseVector } from './base';
/** @ignore */
export class UnionVector extends BaseVector {
get typeIdToChildIndex() { return this.type.typeIdToChildIndex; }
get typeIdToChildIndex() { return this.data.type.typeIdToChildIndex; }
}
/** @ignore */
export class DenseUnionVector extends UnionVector {
get valueOffsets() { return this.data.valueOffsets; }
}
/** @ignore */
export class SparseUnionVector extends UnionVector {

@@ -26,0 +29,0 @@ }

@@ -0,7 +1,13 @@

import { Chunked } from './chunked';
import { BaseVector } from './base';
import { Utf8 } from '../type';
import { VectorBuilderOptions } from './index';
import { VectorBuilderOptionsAsync } from './index';
/** @ignore */
export declare class Utf8Vector extends BaseVector<Utf8> {
/** @nocollapse */
static from(values: string[]): Utf8Vector;
static from<TNull = any>(input: Iterable<string | TNull>): Utf8Vector;
static from<TNull = any>(input: AsyncIterable<string | TNull>): Promise<Utf8Vector>;
static from<TNull = any>(input: VectorBuilderOptions<Utf8, TNull>): Chunked<Utf8>;
static from<TNull = any>(input: VectorBuilderOptionsAsync<Utf8, TNull>): Promise<Chunked<Utf8>>;
asBinary(): import("./binary").BinaryVector;
}

@@ -17,14 +17,11 @@ // Licensed to the Apache Software Foundation (ASF) under one

// under the License.
import { Data } from '../data';
import { Vector } from '../vector';
import { BaseVector } from './base';
import { Binary, Utf8 } from '../type';
import { encodeUtf8 } from '../util/utf8';
import { vectorFromValuesWithType } from './index';
/** @ignore */
export class Utf8Vector extends BaseVector {
/** @nocollapse */
static from(values) {
const length = values.length;
const data = encodeUtf8(values.join(''));
const offsets = values.reduce((offsets, str, idx) => ((!(offsets[idx + 1] = offsets[idx] + str.length) || true) && offsets), new Uint32Array(values.length + 1));
return Vector.new(Data.Utf8(new Utf8(), 0, length, 0, null, offsets, data));
static from(input) {
return vectorFromValuesWithType(() => new Utf8(), input);
}

@@ -31,0 +28,0 @@ asBinary() {

import { Data } from '../data';
import { Visitor } from '../visitor';
import { Vector } from '../interfaces';
import { VectorType } from '../interfaces';
import { Type } from '../enum';
import { Schema, Field } from '../schema';
import { DataType, Dictionary, Float, Int, Date_, Interval, Time, Timestamp, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Union } from '../type';
/** @ignore */
export interface ByteWidthVisitor extends Visitor {

@@ -11,4 +12,5 @@ visit<T extends DataType>(node: T): number;

getVisitFn<T extends Type>(node: T): (type: DataType<T>) => number;
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): (type: T) => number;
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): (type: T) => number;
}
/** @ignore */
export declare class ByteWidthVisitor extends Visitor {

@@ -15,0 +17,0 @@ visitNull(____: Null): number;

@@ -6,2 +6,3 @@ /* istanbul ignore file */

/** @ignore */ const variableWidthColumnErrorMessage = (type) => `Cannot compute the byte width of variable-width column ${type}`;
/** @ignore */
export class ByteWidthVisitor extends Visitor {

@@ -8,0 +9,0 @@ visitNull(____) { return 0; }

import { Data } from '../data';
import { Visitor } from '../visitor';
import { Vector } from '../interfaces';
import { VectorType } from '../interfaces';
import { Type } from '../enum';
import { DataType, Dictionary, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Float, Float16, Float32, Float64, Int, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64, Date_, DateDay, DateMillisecond, Interval, IntervalDayTime, IntervalYearMonth, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Union, DenseUnion, SparseUnion } from '../type';
/** @ignore */
export interface GetVisitor extends Visitor {
visit<T extends Vector>(node: T, index: number): T['TValue'];
visitMany<T extends Vector>(nodes: T[], indices: number[]): T['TValue'][];
getVisitFn<T extends Type>(node: T): (vector: Vector<T>, index: number) => Vector<T>['TValue'];
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): (vector: Vector<T>, index: number) => Vector<T>['TValue'];
visitNull<T extends Null>(vector: Vector<T>, index: number): T['TValue'];
visitBool<T extends Bool>(vector: Vector<T>, index: number): T['TValue'];
visitInt<T extends Int>(vector: Vector<T>, index: number): T['TValue'];
visitInt8<T extends Int8>(vector: Vector<T>, index: number): T['TValue'];
visitInt16<T extends Int16>(vector: Vector<T>, index: number): T['TValue'];
visitInt32<T extends Int32>(vector: Vector<T>, index: number): T['TValue'];
visitInt64<T extends Int64>(vector: Vector<T>, index: number): T['TValue'];
visitUint8<T extends Uint8>(vector: Vector<T>, index: number): T['TValue'];
visitUint16<T extends Uint16>(vector: Vector<T>, index: number): T['TValue'];
visitUint32<T extends Uint32>(vector: Vector<T>, index: number): T['TValue'];
visitUint64<T extends Uint64>(vector: Vector<T>, index: number): T['TValue'];
visitFloat<T extends Float>(vector: Vector<T>, index: number): T['TValue'];
visitFloat16<T extends Float16>(vector: Vector<T>, index: number): T['TValue'];
visitFloat32<T extends Float32>(vector: Vector<T>, index: number): T['TValue'];
visitFloat64<T extends Float64>(vector: Vector<T>, index: number): T['TValue'];
visitUtf8<T extends Utf8>(vector: Vector<T>, index: number): T['TValue'];
visitBinary<T extends Binary>(vector: Vector<T>, index: number): T['TValue'];
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: Vector<T>, index: number): T['TValue'];
visitDate<T extends Date_>(vector: Vector<T>, index: number): T['TValue'];
visitDateDay<T extends DateDay>(vector: Vector<T>, index: number): T['TValue'];
visitDateMillisecond<T extends DateMillisecond>(vector: Vector<T>, index: number): T['TValue'];
visitTimestamp<T extends Timestamp>(vector: Vector<T>, index: number): T['TValue'];
visitTimestampSecond<T extends TimestampSecond>(vector: Vector<T>, index: number): T['TValue'];
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: Vector<T>, index: number): T['TValue'];
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: Vector<T>, index: number): T['TValue'];
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: Vector<T>, index: number): T['TValue'];
visitTime<T extends Time>(vector: Vector<T>, index: number): T['TValue'];
visitTimeSecond<T extends TimeSecond>(vector: Vector<T>, index: number): T['TValue'];
visitTimeMillisecond<T extends TimeMillisecond>(vector: Vector<T>, index: number): T['TValue'];
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: Vector<T>, index: number): T['TValue'];
visitTimeNanosecond<T extends TimeNanosecond>(vector: Vector<T>, index: number): T['TValue'];
visitDecimal<T extends Decimal>(vector: Vector<T>, index: number): T['TValue'];
visitList<T extends List>(vector: Vector<T>, index: number): T['TValue'];
visitStruct<T extends Struct>(vector: Vector<T>, index: number): T['TValue'];
visitUnion<T extends Union>(vector: Vector<T>, index: number): T['TValue'];
visitDenseUnion<T extends DenseUnion>(vector: Vector<T>, index: number): T['TValue'];
visitSparseUnion<T extends SparseUnion>(vector: Vector<T>, index: number): T['TValue'];
visitDictionary<T extends Dictionary>(vector: Vector<T>, index: number): T['TValue'];
visitInterval<T extends Interval>(vector: Vector<T>, index: number): T['TValue'];
visitIntervalDayTime<T extends IntervalDayTime>(vector: Vector<T>, index: number): T['TValue'];
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: Vector<T>, index: number): T['TValue'];
visitFixedSizeList<T extends FixedSizeList>(vector: Vector<T>, index: number): T['TValue'];
visitMap<T extends Map_>(vector: Vector<T>, index: number): T['TValue'];
visit<T extends VectorType>(node: T, index: number): T['TValue'];
visitMany<T extends VectorType>(nodes: T[], indices: number[]): T['TValue'][];
getVisitFn<T extends Type>(node: T): (vector: VectorType<T>, index: number) => VectorType<T>['TValue'];
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): (vector: VectorType<T>, index: number) => VectorType<T>['TValue'];
visitNull<T extends Null>(vector: VectorType<T>, index: number): T['TValue'];
visitBool<T extends Bool>(vector: VectorType<T>, index: number): T['TValue'];
visitInt<T extends Int>(vector: VectorType<T>, index: number): T['TValue'];
visitInt8<T extends Int8>(vector: VectorType<T>, index: number): T['TValue'];
visitInt16<T extends Int16>(vector: VectorType<T>, index: number): T['TValue'];
visitInt32<T extends Int32>(vector: VectorType<T>, index: number): T['TValue'];
visitInt64<T extends Int64>(vector: VectorType<T>, index: number): T['TValue'];
visitUint8<T extends Uint8>(vector: VectorType<T>, index: number): T['TValue'];
visitUint16<T extends Uint16>(vector: VectorType<T>, index: number): T['TValue'];
visitUint32<T extends Uint32>(vector: VectorType<T>, index: number): T['TValue'];
visitUint64<T extends Uint64>(vector: VectorType<T>, index: number): T['TValue'];
visitFloat<T extends Float>(vector: VectorType<T>, index: number): T['TValue'];
visitFloat16<T extends Float16>(vector: VectorType<T>, index: number): T['TValue'];
visitFloat32<T extends Float32>(vector: VectorType<T>, index: number): T['TValue'];
visitFloat64<T extends Float64>(vector: VectorType<T>, index: number): T['TValue'];
visitUtf8<T extends Utf8>(vector: VectorType<T>, index: number): T['TValue'];
visitBinary<T extends Binary>(vector: VectorType<T>, index: number): T['TValue'];
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: VectorType<T>, index: number): T['TValue'];
visitDate<T extends Date_>(vector: VectorType<T>, index: number): T['TValue'];
visitDateDay<T extends DateDay>(vector: VectorType<T>, index: number): T['TValue'];
visitDateMillisecond<T extends DateMillisecond>(vector: VectorType<T>, index: number): T['TValue'];
visitTimestamp<T extends Timestamp>(vector: VectorType<T>, index: number): T['TValue'];
visitTimestampSecond<T extends TimestampSecond>(vector: VectorType<T>, index: number): T['TValue'];
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: VectorType<T>, index: number): T['TValue'];
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: VectorType<T>, index: number): T['TValue'];
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: VectorType<T>, index: number): T['TValue'];
visitTime<T extends Time>(vector: VectorType<T>, index: number): T['TValue'];
visitTimeSecond<T extends TimeSecond>(vector: VectorType<T>, index: number): T['TValue'];
visitTimeMillisecond<T extends TimeMillisecond>(vector: VectorType<T>, index: number): T['TValue'];
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: VectorType<T>, index: number): T['TValue'];
visitTimeNanosecond<T extends TimeNanosecond>(vector: VectorType<T>, index: number): T['TValue'];
visitDecimal<T extends Decimal>(vector: VectorType<T>, index: number): T['TValue'];
visitList<T extends List>(vector: VectorType<T>, index: number): T['TValue'];
visitStruct<T extends Struct>(vector: VectorType<T>, index: number): T['TValue'];
visitUnion<T extends Union>(vector: VectorType<T>, index: number): T['TValue'];
visitDenseUnion<T extends DenseUnion>(vector: VectorType<T>, index: number): T['TValue'];
visitSparseUnion<T extends SparseUnion>(vector: VectorType<T>, index: number): T['TValue'];
visitDictionary<T extends Dictionary>(vector: VectorType<T>, index: number): T['TValue'];
visitInterval<T extends Interval>(vector: VectorType<T>, index: number): T['TValue'];
visitIntervalDayTime<T extends IntervalDayTime>(vector: VectorType<T>, index: number): T['TValue'];
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: VectorType<T>, index: number): T['TValue'];
visitFixedSizeList<T extends FixedSizeList>(vector: VectorType<T>, index: number): T['TValue'];
visitMap<T extends Map_>(vector: VectorType<T>, index: number): T['TValue'];
}
/** @ignore */
export declare class GetVisitor extends Visitor {

@@ -56,0 +58,0 @@ }

@@ -21,2 +21,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { UnionMode, Precision, DateUnit, TimeUnit, IntervalUnit } from '../enum';
/** @ignore */
export class GetVisitor extends Visitor {

@@ -101,5 +102,5 @@ }

/** @ignore */
const getTimeMicrosecond = ({ values }, index) => BN.new(values.subarray(2 * index, 2 * (index + 1)), true);
const getTimeMicrosecond = ({ values }, index) => BN.signed(values.subarray(2 * index, 2 * (index + 1)));
/** @ignore */
const getTimeNanosecond = ({ values }, index) => BN.new(values.subarray(2 * index, 2 * (index + 1)), true);
const getTimeNanosecond = ({ values }, index) => BN.signed(values.subarray(2 * index, 2 * (index + 1)));
/* istanbul ignore next */

@@ -116,3 +117,3 @@ /** @ignore */

/** @ignore */
const getDecimal = ({ values }, index) => BN.new(values.subarray(4 * index, 4 * (index + 1)), false);
const getDecimal = ({ values }, index) => BN.decimal(values.subarray(4 * index, 4 * (index + 1)));
/** @ignore */

@@ -136,4 +137,4 @@ const getList = (vector, index) => {

const getDenseUnion = (vector, index) => {
const { typeIds, type: { typeIdToChildIndex } } = vector;
const child = vector.getChildAt(typeIdToChildIndex[typeIds[index]]);
const childIndex = vector.typeIdToChildIndex[vector.typeIds[index]];
const child = vector.getChildAt(childIndex);
return child ? child.get(vector.valueOffsets[index]) : null;

@@ -143,4 +144,4 @@ };

const getSparseUnion = (vector, index) => {
const { typeIds, type: { typeIdToChildIndex } } = vector;
const child = vector.getChildAt(typeIdToChildIndex[typeIds[index]]);
const childIndex = vector.typeIdToChildIndex[vector.typeIds[index]];
const child = vector.getChildAt(childIndex);
return child ? child.get(index) : null;

@@ -147,0 +148,0 @@ };

import { Data } from '../data';
import { Type } from '../enum';
import { Visitor } from '../visitor';
import { Vector } from '../interfaces';
import { VectorType } from '../interfaces';
import { DataType, Dictionary, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Float, Float16, Float32, Float64, Int, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64, Date_, DateDay, DateMillisecond, Interval, IntervalDayTime, IntervalYearMonth, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Union, DenseUnion, SparseUnion } from '../type';
/** @ignore */
export interface IndexOfVisitor extends Visitor {
visit<T extends Vector>(node: T, value: T['TValue'] | null, index?: number): number;
visitMany<T extends Vector>(nodes: T[], values: (T['TValue'] | null)[], indices: (number | undefined)[]): number[];
getVisitFn<T extends Type>(node: T): (vector: Vector<T>, value: Vector<T>['TValue'] | null, index?: number) => number;
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): (vector: Vector<T>, value: T['TValue'] | null, index?: number) => number;
visitNull<T extends Null>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitBool<T extends Bool>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitInt<T extends Int>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitInt8<T extends Int8>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitInt16<T extends Int16>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitInt32<T extends Int32>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitInt64<T extends Int64>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitUint8<T extends Uint8>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitUint16<T extends Uint16>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitUint32<T extends Uint32>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitUint64<T extends Uint64>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitFloat<T extends Float>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitFloat16<T extends Float16>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitFloat32<T extends Float32>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitFloat64<T extends Float64>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitUtf8<T extends Utf8>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitBinary<T extends Binary>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitDate<T extends Date_>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitDateDay<T extends DateDay>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitDateMillisecond<T extends DateMillisecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimestamp<T extends Timestamp>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimestampSecond<T extends TimestampSecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTime<T extends Time>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimeSecond<T extends TimeSecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimeMillisecond<T extends TimeMillisecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitTimeNanosecond<T extends TimeNanosecond>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitDecimal<T extends Decimal>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitList<T extends List>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitStruct<T extends Struct>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitUnion<T extends Union>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitDenseUnion<T extends DenseUnion>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitSparseUnion<T extends SparseUnion>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitDictionary<T extends Dictionary>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitInterval<T extends Interval>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitIntervalDayTime<T extends IntervalDayTime>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitFixedSizeList<T extends FixedSizeList>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visitMap<T extends Map_>(vector: Vector<T>, value: T['TValue'] | null, index?: number): number;
visit<T extends VectorType>(node: T, value: T['TValue'] | null, index?: number): number;
visitMany<T extends VectorType>(nodes: T[], values: (T['TValue'] | null)[], indices: (number | undefined)[]): number[];
getVisitFn<T extends Type>(node: T): (vector: VectorType<T>, value: VectorType<T>['TValue'] | null, index?: number) => number;
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): (vector: VectorType<T>, value: T['TValue'] | null, index?: number) => number;
visitNull<T extends Null>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitBool<T extends Bool>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitInt<T extends Int>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitInt8<T extends Int8>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitInt16<T extends Int16>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitInt32<T extends Int32>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitInt64<T extends Int64>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitUint8<T extends Uint8>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitUint16<T extends Uint16>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitUint32<T extends Uint32>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitUint64<T extends Uint64>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitFloat<T extends Float>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitFloat16<T extends Float16>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitFloat32<T extends Float32>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitFloat64<T extends Float64>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitUtf8<T extends Utf8>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitBinary<T extends Binary>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitDate<T extends Date_>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitDateDay<T extends DateDay>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitDateMillisecond<T extends DateMillisecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimestamp<T extends Timestamp>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimestampSecond<T extends TimestampSecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTime<T extends Time>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimeSecond<T extends TimeSecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimeMillisecond<T extends TimeMillisecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitTimeNanosecond<T extends TimeNanosecond>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitDecimal<T extends Decimal>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitList<T extends List>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitStruct<T extends Struct>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitUnion<T extends Union>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitDenseUnion<T extends DenseUnion>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitSparseUnion<T extends SparseUnion>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitDictionary<T extends Dictionary>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitInterval<T extends Interval>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitIntervalDayTime<T extends IntervalDayTime>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitFixedSizeList<T extends FixedSizeList>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
visitMap<T extends Map_>(vector: VectorType<T>, value: T['TValue'] | null, index?: number): number;
}
/** @ignore */
export declare class IndexOfVisitor extends Visitor {

@@ -56,0 +58,0 @@ }

@@ -20,2 +20,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { createElementComparator } from '../util/vector';
/** @ignore */
export class IndexOfVisitor extends Visitor {

@@ -22,0 +23,0 @@ }

import { Data } from '../data';
import { Type } from '../enum';
import { Visitor } from '../visitor';
import { Vector } from '../interfaces';
import { VectorType } from '../interfaces';
import { DataType, Dictionary, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Float, Float16, Float32, Float64, Int, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64, Date_, DateDay, DateMillisecond, Interval, IntervalDayTime, IntervalYearMonth, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Union, DenseUnion, SparseUnion } from '../type';
/** @ignore */
export interface IteratorVisitor extends Visitor {
visit<T extends Vector>(node: T): IterableIterator<T['TValue'] | null>;
visitMany<T extends Vector>(nodes: T[]): IterableIterator<T['TValue'] | null>[];
getVisitFn<T extends Type>(node: T): (vector: Vector<T>) => IterableIterator<Vector<T>['TValue'] | null>;
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): (vector: Vector<T>) => IterableIterator<Vector<T>['TValue'] | null>;
visitNull<T extends Null>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitBool<T extends Bool>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitInt<T extends Int>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitInt8<T extends Int8>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitInt16<T extends Int16>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitInt32<T extends Int32>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitInt64<T extends Int64>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitUint8<T extends Uint8>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitUint16<T extends Uint16>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitUint32<T extends Uint32>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitUint64<T extends Uint64>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitFloat<T extends Float>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitFloat16<T extends Float16>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitFloat32<T extends Float32>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitFloat64<T extends Float64>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitUtf8<T extends Utf8>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitBinary<T extends Binary>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitDate<T extends Date_>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitDateDay<T extends DateDay>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitDateMillisecond<T extends DateMillisecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimestamp<T extends Timestamp>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimestampSecond<T extends TimestampSecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTime<T extends Time>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimeSecond<T extends TimeSecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimeMillisecond<T extends TimeMillisecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitTimeNanosecond<T extends TimeNanosecond>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitDecimal<T extends Decimal>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitList<T extends List>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitStruct<T extends Struct>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitUnion<T extends Union>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitDenseUnion<T extends DenseUnion>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitSparseUnion<T extends SparseUnion>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitDictionary<T extends Dictionary>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitInterval<T extends Interval>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitIntervalDayTime<T extends IntervalDayTime>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitFixedSizeList<T extends FixedSizeList>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visitMap<T extends Map_>(vector: Vector<T>): IterableIterator<T['TValue'] | null>;
visit<T extends VectorType>(node: T): IterableIterator<T['TValue'] | null>;
visitMany<T extends VectorType>(nodes: T[]): IterableIterator<T['TValue'] | null>[];
getVisitFn<T extends Type>(node: T): (vector: VectorType<T>) => IterableIterator<VectorType<T>['TValue'] | null>;
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): (vector: VectorType<T>) => IterableIterator<VectorType<T>['TValue'] | null>;
visitNull<T extends Null>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitBool<T extends Bool>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitInt<T extends Int>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitInt8<T extends Int8>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitInt16<T extends Int16>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitInt32<T extends Int32>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitInt64<T extends Int64>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitUint8<T extends Uint8>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitUint16<T extends Uint16>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitUint32<T extends Uint32>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitUint64<T extends Uint64>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitFloat<T extends Float>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitFloat16<T extends Float16>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitFloat32<T extends Float32>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitFloat64<T extends Float64>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitUtf8<T extends Utf8>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitBinary<T extends Binary>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitDate<T extends Date_>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitDateDay<T extends DateDay>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitDateMillisecond<T extends DateMillisecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimestamp<T extends Timestamp>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimestampSecond<T extends TimestampSecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTime<T extends Time>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimeSecond<T extends TimeSecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimeMillisecond<T extends TimeMillisecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitTimeNanosecond<T extends TimeNanosecond>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitDecimal<T extends Decimal>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitList<T extends List>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitStruct<T extends Struct>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitUnion<T extends Union>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitDenseUnion<T extends DenseUnion>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitSparseUnion<T extends SparseUnion>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitDictionary<T extends Dictionary>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitInterval<T extends Interval>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitIntervalDayTime<T extends IntervalDayTime>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitFixedSizeList<T extends FixedSizeList>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
visitMap<T extends Map_>(vector: VectorType<T>): IterableIterator<T['TValue'] | null>;
}
/** @ignore */
export declare class IteratorVisitor extends Visitor {

@@ -56,0 +58,0 @@ }

@@ -21,2 +21,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { instance as getVisitor } from './get';
/** @ignore */
export class IteratorVisitor extends Visitor {

@@ -23,0 +24,0 @@ }

import * as type from '../type';
import { Visitor } from '../visitor';
/** @ignore */
export interface JSONTypeAssembler extends Visitor {
visit<T extends type.DataType>(node: T): object | undefined;
}
/** @ignore */
export declare class JSONTypeAssembler extends Visitor {

@@ -7,0 +9,0 @@ visitNull<T extends type.Null>({ typeId }: T): {

@@ -19,2 +19,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { ArrowType, Precision, DateUnit, TimeUnit, IntervalUnit, UnionMode } from '../enum';
/** @ignore */
export class JSONTypeAssembler extends Visitor {

@@ -21,0 +22,0 @@ visit(node) {

import { Column } from '../column';
import { Visitor } from '../visitor';
import { RecordBatch } from '../recordbatch';
import { Vector as VType } from '../interfaces';
import { VectorType as V } from '../interfaces';
import { DataType, Float, Int, Date_, Interval, Time, Timestamp, Union, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct } from '../type';
/** @ignore */
export interface JSONVectorAssembler extends Visitor {

@@ -18,56 +19,57 @@ visit<T extends Column>(node: T): object;

};
visitNull<T extends Null>(vector: VType<T>): {};
visitBool<T extends Bool>(vector: VType<T>): {
visitNull<T extends Null>(vector: V<T>): {};
visitBool<T extends Bool>(vector: V<T>): {
DATA: boolean[];
};
visitInt<T extends Int>(vector: VType<T>): {
visitInt<T extends Int>(vector: V<T>): {
DATA: (number | string)[];
};
visitFloat<T extends Float>(vector: VType<T>): {
visitFloat<T extends Float>(vector: V<T>): {
DATA: number[];
};
visitUtf8<T extends Utf8>(vector: VType<T>): {
visitUtf8<T extends Utf8>(vector: V<T>): {
DATA: string[];
OFFSET: number[];
};
visitBinary<T extends Binary>(vector: VType<T>): {
visitBinary<T extends Binary>(vector: V<T>): {
DATA: string[];
OFFSET: number[];
};
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: VType<T>): {
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: V<T>): {
DATA: string[];
};
visitDate<T extends Date_>(vector: VType<T>): {
visitDate<T extends Date_>(vector: V<T>): {
DATA: number[];
};
visitTimestamp<T extends Timestamp>(vector: VType<T>): {
visitTimestamp<T extends Timestamp>(vector: V<T>): {
DATA: string[];
};
visitTime<T extends Time>(vector: VType<T>): {
visitTime<T extends Time>(vector: V<T>): {
DATA: number[];
};
visitDecimal<T extends Decimal>(vector: VType<T>): {
visitDecimal<T extends Decimal>(vector: V<T>): {
DATA: string[];
};
visitList<T extends List>(vector: VType<T>): {
visitList<T extends List>(vector: V<T>): {
children: any[];
OFFSET: number[];
};
visitStruct<T extends Struct>(vector: VType<T>): {
visitStruct<T extends Struct>(vector: V<T>): {
children: any[];
};
visitUnion<T extends Union>(vector: VType<T>): {
visitUnion<T extends Union>(vector: V<T>): {
children: any[];
TYPE: number[];
};
visitInterval<T extends Interval>(vector: VType<T>): {
visitInterval<T extends Interval>(vector: V<T>): {
DATA: number[];
};
visitFixedSizeList<T extends FixedSizeList>(vector: VType<T>): {
visitFixedSizeList<T extends FixedSizeList>(vector: V<T>): {
children: any[];
};
visitMap<T extends Map_>(vector: VType<T>): {
visitMap<T extends Map_>(vector: V<T>): {
children: any[];
};
}
/** @ignore */
export declare class JSONVectorAssembler extends Visitor {

@@ -74,0 +76,0 @@ /** @nocollapse */

@@ -21,4 +21,4 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Visitor } from '../visitor';
import { BufferType } from '../enum';
import { RecordBatch } from '../recordbatch';
import { VectorType as BufferType } from '../enum';
import { UnionMode, DateUnit, TimeUnit } from '../enum';

@@ -28,2 +28,3 @@ import { iterateBits, getBit, getBool } from '../util/bit';

import { DataType, } from '../type';
/** @ignore */
export class JSONVectorAssembler extends Visitor {

@@ -30,0 +31,0 @@ /** @nocollapse */

import { Data } from '../data';
import { Visitor } from '../visitor';
import { Vector } from '../interfaces';
import { VectorType } from '../interfaces';
import { Type } from '../enum';
import { DataType, Dictionary, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Float, Float16, Float32, Float64, Int, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64, Date_, DateDay, DateMillisecond, Interval, IntervalDayTime, IntervalYearMonth, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Union, DenseUnion, SparseUnion } from '../type';
/** @ignore */
export interface SetVisitor extends Visitor {
visit<T extends Vector>(node: T, index: number, value: T['TValue']): void;
visitMany<T extends Vector>(nodes: T[], indices: number[], values: T['TValue'][]): void[];
getVisitFn<T extends Type>(node: T): (vector: Vector<T>, index: number, value: Vector<T>['TValue']) => void;
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): (vector: Vector<T>, index: number, value: Vector<T>['TValue']) => void;
visitNull<T extends Null>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitBool<T extends Bool>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitInt<T extends Int>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitInt8<T extends Int8>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitInt16<T extends Int16>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitInt32<T extends Int32>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitInt64<T extends Int64>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitUint8<T extends Uint8>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitUint16<T extends Uint16>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitUint32<T extends Uint32>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitUint64<T extends Uint64>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitFloat<T extends Float>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitFloat16<T extends Float16>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitFloat32<T extends Float32>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitFloat64<T extends Float64>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitUtf8<T extends Utf8>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitBinary<T extends Binary>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitDate<T extends Date_>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitDateDay<T extends DateDay>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitDateMillisecond<T extends DateMillisecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimestamp<T extends Timestamp>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimestampSecond<T extends TimestampSecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTime<T extends Time>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimeSecond<T extends TimeSecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimeMillisecond<T extends TimeMillisecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitTimeNanosecond<T extends TimeNanosecond>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitDecimal<T extends Decimal>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitList<T extends List>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitStruct<T extends Struct>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitUnion<T extends Union>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitDenseUnion<T extends DenseUnion>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitSparseUnion<T extends SparseUnion>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitDictionary<T extends Dictionary>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitInterval<T extends Interval>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitIntervalDayTime<T extends IntervalDayTime>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitFixedSizeList<T extends FixedSizeList>(vector: Vector<T>, index: number, value: T['TValue']): void;
visitMap<T extends Map_>(vector: Vector<T>, index: number, value: T['TValue']): void;
visit<T extends VectorType>(node: T, index: number, value: T['TValue']): void;
visitMany<T extends VectorType>(nodes: T[], indices: number[], values: T['TValue'][]): void[];
getVisitFn<T extends Type>(node: T): (vector: VectorType<T>, index: number, value: VectorType<T>['TValue']) => void;
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): (vector: VectorType<T>, index: number, value: VectorType<T>['TValue']) => void;
visitNull<T extends Null>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitBool<T extends Bool>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitInt<T extends Int>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitInt8<T extends Int8>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitInt16<T extends Int16>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitInt32<T extends Int32>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitInt64<T extends Int64>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitUint8<T extends Uint8>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitUint16<T extends Uint16>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitUint32<T extends Uint32>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitUint64<T extends Uint64>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitFloat<T extends Float>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitFloat16<T extends Float16>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitFloat32<T extends Float32>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitFloat64<T extends Float64>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitUtf8<T extends Utf8>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitBinary<T extends Binary>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitDate<T extends Date_>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitDateDay<T extends DateDay>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitDateMillisecond<T extends DateMillisecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimestamp<T extends Timestamp>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimestampSecond<T extends TimestampSecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTime<T extends Time>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimeSecond<T extends TimeSecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimeMillisecond<T extends TimeMillisecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitTimeNanosecond<T extends TimeNanosecond>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitDecimal<T extends Decimal>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitList<T extends List>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitStruct<T extends Struct>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitUnion<T extends Union>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitDenseUnion<T extends DenseUnion>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitSparseUnion<T extends SparseUnion>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitDictionary<T extends Dictionary>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitInterval<T extends Interval>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitIntervalDayTime<T extends IntervalDayTime>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitFixedSizeList<T extends FixedSizeList>(vector: VectorType<T>, index: number, value: T['TValue']): void;
visitMap<T extends Map_>(vector: VectorType<T>, index: number, value: T['TValue']): void;
}
/** @ignore */
export declare class SetVisitor extends Visitor {

@@ -56,0 +58,0 @@ }

@@ -19,3 +19,5 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { encodeUtf8 } from '../util/utf8';
import { toArrayBufferView } from '../util/buffer';
import { UnionMode, Precision, DateUnit, TimeUnit, IntervalUnit } from '../enum';
/** @ignore */
export class SetVisitor extends Visitor {

@@ -62,3 +64,17 @@ }

/** @ignore */
const setNumericX2 = ({ stride, values }, index, value) => { values.set(value.subarray(0, stride), stride * index); };
const setNumericX2 = (vector, index, value) => {
switch (typeof value) {
case 'bigint':
vector.values64[index] = value;
break;
case 'number':
vector.values[index * vector.stride] = value;
break;
default:
const val = value;
const { stride, ArrayType } = vector;
const long = toArrayBufferView(ArrayType, val);
vector.values.set(long.subarray(0, stride), stride * index);
}
};
/** @ignore */

@@ -87,3 +103,3 @@ const setFixedSizeBinary = ({ stride, values }, index, value) => { values.set(value.subarray(0, stride), stride * index); };

/* istanbul ignore next */
const getDate = (vector, index, value) => {
const setDate = (vector, index, value) => {
vector.type.unit === DateUnit.DAY

@@ -134,5 +150,5 @@ ? setDateDay(vector, index, value)

const values = vector.getChildAt(0);
const { valueOffsets, stride } = vector;
let idx = -1, offset = valueOffsets[index * stride];
let end = Math.min(value.length, valueOffsets[(index * stride) + 1] - offset);
const { valueOffsets } = vector;
let idx = -1, offset = valueOffsets[index];
let end = Math.min(offset + value.length, valueOffsets[index + 1]);
while (offset < end) {

@@ -143,6 +159,13 @@ values.set(offset++, value.get(++idx));

/** @ignore */
const setNested = (vector, index, value) => {
const setStruct = (vector, index, value) => {
vector.type.children.forEach((_field, idx) => {
const child = vector.getChildAt(idx);
child && child.set(index, value[idx]);
});
};
/** @ignore */
const setMap = (vector, index, value) => {
vector.type.children.forEach(({ name }, idx) => {
const kid = vector.getChildAt(idx);
kid && kid.set(index, value[name]);
const child = vector.getChildAt(idx);
child && child.set(index, value[name]);
});

@@ -159,4 +182,4 @@ };

const setDenseUnion = (vector, index, value) => {
const { typeIds, type: { typeIdToChildIndex } } = vector;
const child = vector.getChildAt(typeIdToChildIndex[typeIds[index]]);
const childIndex = vector.typeIdToChildIndex[vector.typeIds[index]];
const child = vector.getChildAt(childIndex);
child && child.set(vector.valueOffsets[index], value);

@@ -166,4 +189,4 @@ };

const setSparseUnion = (vector, index, value) => {
const { typeIds, type: { typeIdToChildIndex } } = vector;
const child = vector.getChildAt(typeIdToChildIndex[typeIds[index]]);
const childIndex = vector.typeIdToChildIndex[vector.typeIds[index]];
const child = vector.getChildAt(childIndex);
child && child.set(index, value);

@@ -213,3 +236,3 @@ };

SetVisitor.prototype.visitFixedSizeBinary = setFixedSizeBinary;
SetVisitor.prototype.visitDate = getDate;
SetVisitor.prototype.visitDate = setDate;
SetVisitor.prototype.visitDateDay = setDateDay;

@@ -229,3 +252,3 @@ SetVisitor.prototype.visitDateMillisecond = setDateMillisecond;

SetVisitor.prototype.visitList = setList;
SetVisitor.prototype.visitStruct = setNested;
SetVisitor.prototype.visitStruct = setStruct;
SetVisitor.prototype.visitUnion = setUnion;

@@ -239,3 +262,3 @@ SetVisitor.prototype.visitDenseUnion = setDenseUnion;

SetVisitor.prototype.visitFixedSizeList = setFixedSizeList;
SetVisitor.prototype.visitMap = setNested;
SetVisitor.prototype.visitMap = setMap;
/** @ignore */

@@ -242,0 +265,0 @@ export const instance = new SetVisitor();

import { Data } from '../data';
import { Type } from '../enum';
import { Visitor } from '../visitor';
import { Vector } from '../interfaces';
import { VectorType } from '../interfaces';
import { DataType, Dictionary, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Float, Float16, Float32, Float64, Int, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64, Date_, DateDay, DateMillisecond, Interval, IntervalDayTime, IntervalYearMonth, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Union, DenseUnion, SparseUnion } from '../type';
/** @ignore */
export interface ToArrayVisitor extends Visitor {
visit<T extends Vector>(node: T): T['TArray'];
visitMany<T extends Vector>(nodes: T[]): T['TArray'][];
getVisitFn<T extends Type>(node: T): (vector: Vector<T>) => Vector<T>['TArray'];
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): (vector: Vector<T>) => Vector<T>['TArray'];
visitNull<T extends Null>(vector: Vector<T>): Vector<T>['TArray'];
visitBool<T extends Bool>(vector: Vector<T>): Vector<T>['TArray'];
visitInt<T extends Int>(vector: Vector<T>): Vector<T>['TArray'];
visitInt8<T extends Int8>(vector: Vector<T>): Vector<T>['TArray'];
visitInt16<T extends Int16>(vector: Vector<T>): Vector<T>['TArray'];
visitInt32<T extends Int32>(vector: Vector<T>): Vector<T>['TArray'];
visitInt64<T extends Int64>(vector: Vector<T>): Vector<T>['TArray'];
visitUint8<T extends Uint8>(vector: Vector<T>): Vector<T>['TArray'];
visitUint16<T extends Uint16>(vector: Vector<T>): Vector<T>['TArray'];
visitUint32<T extends Uint32>(vector: Vector<T>): Vector<T>['TArray'];
visitUint64<T extends Uint64>(vector: Vector<T>): Vector<T>['TArray'];
visitFloat<T extends Float>(vector: Vector<T>): Vector<T>['TArray'];
visitFloat16<T extends Float16>(vector: Vector<T>): Vector<T>['TArray'];
visitFloat32<T extends Float32>(vector: Vector<T>): Vector<T>['TArray'];
visitFloat64<T extends Float64>(vector: Vector<T>): Vector<T>['TArray'];
visitUtf8<T extends Utf8>(vector: Vector<T>): Vector<T>['TArray'];
visitBinary<T extends Binary>(vector: Vector<T>): Vector<T>['TArray'];
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: Vector<T>): Vector<T>['TArray'];
visitDate<T extends Date_>(vector: Vector<T>): Vector<T>['TArray'];
visitDateDay<T extends DateDay>(vector: Vector<T>): Vector<T>['TArray'];
visitDateMillisecond<T extends DateMillisecond>(vector: Vector<T>): Vector<T>['TArray'];
visitTimestamp<T extends Timestamp>(vector: Vector<T>): Vector<T>['TArray'];
visitTimestampSecond<T extends TimestampSecond>(vector: Vector<T>): Vector<T>['TArray'];
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: Vector<T>): Vector<T>['TArray'];
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: Vector<T>): Vector<T>['TArray'];
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: Vector<T>): Vector<T>['TArray'];
visitTime<T extends Time>(vector: Vector<T>): Vector<T>['TArray'];
visitTimeSecond<T extends TimeSecond>(vector: Vector<T>): Vector<T>['TArray'];
visitTimeMillisecond<T extends TimeMillisecond>(vector: Vector<T>): Vector<T>['TArray'];
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: Vector<T>): Vector<T>['TArray'];
visitTimeNanosecond<T extends TimeNanosecond>(vector: Vector<T>): Vector<T>['TArray'];
visitDecimal<T extends Decimal>(vector: Vector<T>): Vector<T>['TArray'];
visitList<R extends DataType, T extends List<R>>(vector: Vector<T>): Vector<T>['TArray'];
visitStruct<T extends Struct>(vector: Vector<T>): Vector<T>['TArray'];
visitUnion<T extends Union>(vector: Vector<T>): Vector<T>['TArray'];
visitDenseUnion<T extends DenseUnion>(vector: Vector<T>): Vector<T>['TArray'];
visitSparseUnion<T extends SparseUnion>(vector: Vector<T>): Vector<T>['TArray'];
visitDictionary<R extends DataType, T extends Dictionary<R>>(vector: Vector<T>): Vector<T>['TArray'];
visitInterval<T extends Interval>(vector: Vector<T>): Vector<T>['TArray'];
visitIntervalDayTime<T extends IntervalDayTime>(vector: Vector<T>): Vector<T>['TArray'];
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: Vector<T>): Vector<T>['TArray'];
visitFixedSizeList<R extends DataType, T extends FixedSizeList<R>>(vector: Vector<T>): Vector<T>['TArray'];
visitMap<T extends Map_>(vector: Vector<T>): Vector<T>['TArray'];
visit<T extends VectorType>(node: T): T['TArray'];
visitMany<T extends VectorType>(nodes: T[]): T['TArray'][];
getVisitFn<T extends Type>(node: T): (vector: VectorType<T>) => VectorType<T>['TArray'];
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): (vector: VectorType<T>) => VectorType<T>['TArray'];
visitNull<T extends Null>(vector: VectorType<T>): VectorType<T>['TArray'];
visitBool<T extends Bool>(vector: VectorType<T>): VectorType<T>['TArray'];
visitInt<T extends Int>(vector: VectorType<T>): VectorType<T>['TArray'];
visitInt8<T extends Int8>(vector: VectorType<T>): VectorType<T>['TArray'];
visitInt16<T extends Int16>(vector: VectorType<T>): VectorType<T>['TArray'];
visitInt32<T extends Int32>(vector: VectorType<T>): VectorType<T>['TArray'];
visitInt64<T extends Int64>(vector: VectorType<T>): VectorType<T>['TArray'];
visitUint8<T extends Uint8>(vector: VectorType<T>): VectorType<T>['TArray'];
visitUint16<T extends Uint16>(vector: VectorType<T>): VectorType<T>['TArray'];
visitUint32<T extends Uint32>(vector: VectorType<T>): VectorType<T>['TArray'];
visitUint64<T extends Uint64>(vector: VectorType<T>): VectorType<T>['TArray'];
visitFloat<T extends Float>(vector: VectorType<T>): VectorType<T>['TArray'];
visitFloat16<T extends Float16>(vector: VectorType<T>): VectorType<T>['TArray'];
visitFloat32<T extends Float32>(vector: VectorType<T>): VectorType<T>['TArray'];
visitFloat64<T extends Float64>(vector: VectorType<T>): VectorType<T>['TArray'];
visitUtf8<T extends Utf8>(vector: VectorType<T>): VectorType<T>['TArray'];
visitBinary<T extends Binary>(vector: VectorType<T>): VectorType<T>['TArray'];
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: VectorType<T>): VectorType<T>['TArray'];
visitDate<T extends Date_>(vector: VectorType<T>): VectorType<T>['TArray'];
visitDateDay<T extends DateDay>(vector: VectorType<T>): VectorType<T>['TArray'];
visitDateMillisecond<T extends DateMillisecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimestamp<T extends Timestamp>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimestampSecond<T extends TimestampSecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimestampMillisecond<T extends TimestampMillisecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimestampMicrosecond<T extends TimestampMicrosecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimestampNanosecond<T extends TimestampNanosecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTime<T extends Time>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimeSecond<T extends TimeSecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimeMillisecond<T extends TimeMillisecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimeMicrosecond<T extends TimeMicrosecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitTimeNanosecond<T extends TimeNanosecond>(vector: VectorType<T>): VectorType<T>['TArray'];
visitDecimal<T extends Decimal>(vector: VectorType<T>): VectorType<T>['TArray'];
visitList<R extends DataType, T extends List<R>>(vector: VectorType<T>): VectorType<T>['TArray'];
visitStruct<T extends Struct>(vector: VectorType<T>): VectorType<T>['TArray'];
visitUnion<T extends Union>(vector: VectorType<T>): VectorType<T>['TArray'];
visitDenseUnion<T extends DenseUnion>(vector: VectorType<T>): VectorType<T>['TArray'];
visitSparseUnion<T extends SparseUnion>(vector: VectorType<T>): VectorType<T>['TArray'];
visitDictionary<R extends DataType, T extends Dictionary<R>>(vector: VectorType<T>): VectorType<T>['TArray'];
visitInterval<T extends Interval>(vector: VectorType<T>): VectorType<T>['TArray'];
visitIntervalDayTime<T extends IntervalDayTime>(vector: VectorType<T>): VectorType<T>['TArray'];
visitIntervalYearMonth<T extends IntervalYearMonth>(vector: VectorType<T>): VectorType<T>['TArray'];
visitFixedSizeList<R extends DataType, T extends FixedSizeList<R>>(vector: VectorType<T>): VectorType<T>['TArray'];
visitMap<T extends Map_>(vector: VectorType<T>): VectorType<T>['TArray'];
}
/** @ignore */
export declare class ToArrayVisitor extends Visitor {

@@ -56,0 +58,0 @@ }

@@ -20,2 +20,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { instance as iteratorVisitor } from './iterator';
/** @ignore */
export class ToArrayVisitor extends Visitor {

@@ -22,0 +23,0 @@ }

@@ -5,5 +5,7 @@ import { flatbuffers } from 'flatbuffers';

import { Visitor } from '../visitor';
/** @ignore */
export interface TypeAssembler extends Visitor {
visit<T extends type.DataType>(node: T, builder: Builder): number | undefined;
}
/** @ignore */
export declare class TypeAssembler extends Visitor {

@@ -10,0 +12,0 @@ visitNull<T extends type.Null>(_node: T, b: Builder): number;

@@ -39,2 +39,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

var Map_ = Schema_.org.apache.arrow.flatbuf.Map;
/** @ignore */
export class TypeAssembler extends Visitor {

@@ -41,0 +42,0 @@ visit(node, builder) {

import { Data } from '../data';
import { Visitor } from '../visitor';
import { Vector } from '../interfaces';
import { VectorType } from '../interfaces';
import { Schema, Field } from '../schema';
import { DataType, Dictionary, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct, Float, Float16, Float32, Float64, Int, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64, Date_, DateDay, DateMillisecond, Interval, IntervalDayTime, IntervalYearMonth, Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Union, DenseUnion, SparseUnion } from '../type';
/** @ignore */
export interface TypeComparator extends Visitor {
visit<T extends DataType>(type: T, other?: DataType | null): other is T;
visitMany<T extends DataType>(nodes: T[], others?: DataType[] | null): boolean[];
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): (other?: DataType | null) => other is T;
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): (other?: DataType | null) => other is T;
visitNull<T extends Null>(type: T, other?: DataType | null): other is T;

@@ -54,2 +55,3 @@ visitBool<T extends Bool>(type: T, other?: DataType | null): other is T;

}
/** @ignore */
export declare class TypeComparator extends Visitor {

@@ -56,0 +58,0 @@ compareSchemas<T extends {

@@ -18,2 +18,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Visitor } from '../visitor';
/** @ignore */
export class TypeComparator extends Visitor {

@@ -20,0 +21,0 @@ compareSchemas(schema, other) {

@@ -6,4 +6,5 @@ import { Data } from '../data';

import { Visitor } from '../visitor';
import { Vector } from '../interfaces';
import { VectorType } from '../interfaces';
import { DataTypeCtor } from '../interfaces';
/** @ignore */
export interface GetDataTypeConstructor extends Visitor {

@@ -13,4 +14,5 @@ visit<T extends Type>(node: T): DataTypeCtor<T>;

getVisitFn<T extends Type>(node: T): () => DataTypeCtor<T>;
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): () => DataTypeCtor<T>;
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): () => DataTypeCtor<T>;
}
/** @ignore */
export declare class GetDataTypeConstructor extends Visitor {

@@ -17,0 +19,0 @@ visitNull(): typeof type.Null;

@@ -19,2 +19,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Visitor } from '../visitor';
/** @ignore */
export class GetDataTypeConstructor extends Visitor {

@@ -21,0 +22,0 @@ visitNull() { return type.Null; }

@@ -6,27 +6,29 @@ import { Data } from '../data';

import { RecordBatch } from '../recordbatch';
import { Vector as VType } from '../interfaces';
import { VectorType as V } from '../interfaces';
import { BufferRegion, FieldNode } from '../ipc/metadata/message';
import { DataType, Dictionary, Float, Int, Date_, Interval, Time, Timestamp, Union, Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct } from '../type';
/** @ignore */
export interface VectorAssembler extends Visitor {
visit<T extends Vector>(node: T): this;
visitMany<T extends Vector>(nodes: T[]): this[];
getVisitFn<T extends Type>(node: T): (vector: VType<T>) => this;
getVisitFn<T extends DataType>(node: VType<T> | Data<T> | T): (vector: VType<T>) => this;
visitBool<T extends Bool>(vector: VType<T>): this;
visitInt<T extends Int>(vector: VType<T>): this;
visitFloat<T extends Float>(vector: VType<T>): this;
visitUtf8<T extends Utf8>(vector: VType<T>): this;
visitBinary<T extends Binary>(vector: VType<T>): this;
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: VType<T>): this;
visitDate<T extends Date_>(vector: VType<T>): this;
visitTimestamp<T extends Timestamp>(vector: VType<T>): this;
visitTime<T extends Time>(vector: VType<T>): this;
visitDecimal<T extends Decimal>(vector: VType<T>): this;
visitList<T extends List>(vector: VType<T>): this;
visitStruct<T extends Struct>(vector: VType<T>): this;
visitUnion<T extends Union>(vector: VType<T>): this;
visitInterval<T extends Interval>(vector: VType<T>): this;
visitFixedSizeList<T extends FixedSizeList>(vector: VType<T>): this;
visitMap<T extends Map_>(vector: VType<T>): this;
getVisitFn<T extends Type>(node: T): (vector: V<T>) => this;
getVisitFn<T extends DataType>(node: V<T> | Data<T> | T): (vector: V<T>) => this;
visitBool<T extends Bool>(vector: V<T>): this;
visitInt<T extends Int>(vector: V<T>): this;
visitFloat<T extends Float>(vector: V<T>): this;
visitUtf8<T extends Utf8>(vector: V<T>): this;
visitBinary<T extends Binary>(vector: V<T>): this;
visitFixedSizeBinary<T extends FixedSizeBinary>(vector: V<T>): this;
visitDate<T extends Date_>(vector: V<T>): this;
visitTimestamp<T extends Timestamp>(vector: V<T>): this;
visitTime<T extends Time>(vector: V<T>): this;
visitDecimal<T extends Decimal>(vector: V<T>): this;
visitList<T extends List>(vector: V<T>): this;
visitStruct<T extends Struct>(vector: V<T>): this;
visitUnion<T extends Union>(vector: V<T>): this;
visitInterval<T extends Interval>(vector: V<T>): this;
visitFixedSizeList<T extends FixedSizeList>(vector: V<T>): this;
visitMap<T extends Map_>(vector: V<T>): this;
}
/** @ignore */
export declare class VectorAssembler extends Visitor {

@@ -36,4 +38,4 @@ /** @nocollapse */

private constructor();
visitNull<T extends Null>(_nullV: VType<T>): VectorAssembler;
visitDictionary<T extends Dictionary>(vector: VType<T>): this;
visitNull<T extends Null>(_nullV: V<T>): VectorAssembler;
visitDictionary<T extends Dictionary>(vector: V<T>): this;
readonly nodes: FieldNode[];

@@ -40,0 +42,0 @@ readonly buffers: ArrayBufferView[];

@@ -25,2 +25,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { DataType, } from '../type';
/** @ignore */
export class VectorAssembler extends Visitor {

@@ -27,0 +28,0 @@ constructor() {

@@ -5,3 +5,3 @@ import { Data } from '../data';

import { Visitor } from '../visitor';
import { Vector, VectorCtor } from '../interfaces';
import { VectorType, VectorCtor } from '../interfaces';
import { BinaryVector } from '../vector/binary';

@@ -25,2 +25,3 @@ import { BoolVector } from '../vector/bool';

import { Utf8Vector } from '../vector/utf8';
/** @ignore */
export interface GetVectorConstructor extends Visitor {

@@ -30,4 +31,5 @@ visit<T extends Type>(node: T): VectorCtor<T>;

getVisitFn<T extends Type>(node: T): () => VectorCtor<T>;
getVisitFn<T extends DataType>(node: Vector<T> | Data<T> | T): () => VectorCtor<T>;
getVisitFn<T extends DataType>(node: VectorType<T> | Data<T> | T): () => VectorCtor<T>;
}
/** @ignore */
export declare class GetVectorConstructor extends Visitor {

@@ -34,0 +36,0 @@ visitNull(): typeof NullVector;

@@ -36,2 +36,3 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { Utf8Vector } from '../vector/utf8';
/** @ignore */
export class GetVectorConstructor extends Visitor {

@@ -38,0 +39,0 @@ visitNull() { return NullVector; }

import { Data } from '../data';
import * as type from '../type';
import { Field } from '../schema';
import { Vector } from '../vector';
import { DataType } from '../type';
import { Visitor } from '../visitor';
import { BufferRegion, FieldNode } from '../ipc/metadata/message';
/** @ignore */
export interface VectorLoader extends Visitor {

@@ -11,2 +13,3 @@ visit<T extends DataType>(node: Field<T> | T): Data<T>;

}
/** @ignore */
export declare class VectorLoader extends Visitor {

@@ -18,3 +21,4 @@ private bytes;

private buffersIndex;
constructor(bytes: Uint8Array, nodes: FieldNode[], buffers: BufferRegion[]);
private dictionaries;
constructor(bytes: Uint8Array, nodes: FieldNode[], buffers: BufferRegion[], dictionaries: Map<number, Vector<any>>);
visitNull<T extends type.Null>(type: T, { length, nullCount }?: FieldNode): Data<T>;

@@ -46,6 +50,8 @@ visitBool<T extends type.Bool>(type: T, { length, nullCount }?: FieldNode): Data<T>;

protected readData<T extends DataType>(_type: T, { length, offset }?: BufferRegion): Uint8Array;
protected readDictionary<T extends type.Dictionary>(type: T): Vector<T['dictionary']>;
}
/** @ignore */
export declare class JSONVectorLoader extends VectorLoader {
private sources;
constructor(sources: any[][], nodes: FieldNode[], buffers: BufferRegion[]);
constructor(sources: any[][], nodes: FieldNode[], buffers: BufferRegion[], dictionaries: Map<number, Vector<any>>);
protected readNullBitmap<T extends DataType>(_type: T, nullCount: number, { offset }?: BufferRegion): Uint8Array;

@@ -52,0 +58,0 @@ protected readOffsets<T extends DataType>(_type: T, { offset }?: BufferRegion): Uint8Array;

@@ -26,4 +26,5 @@ // Licensed to the Apache Software Foundation (ASF) under one

import { toArrayBufferView } from '../util/buffer';
/** @ignore */
export class VectorLoader extends Visitor {
constructor(bytes, nodes, buffers) {
constructor(bytes, nodes, buffers, dictionaries) {
super();

@@ -35,2 +36,3 @@ this.nodesIndex = -1;

this.buffers = buffers;
this.dictionaries = dictionaries;
}

@@ -56,3 +58,3 @@ visit(node) {

visitSparseUnion(type, { length, nullCount } = this.nextFieldNode()) { return Data.Union(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readTypeIds(type), this.visitMany(type.children)); }
visitDictionary(type, { length, nullCount } = this.nextFieldNode()) { return Data.Dictionary(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type.indices)); }
visitDictionary(type, { length, nullCount } = this.nextFieldNode()) { return Data.Dictionary(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type.indices), this.readDictionary(type)); }
visitInterval(type, { length, nullCount } = this.nextFieldNode()) { return Data.Interval(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }

@@ -71,6 +73,10 @@ visitFixedSizeList(type, { length, nullCount } = this.nextFieldNode()) { return Data.FixedSizeList(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.visit(type.children[0])); }

}
readDictionary(type) {
return this.dictionaries.get(type.id);
}
}
/** @ignore */
export class JSONVectorLoader extends VectorLoader {
constructor(sources, nodes, buffers) {
super(new Uint8Array(0), nodes, buffers);
constructor(sources, nodes, buffers, dictionaries) {
super(new Uint8Array(0), nodes, buffers, dictionaries);
this.sources = sources;

@@ -77,0 +83,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc