Skip to content
Merged
Show file tree
Hide file tree
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
1,617 changes: 25 additions & 1,592 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"devDependencies": {
"@rollup/plugin-terser": "^0.4.4",
"apache-arrow": "^21.1.0",
"duckdb": "~1.1.3",
"eslint": "^9.39.2",
"mocha": "^11.7.5",
"rimraf": "^6.1.2",
Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ export interface Message {
*/
export interface Block {
/** The file byte offset to the message start. */
offset: number,
offset: number;
/** The size of the message header metadata. */
metadataLength: number,
metadataLength: number;
/** The size of the message body. */
bodyLength: number
bodyLength: number;
}

/**
Expand Down
Binary file added test/data/bigint.arrows
Binary file not shown.
Binary file added test/data/bool_0.arrows
Binary file not shown.
Binary file added test/data/bool_1.arrows
Binary file not shown.
Binary file added test/data/dateDay_0.arrows
Binary file not shown.
Binary file added test/data/dateDay_1.arrows
Binary file not shown.
Binary file added test/data/decimal_0.arrows
Binary file not shown.
Binary file added test/data/decimal_1.arrows
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added test/data/fixedListInt32_0.arrows
Binary file not shown.
Binary file added test/data/fixedListInt32_1.arrows
Binary file not shown.
Binary file added test/data/fixedListInt32_2.arrows
Binary file not shown.
Binary file added test/data/fixedListUtf8_0.arrows
Binary file not shown.
Binary file added test/data/fixedListUtf8_1.arrows
Binary file not shown.
Binary file added test/data/fixedListUtf8_2.arrows
Binary file not shown.
Binary file added test/data/float32_0.arrows
Binary file not shown.
Binary file added test/data/float32_1.arrows
Binary file not shown.
Binary file added test/data/float64_0.arrows
Binary file not shown.
Binary file added test/data/float64_1.arrows
Binary file not shown.
Binary file added test/data/int16_0.arrows
Binary file not shown.
Binary file added test/data/int16_1.arrows
Binary file not shown.
Binary file added test/data/int32_0.arrows
Binary file not shown.
Binary file added test/data/int32_1.arrows
Binary file not shown.
Binary file added test/data/int64_0.arrows
Binary file not shown.
Binary file added test/data/int64_1.arrows
Binary file not shown.
Binary file added test/data/int8_0.arrows
Binary file not shown.
Binary file added test/data/int8_1.arrows
Binary file not shown.
Binary file added test/data/intervalMonthDayNano_0.arrows
Binary file not shown.
Binary file added test/data/listInt32_0.arrows
Binary file not shown.
Binary file added test/data/listInt32_1.arrows
Binary file not shown.
Binary file added test/data/listInt32_2.arrows
Binary file not shown.
Binary file added test/data/listUtf8_0.arrows
Binary file not shown.
Binary file added test/data/listUtf8_1.arrows
Binary file not shown.
Binary file added test/data/listUtf8_2.arrows
Binary file not shown.
Binary file added test/data/map_0.arrows
Binary file not shown.
Binary file added test/data/struct_0.arrows
Binary file not shown.
Binary file added test/data/struct_1.arrows
Binary file not shown.
Binary file added test/data/struct_2.arrows
Binary file not shown.
Binary file added test/data/struct_3.arrows
Binary file not shown.
Binary file added test/data/table.arrows
Binary file not shown.
Binary file added test/data/timestampMicrosecond_0.arrows
Binary file not shown.
Binary file added test/data/timestampMicrosecond_1.arrows
Binary file not shown.
Binary file added test/data/timestampMillisecond_0.arrows
Binary file not shown.
Binary file added test/data/timestampMillisecond_1.arrows
Binary file not shown.
Binary file added test/data/timestampNanosecond_0.arrows
Binary file not shown.
Binary file added test/data/timestampNanosecond_1.arrows
Binary file not shown.
Binary file added test/data/timestampSecond_0.arrows
Binary file not shown.
Binary file added test/data/timestampSecond_1.arrows
Binary file not shown.
Binary file added test/data/uint16_0.arrows
Binary file not shown.
Binary file added test/data/uint16_1.arrows
Binary file not shown.
Binary file added test/data/uint32_0.arrows
Binary file not shown.
Binary file added test/data/uint32_1.arrows
Binary file not shown.
Binary file added test/data/uint64_0.arrows
Binary file not shown.
Binary file added test/data/uint64_1.arrows
Binary file not shown.
Binary file added test/data/uint8_0.arrows
Binary file not shown.
Binary file added test/data/uint8_1.arrows
Binary file not shown.
Binary file added test/data/union_0.arrows
Binary file not shown.
Binary file added test/data/union_1.arrows
Binary file not shown.
Binary file added test/data/utf8_0.arrows
Binary file not shown.
Binary file added test/data/utf8_1.arrows
Binary file not shown.
4 changes: 2 additions & 2 deletions test/decode-ipc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { decimalDataDecoded } from './util/decimal.js';

describe('decodeIPC', () => {
it('decodes arrow file format', async () => {
const buffer = await readFile(`test/data/decimal.arrow`);
const buffer = await readFile(`test/data/decimal_test.arrow`);
const bytes = new Uint8Array(buffer);
const expect = decimalDataDecoded();
assert.deepEqual(decodeIPC(buffer), expect, 'Node Buffer');
Expand All @@ -14,7 +14,7 @@ describe('decodeIPC', () => {
});

it('decodes arrow stream format', async () => {
const buffer = await readFile(`test/data/decimal.arrows`);
const buffer = await readFile(`test/data/decimal_test.arrows`);
const bytes = new Uint8Array(buffer);
const expect = decimalDataDecoded();
assert.deepEqual(decodeIPC(buffer), expect, 'Node Buffer');
Expand Down
44 changes: 0 additions & 44 deletions test/duckdb-compat-test.js

This file was deleted.

4 changes: 2 additions & 2 deletions test/table-from-ipc-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert';
import { readFile } from 'node:fs/promises';
import { tableFromIPC } from '../src/index.js';
import { arrowFromDuckDB } from './util/arrow-from-duckdb.js';
import { binaryView, bool, dateDay, decimal, decimal32, decimal128, decimal256, decimal64, empty, fixedListInt32, fixedListUtf8, float32, float64, int16, int32, int64, int8, intervalMonthDayNano, largeListView, listInt32, listUtf8, listView, map, runEndEncoded32, runEndEncoded64, struct, timestampMicrosecond, timestampMillisecond, timestampNanosecond, timestampSecond, uint16, uint32, uint64, uint8, union, utf8, utf8View } from './util/data.js';
import { RowIndex } from '../src/util/struct.js';

Expand Down Expand Up @@ -46,7 +46,7 @@ describe('tableFromIPC', () => {
BigInt(Number.MAX_SAFE_INTEGER) - 1n,
BigInt(Number.MAX_SAFE_INTEGER) + 1n
];
const bytes = await arrowFromDuckDB(values, 'BIGINT');
const bytes = new Uint8Array(await readFile(`test/data/bigint.arrows`));

// coerced to numbers
assert.throws(() => tableFromIPC(bytes).getChild('value').toArray());
Expand Down
20 changes: 11 additions & 9 deletions test/table-test.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/** @import { ValueArray } from '../src/types.js' */
import assert from 'node:assert';
import { arrowFromDuckDB } from './util/arrow-from-duckdb.js';
import { readFile } from 'node:fs/promises';
import { tableFromIPC } from '../src/index.js';
import { Table } from '../src/table.js';

const values = [
{a: 1, b: 'foo', c: [1, null, 3] },
null,
{a: 2, b: 'baz', c: [null, 5, 6] }
];
describe('Table', async () => {
const values = [
{a: 1, b: 'foo', c: [1, null, 3] },
null,
{a: 2, b: 'baz', c: [null, 5, 6] }
];

/** @type {Table<{ value: { a: number, b: string, c: ValueArray<number | null> }> }} */
const table = tableFromIPC(await arrowFromDuckDB(values));
const bytes = new Uint8Array(await readFile(`test/data/table.arrows`));

/** @type {Table<{ value: { a: number, b: string, c: ValueArray<number | null> }> }} */
const table = tableFromIPC(bytes);

describe('Table', () => {
it('provides row count', () => {
assert.deepStrictEqual(table.numRows, 3);
});
Expand Down
2 changes: 1 addition & 1 deletion test/table-to-ipc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const files = [
'flights.arrows',
'scrabble.arrows',
'convert.arrows',
'decimal.arrows'
'decimal_test.arrows'
];

describe('tableToIPC', () => {
Expand Down
40 changes: 0 additions & 40 deletions test/util/arrow-from-duckdb.js

This file was deleted.

Loading