///
import { Data } from '../data.js';
import { Table } from '../table.js';
import { TypeMap } from '../type.js';
import { Schema } from '../schema.js';
import { Message } from './metadata/message.js';
import { FileBlock } from './metadata/file.js';
import { MessageHeader } from '../enum.js';
import { WritableSink, AsyncByteQueue } from '../io/stream.js';
import { ArrayBufferViewInput } from '../util/buffer.js';
import { RecordBatch } from '../recordbatch.js';
import { Writable, ReadableInterop, ReadableDOMStreamOptions } from '../io/interfaces.js';
export interface RecordBatchStreamWriterOptions {
/**
*
*/
autoDestroy?: boolean;
/**
* A flag indicating whether the RecordBatchWriter should construct pre-0.15.0
* encapsulated IPC Messages, which reserves 4 bytes for the Message metadata
* length instead of 8.
* @see https://issues.apache.org/jira/browse/ARROW-6313
*/
writeLegacyIpcFormat?: boolean;
}
export declare class RecordBatchWriter extends ReadableInterop implements Writable> {
/** @nocollapse */
static throughNode(options?: import('stream').DuplexOptions & {
autoDestroy: boolean;
}): import('stream').Duplex;
/** @nocollapse */
static throughDOM(writableStrategy?: QueuingStrategy> & {
autoDestroy: boolean;
}, readableStrategy?: {
highWaterMark?: number;
size?: any;
}): {
writable: WritableStream | RecordBatch>;
readable: ReadableStream;
};
constructor(options?: RecordBatchStreamWriterOptions);
protected _position: number;
protected _started: boolean;
protected _autoDestroy: boolean;
protected _writeLegacyIpcFormat: boolean;
protected _sink: AsyncByteQueue;
protected _schema: Schema | null;
protected _dictionaryBlocks: FileBlock[];
protected _recordBatchBlocks: FileBlock[];
protected _dictionaryDeltaOffsets: Map;
toString(sync: true): string;
toString(sync?: false): Promise;
toUint8Array(sync: true): Uint8Array;
toUint8Array(sync?: false): Promise;
writeAll(input: Table | Iterable>): this;
writeAll(input: AsyncIterable>): Promise;
writeAll(input: PromiseLike>>): Promise;
writeAll(input: PromiseLike | Iterable>>): Promise;
get closed(): Promise;
[Symbol.asyncIterator](): AsyncByteQueue;
toDOMStream(options?: ReadableDOMStreamOptions): ReadableStream;
toNodeStream(options?: import('stream').ReadableOptions): import("stream").Readable;
close(): void;
abort(reason?: any): void;
finish(): this;
reset(sink?: WritableSink, schema?: Schema | null): this;
write(payload?: Table | RecordBatch | Iterable> | null): void;
protected _writeMessage(message: Message, alignment?: number): this;
protected _write(chunk: ArrayBufferViewInput): this;
protected _writeSchema(schema: Schema): this;
protected _writeFooter(schema: Schema): this;
protected _writeMagic(): this;
protected _writePadding(nBytes: number): this;
protected _writeRecordBatch(batch: RecordBatch): this;
protected _writeDictionaryBatch(dictionary: Data, id: number, isDelta?: boolean): this;
protected _writeBodyBuffers(buffers: ArrayBufferView[]): this;
protected _writeDictionaries(batch: RecordBatch): this;
}
/** @ignore */
export declare class RecordBatchStreamWriter extends RecordBatchWriter {
static writeAll(input: Table | Iterable>, options?: RecordBatchStreamWriterOptions): RecordBatchStreamWriter;
static writeAll(input: AsyncIterable>, options?: RecordBatchStreamWriterOptions): Promise>;
static writeAll(input: PromiseLike>>, options?: RecordBatchStreamWriterOptions): Promise>;
static writeAll(input: PromiseLike | Iterable>>, options?: RecordBatchStreamWriterOptions): Promise>;
}
/** @ignore */
export declare class RecordBatchFileWriter extends RecordBatchWriter {
static writeAll(input: Table | Iterable>): RecordBatchFileWriter;
static writeAll(input: AsyncIterable>): Promise>;
static writeAll(input: PromiseLike>>): Promise>;
static writeAll(input: PromiseLike | Iterable>>): Promise>;
constructor();
protected _writeSchema(schema: Schema): this;
protected _writeFooter(schema: Schema): this;
}
/** @ignore */
export declare class RecordBatchJSONWriter extends RecordBatchWriter {
static writeAll(this: typeof RecordBatchWriter, input: Table | Iterable>): RecordBatchJSONWriter;
static writeAll(this: typeof RecordBatchWriter, input: AsyncIterable>): Promise>;
static writeAll(this: typeof RecordBatchWriter, input: PromiseLike>>): Promise>;
static writeAll(this: typeof RecordBatchWriter, input: PromiseLike | Iterable>>): Promise>;
private _recordBatches;
private _dictionaries;
constructor();
protected _writeMessage(): this;
protected _writeFooter(schema: Schema): this;
protected _writeSchema(schema: Schema): this;
protected _writeDictionaries(batch: RecordBatch): this;
protected _writeDictionaryBatch(dictionary: Data, id: number, isDelta?: boolean): this;
protected _writeRecordBatch(batch: RecordBatch): this;
close(): void;
}