Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Propagate write errors in ParquetTransformer #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/writer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Transform, Writable } from 'stream';
import { Transform, TransformCallback, Writable } from 'stream';
import { ParquetCodecOptions, PARQUET_CODEC } from './codec';
import * as Compression from './compression';
import { ParquetBuffer, ParquetCodec, ParquetData, ParquetField, PrimitiveType } from './declare';
Expand Down Expand Up @@ -290,9 +290,9 @@ export class ParquetTransformer<T> extends Transform {
}

// tslint:disable-next-line:function-name
_transform(row: any, encoding: string, callback: (val?: any) => void) {
_transform(row: any, encoding: string, callback: TransformCallback) {
if (row) {
this.writer.appendRow(row).then(callback);
this.writer.appendRow(row).then(() => callback(), err => callback(err));
} else {
callback();
}
Expand Down