Working with Arrow in TypeScript
Apache Arrow IPC file handling with high-performance columnar data processing.
Installation
Section titled “Installation”npm install fairspecGetting Started
Section titled “Getting Started”The Arrow plugin provides:
loadArrowTable- Load Arrow IPC files into tablessaveArrowTable- Save tables to Arrow IPC filesArrowPlugin- Plugin for framework integration
For example:
import { loadArrowTable } from "fairspec"
const table = await loadArrowTable({ data: "table.arrow" })// High-performance columnar formatBasic Usage
Section titled “Basic Usage”Loading Arrow Files
Section titled “Loading Arrow Files”import { loadArrowTable } from "fairspec"
// Load from local fileconst table = await loadArrowTable({ data: "data.arrow" })
// Load from remote URLconst table = await loadArrowTable({ data: "https://example.com/data.arrow"})
// Load multiple files (concatenated)const table = await loadArrowTable({ data: ["file1.arrow", "file2.arrow"]})Saving Arrow Files
Section titled “Saving Arrow Files”import { saveArrowTable } from "fairspec"
// Save with default optionsawait saveArrowTable(table, { path: "output.arrow" })
// Save with explicit formatawait saveArrowTable(table, { path: "output.arrow", format: { name: "arrow" }})Advanced Features
Section titled “Advanced Features”Remote File Loading
Section titled “Remote File Loading”// Load from URLconst table = await loadArrowTable({ data: "https://example.com/data.arrow"})
// Load multiple remote filesconst table = await loadArrowTable({ data: [ "https://api.example.com/data-2023.arrow", "https://api.example.com/data-2024.arrow" ]})