From b0e03f050888453c31e08d4234c212e3f2555b38 Mon Sep 17 00:00:00 2001 From: jheer Date: Tue, 15 Jun 2021 21:12:11 +0200 Subject: [PATCH] fix: Fix Arrow date millis builder. (#213) --- src/arrow/builder/date-millis-builder.js | 2 +- test/arrow/data-from-test.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/arrow/builder/date-millis-builder.js b/src/arrow/builder/date-millis-builder.js index 9d8aa487..a7f031b5 100644 --- a/src/arrow/builder/date-millis-builder.js +++ b/src/arrow/builder/date-millis-builder.js @@ -1,7 +1,7 @@ import { array } from './util'; export default function(type, length) { - const data = array(type.ArrayType, length); + const data = array(type.ArrayType, length << 1); return { set(value, index) { const i = index << 1; diff --git a/test/arrow/data-from-test.js b/test/arrow/data-from-test.js index 9ec722fd..17900b7b 100644 --- a/test/arrow/data-from-test.js +++ b/test/arrow/data-from-test.js @@ -38,7 +38,13 @@ function dateTest(t, type) { date(2000, 0, 1), date(2004, 10, 12), date(2007, 3, 14), - date(2009, 6, 26) + date(2009, 6, 26), + date(2000, 0, 1), + date(2004, 10, 12), + date(2007, 3, 14), + date(2009, 6, 26), + date(2000, 0, 1), + date(2004, 10, 12) ]; valueTest(t, type, values, ', without nulls'); valueTest(t, type, [null, ...values, undefined], ', with nulls');