///
///
import { Vector } from '../vector.js';
import { DataType, TypeMap } from '../type.js';
import { MessageHeader } from '../enum.js';
import { Footer } from './metadata/file.js';
import { Schema, Field } from '../schema.js';
import { Message } from './metadata/message.js';
import * as metadata from './metadata/message.js';
import { ArrayBufferViewInput } from '../util/buffer.js';
import { ByteStream, AsyncByteStream } from '../io/stream.js';
import { RandomAccessFile, AsyncRandomAccessFile } from '../io/file.js';
import { RecordBatch } from '../recordbatch.js';
import { FileHandle, ArrowJSONLike, ReadableInterop } from '../io/interfaces.js';
import { MessageReader, AsyncMessageReader } from './message.js';
/** @ignore */ export declare type FromArg0 = ArrowJSONLike;
/** @ignore */ export declare type FromArg1 = PromiseLike;
/** @ignore */ export declare type FromArg2 = Iterable | ArrayBufferViewInput;
/** @ignore */ export declare type FromArg3 = PromiseLike | ArrayBufferViewInput>;
/** @ignore */ export declare type FromArg4 = Response | NodeJS.ReadableStream | ReadableStream | AsyncIterable;
/** @ignore */ export declare type FromArg5 = FileHandle | PromiseLike | PromiseLike;
/** @ignore */ export declare type FromArgs = FromArg0 | FromArg1 | FromArg2 | FromArg3 | FromArg4 | FromArg5;
/** @ignore */ declare type OpenOptions = {
autoDestroy?: boolean;
};
/** @ignore */ declare type RecordBatchReaders = RecordBatchFileReader | RecordBatchStreamReader;
/** @ignore */ declare type AsyncRecordBatchReaders = AsyncRecordBatchFileReader | AsyncRecordBatchStreamReader;
/** @ignore */ declare type RecordBatchFileReaders = RecordBatchFileReader | AsyncRecordBatchFileReader;
/** @ignore */ declare type RecordBatchStreamReaders = RecordBatchStreamReader | AsyncRecordBatchStreamReader;
export declare class RecordBatchReader extends ReadableInterop> {
protected _impl: RecordBatchReaderImpls;
protected constructor(impl: RecordBatchReaderImpls);
get closed(): boolean;
get schema(): Schema;
get autoDestroy(): boolean;
get dictionaries(): Map>;
get numDictionaries(): number;
get numRecordBatches(): number;
get footer(): Footer | null;
isSync(): this is RecordBatchReaders;
isAsync(): this is AsyncRecordBatchReaders;
isFile(): this is RecordBatchFileReaders;
isStream(): this is RecordBatchStreamReaders;
next(): IteratorResult, any> | Promise, any>>;
throw(value?: any): IteratorResult | Promise>;
return(value?: any): IteratorResult | Promise>;
cancel(): void | Promise;
reset(schema?: Schema | null): this;
open(options?: OpenOptions): this | Promise;
readRecordBatch(index: number): RecordBatch | null | Promise | null>;
[Symbol.iterator](): IterableIterator>;
[Symbol.asyncIterator](): AsyncIterableIterator>;
toDOMStream(): ReadableStream>;
toNodeStream(): import("stream").Readable;
/** @nocollapse */
static throughNode(options?: import('stream').DuplexOptions & {
autoDestroy: boolean;
}): import('stream').Duplex;
/** @nocollapse */
static throughDOM(writableStrategy?: ByteLengthQueuingStrategy, readableStrategy?: {
autoDestroy: boolean;
}): {
writable: WritableStream;
readable: ReadableStream>;
};
static from(source: T): T;
static from(source: FromArg0): RecordBatchStreamReader;
static from(source: FromArg1): Promise>;
static from(source: FromArg2): RecordBatchFileReader | RecordBatchStreamReader;
static from(source: FromArg3): Promise | RecordBatchStreamReader>;
static from(source: FromArg4): Promise | AsyncRecordBatchStreamReader>;
static from(source: FromArg5): Promise | AsyncRecordBatchStreamReader>;
static readAll(source: T): T extends RecordBatchReaders ? IterableIterator : AsyncIterableIterator;
static readAll(source: FromArg0): IterableIterator>;
static readAll(source: FromArg1): AsyncIterableIterator>;
static readAll(source: FromArg2): IterableIterator | RecordBatchStreamReader>;
static readAll(source: FromArg3): AsyncIterableIterator | RecordBatchStreamReader>;
static readAll(source: FromArg4): AsyncIterableIterator>;
static readAll(source: FromArg5): AsyncIterableIterator>;
}
/** @ignore */
export declare class RecordBatchStreamReader extends RecordBatchReader {
protected _impl: RecordBatchStreamReaderImpl;
constructor(_impl: RecordBatchStreamReaderImpl);
readAll(): RecordBatch[];
[Symbol.iterator](): IterableIterator>;
[Symbol.asyncIterator](): AsyncIterableIterator>;
}
/** @ignore */
export declare class AsyncRecordBatchStreamReader extends RecordBatchReader {
protected _impl: AsyncRecordBatchStreamReaderImpl;
constructor(_impl: AsyncRecordBatchStreamReaderImpl);
readAll(): Promise[]>;
[Symbol.iterator](): IterableIterator>;
[Symbol.asyncIterator](): AsyncIterableIterator>;
}
/** @ignore */
export declare class RecordBatchFileReader extends RecordBatchStreamReader {
protected _impl: RecordBatchFileReaderImpl;
constructor(_impl: RecordBatchFileReaderImpl);
}
/** @ignore */
export declare class AsyncRecordBatchFileReader extends AsyncRecordBatchStreamReader {
protected _impl: AsyncRecordBatchFileReaderImpl;
constructor(_impl: AsyncRecordBatchFileReaderImpl);
}
/** @ignore */
export interface RecordBatchStreamReader extends RecordBatchReader {
open(options?: OpenOptions | undefined): this;
cancel(): void;
throw(value?: any): IteratorResult;
return(value?: any): IteratorResult;
next(value?: any): IteratorResult>;
}
/** @ignore */
export interface AsyncRecordBatchStreamReader extends RecordBatchReader {
open(options?: OpenOptions | undefined): Promise;
cancel(): Promise;
throw(value?: any): Promise>;
return(value?: any): Promise>;
next(value?: any): Promise>>;
}
/** @ignore */
export interface RecordBatchFileReader extends RecordBatchStreamReader {
readRecordBatch(index: number): RecordBatch | null;
}
/** @ignore */
export interface AsyncRecordBatchFileReader extends AsyncRecordBatchStreamReader {
readRecordBatch(index: number): Promise | null>;
}
/** @ignore */
declare type RecordBatchReaderImpls = RecordBatchJSONReaderImpl | RecordBatchFileReaderImpl | RecordBatchStreamReaderImpl | AsyncRecordBatchFileReaderImpl | AsyncRecordBatchStreamReaderImpl;
/** @ignore */
interface RecordBatchReaderImpl {
closed: boolean;
schema: Schema;
autoDestroy: boolean;
dictionaries: Map;
isFile(): this is RecordBatchFileReaders;
isStream(): this is RecordBatchStreamReaders;
isSync(): this is RecordBatchReaders;
isAsync(): this is AsyncRecordBatchReaders;
reset(schema?: Schema | null): this;
}
/** @ignore */
interface RecordBatchStreamReaderImpl extends RecordBatchReaderImpl {
open(options?: OpenOptions): this;
cancel(): void;
throw(value?: any): IteratorResult;
return(value?: any): IteratorResult;
next(value?: any): IteratorResult>;
[Symbol.iterator](): IterableIterator>;
}
/** @ignore */
interface AsyncRecordBatchStreamReaderImpl extends RecordBatchReaderImpl {
open(options?: OpenOptions): Promise;
cancel(): Promise;
throw(value?: any): Promise>;
return(value?: any): Promise>;
next(value?: any): Promise>>;
[Symbol.asyncIterator](): AsyncIterableIterator>;
}
/** @ignore */
interface RecordBatchFileReaderImpl extends RecordBatchStreamReaderImpl {
readRecordBatch(index: number): RecordBatch | null;
}
/** @ignore */
interface AsyncRecordBatchFileReaderImpl extends AsyncRecordBatchStreamReaderImpl {
readRecordBatch(index: number): Promise | null>;
}
/** @ignore */
declare abstract class RecordBatchReaderImpl implements RecordBatchReaderImpl {
schema: Schema;
closed: boolean;
autoDestroy: boolean;
dictionaries: Map;
protected _dictionaryIndex: number;
protected _recordBatchIndex: number;
get numDictionaries(): number;
get numRecordBatches(): number;
constructor(dictionaries?: Map>);
protected _loadRecordBatch(header: metadata.RecordBatch, body: any): RecordBatch;
protected _loadDictionaryBatch(header: metadata.DictionaryBatch, body: any): Vector;
protected _loadVectors(header: metadata.RecordBatch, body: any, types: (Field | DataType)[]): import("../data.js").Data[];
}
/** @ignore */
declare class RecordBatchStreamReaderImpl extends RecordBatchReaderImpl implements IterableIterator> {
protected _reader: MessageReader;
protected _handle: ByteStream | ArrowJSONLike;
constructor(source: ByteStream | ArrowJSONLike, dictionaries?: Map);
isSync(): this is RecordBatchReaders;
isStream(): this is RecordBatchStreamReaders;
protected _readNextMessageAndValidate(type?: T | null): Message | null;
}
/** @ignore */
declare class AsyncRecordBatchStreamReaderImpl extends RecordBatchReaderImpl implements AsyncIterableIterator> {
protected _handle: AsyncByteStream;
protected _reader: AsyncMessageReader;
constructor(source: AsyncByteStream, dictionaries?: Map);
isAsync(): this is AsyncRecordBatchReaders;
isStream(): this is RecordBatchStreamReaders;
protected _readNextMessageAndValidate(type?: T | null): Promise | null>;
}
/** @ignore */
declare class RecordBatchFileReaderImpl extends RecordBatchStreamReaderImpl {
protected _footer?: Footer;
protected _handle: RandomAccessFile;
get footer(): Footer;
get numDictionaries(): number;
get numRecordBatches(): number;
constructor(source: RandomAccessFile | ArrayBufferViewInput, dictionaries?: Map);
isSync(): this is RecordBatchReaders;
isFile(): this is RecordBatchFileReaders;
open(options?: OpenOptions): this;
protected _readDictionaryBatch(index: number): void;
protected _readFooter(): Footer;
protected _readNextMessageAndValidate(type?: T | null): Message | null;
}
/** @ignore */
declare class AsyncRecordBatchFileReaderImpl extends AsyncRecordBatchStreamReaderImpl implements AsyncRecordBatchFileReaderImpl {
protected _footer?: Footer;
protected _handle: AsyncRandomAccessFile;
get footer(): Footer;
get numDictionaries(): number;
get numRecordBatches(): number;
constructor(source: FileHandle, byteLength?: number, dictionaries?: Map);
constructor(source: FileHandle | AsyncRandomAccessFile, dictionaries?: Map);
isFile(): this is RecordBatchFileReaders;
isAsync(): this is AsyncRecordBatchReaders;
open(options?: OpenOptions): Promise;
protected _readDictionaryBatch(index: number): Promise;
protected _readFooter(): Promise