Skip to content

Commit

Permalink
start rowId from 0 instead of 1
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Dec 7, 2022
1 parent e4d83f2 commit 3b9d18c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/src/bin/arrow2csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3b9d18c

Please sign in to comment.