# Working with Arrow in TypeScript

Apache Arrow IPC file handling for columnar data.

## Installation

```bash
npm install fairspec
```

## Getting Started

The Arrow plugin provides:

- `loadArrowTable` - Load Arrow IPC files into tables
- `saveArrowTable` - Save tables to Arrow IPC files
- `ArrowPlugin` - Plugin for framework integration

For example:

```typescript
import { loadArrowTable } from "fairspec"

const table = await loadArrowTable({ data: "table.arrow" })
// High-performance columnar format
```

Loaders return a nodejs-polars `LazyDataFrame`: call `.collect()` to get a `DataFrame`. Savers take any `LazyDataFrame`, so pass `df.lazy()` to save a `DataFrame`.

## Basic Usage

### Loading Arrow Files

```typescript
import { loadArrowTable } from "fairspec"

// Load from local file
const local = await loadArrowTable({ data: "data.arrow" })

// Load from remote URL
const remote = await loadArrowTable({
  data: "https://example.com/data.arrow",
})

// Load multiple files (concatenated)
const combined = await loadArrowTable({
  data: ["file1.arrow", "file2.arrow"],
})
```

### Saving Arrow Files

```typescript
import { saveArrowTable } from "fairspec"

// Save with default options
await saveArrowTable(table, { path: "output.arrow" })

// Save with explicit format
await saveArrowTable(table, {
  path: "output.arrow",
  fileDialect: { format: "arrow" },
})
```

## Advanced Features

### Remote File Loading

```typescript
import { loadArrowTable } from "fairspec"

// Load from URL
const remote = await loadArrowTable({
  data: "https://example.com/data.arrow",
})

// Load multiple remote files
const remoteParts = await loadArrowTable({
  data: [
    "https://api.example.com/data-2023.arrow",
    "https://api.example.com/data-2024.arrow",
  ],
})
```
