From 3b9d18c62c4c3769aa12cdaba8109efc64359348 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Wed, 7 Dec 2022 14:17:04 -0800 Subject: [PATCH] start rowId from 0 instead of 1 --- js/src/bin/arrow2csv.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/bin/arrow2csv.ts b/js/src/bin/arrow2csv.ts index 41b928fc4d70b..eae7f5805c41c 100644 --- a/js/src/bin/arrow2csv.ts +++ b/js/src/bin/arrow2csv.ts @@ -178,10 +178,10 @@ function batchesToString(state: ToStringState, schema: Schema) { maxColWidths = state.maxColWidths; for (const row of batch) { if (state.closed) { break; } else if (!row) { continue; } - if (rowId++ % 350 === 0) { + if (rowId % 350 === 0) { this.push(`${formatRow(header, maxColWidths, sep)}\n`); } - this.push(`${formatRow([rowId, ...row.toArray()].map(v => valueToString(v)), maxColWidths, sep)}\n`); + this.push(`${formatRow([rowId++, ...row.toArray()].map(v => valueToString(v)), maxColWidths, sep)}\n`); } } cb();