Skip to content

Commit

Permalink
IPC test
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Sep 18, 2024
1 parent 3d85b19 commit b471d50
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/js/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import * as wasm from "../../pkg/node/parquet_wasm";

wasm.setPanicHook();

import "./read-write.test";
import "./ffi.test";
import "./geo-metadata.test";
import "./ipc.test";
import "./read-write.test";
import "./schema.test";
20 changes: 20 additions & 0 deletions tests/js/ipc.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { tableFromArrays, tableToIPC } from "apache-arrow";
import { setPanicHook, Table } from "../../pkg/node/parquet_wasm";
import { it } from "vitest";
import { writeFileSync } from "fs";

setPanicHook();

it("should read IPC stream correctly", async (t) => {
const table = tableFromArrays({
column: [
[1, 2],
[3, 4],
],
});
console.log(table.schema);
const ipc = tableToIPC(table, "stream");
writeFileSync("data.arrows", ipc);

Table.fromIPCStream(ipc);
});

0 comments on commit b471d50

Please sign in to comment.