Hyparquet is a pure JavaScript library for parsing Apache Parquet files directly in web browsers and Node.js environments. It specializes in efficient data retrieval from cloud storage by leveraging HTTP range requests, allowing for direct querying of Parquet files over the network without requiring a server-side intermediary. The library is dependency-free since 2023, offering a lightweight solution. Its current stable version is 1.25.6, with a release cadence that follows active development. Key differentiators include its ability to minimize data fetches through selective row and column filtering, comprehensive support for all Parquet types, encodings, and compression codecs, and inclusion of TypeScript definitions for improved developer experience. It is particularly well-suited for data engineering, data science, and machine learning applications where large datasets stored in Parquet format need to be accessed and processed client-side.
npm install hyparquetVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to fetch and parse a remote Parquet file in a browser or Node.js using HTTP range requests, filtering for specific columns and rows.
Use ESM import statements (e.g., `import { ... } from 'hyparquet'`) or dynamic `import()` for compatibility with older Node.js versions. Configure your project to handle ES modules.Ensure your HTTP server (e.g., S3, Google Cloud Storage) is configured to handle `Range` headers for partial content requests. Test with small files first.
Convert `BigInt` values to `Number` using `Number(metadata.num_rows)` when working with smaller numbers, or ensure your application logic correctly handles `BigInt` types for large row counts.
Define `columns` to specify only the needed columns and `rowStart`/`rowEnd` to limit the row range, reducing network bandwidth and parsing overhead. Example: `parquetReadObjects({ file, columns: ['col1'], rowStart: 0, rowEnd: 100 })`.Change `const { ... } = require('hyparquet')` to `import { ... } from 'hyparquet'`. Ensure your Node.js project or bundler is configured for ES modules (e.g., 'type': 'module' in package.json or using .mjs extension).Ensure `file` is created using `asyncBufferFromUrl({ url })` for remote files or `asyncBufferFromFile('path/to/file.parquet')` for local Node.js files, or provide a custom object implementing the `AsyncBuffer` interface correctly.Verify the integrity and structure of your Parquet file. Ensure the `parquetSchema` function is used correctly, and its output (e.g., `schema.children`) is what you expect to iterate over. Inspect `metadata` and `schema` objects before mapping.
No dependency data recorded yet.