parquet file parser for javascript
Go to file
2024-01-12 14:36:50 -08:00
.github/workflows Run github actions in parallel 2024-01-08 10:13:06 -08:00
src Include metadata length in metadata 2024-01-12 14:36:50 -08:00
test Include metadata length in metadata 2024-01-12 14:36:50 -08:00
.eslintrc.json Parquet data page parser 2024-01-07 15:33:24 -08:00
.gitignore Test coverage 2023-12-29 11:19:16 -08:00
hyparquet.jpg hyparakeet 2023-12-29 12:12:30 -08:00
index.html Update demo styles 2024-01-11 15:20:53 -08:00
LICENSE Initial commit 2023-12-29 10:32:36 -08:00
package.json Include metadata length in metadata 2024-01-12 14:36:50 -08:00
README.md Dependencies: 0 2024-01-11 10:46:23 -08:00
tsconfig.json All javascript, no typescript 2024-01-04 11:11:00 -08:00

hyparquet

hyparquet

npm workflow status mit license dependencies

JavaScript parser for Apache Parquet files.

Apache Parquet is an open source, column-oriented data file format designed for efficient data storage and retrieval.

Dependency free since 2023!

Features

  • Designed to work with huge ML datasets (things like starcoder)
  • Loads metadata separately from data
  • Data can be filtered by row and column ranges
  • Only fetches the data needed
  • Fast data loading for large scale ML applications
  • Bring data visualization closer to the user, in the browser

Installation

npm install hyparquet

Usage

If you're in a node.js environment, you can load a parquet file with the following example:

const { parquetMetadata } = await import('hyparquet')
const fs = await import('fs')

const buffer = fs.readFileSync('example.parquet')
const arrayBuffer = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength)
const metadata = parquetMetadata(arrayBuffer)

If you're in a browser environment, you'll probably get parquet file data from either a drag-and-dropped file from the user, or downloaded from the web.

To load parquet data in the browser from a remote server using fetch:

import { parquetMetadata } from 'hyparquet'

const res = await fetch(url)
const arrayBuffer = await res.arrayBuffer()
const metadata = parquetMetadata(arrayBuffer)

To parse parquet files from a user drag-and-drop action, see example in index.html.

References