mirror of
https://github.com/asadbek064/hyparquet-compressors.git
synced 2026-01-11 21:26:38 +00:00
Fix brotli import
This commit is contained in:
parent
c73ac7e5b7
commit
b118b40575
10
README.md
10
README.md
@ -11,6 +11,8 @@ This package exports a `compressors` object intended to be passed into [hyparque
|
||||
|
||||
The hyparquet library by default only supports `uncompressed` and `snappy` compressed files. The `hyparquet-compressors` package extends support for all legal parquet compression formats.
|
||||
|
||||
The `hyparquet-compressors` package works in both node.js and the browser. Uses js and wasm packages, no system dependencies.
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
@ -20,6 +22,8 @@ import { compressors } from 'hyparquet-compressors'
|
||||
await parquetRead({ file, compressors, onComplete: console.log })
|
||||
```
|
||||
|
||||
See [hyparquet](https://github.com/hyparam/hyparquet) repo for further info.
|
||||
|
||||
# Supported compression formats
|
||||
|
||||
Parquet compression types supported with `hyparquet-compressors`:
|
||||
@ -35,6 +39,12 @@ Parquet compression types supported with `hyparquet-compressors`:
|
||||
# References
|
||||
|
||||
- https://parquet.apache.org/docs/file-format/data-pages/compression/
|
||||
- https://en.wikipedia.org/wiki/Brotli
|
||||
- https://en.wikipedia.org/wiki/Gzip
|
||||
- https://en.wikipedia.org/wiki/LZ4_(compression_algorithm)
|
||||
- https://en.wikipedia.org/wiki/Snappy_(compression)
|
||||
- https://en.wikipedia.org/wiki/Zstd
|
||||
- https://github.com/101arrowz/fzstd
|
||||
- https://github.com/foliojs/brotli.js
|
||||
- https://github.com/hyparam/hysnappy
|
||||
- https://github.com/nodeca/pako
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
// @ts-ignore
|
||||
import BROTLI from 'brotli/decompress'
|
||||
import BROTLI from 'brotli/decompress.js'
|
||||
import { decompress as ZSTD } from 'fzstd'
|
||||
import { snappyUncompressor } from 'hysnappy'
|
||||
import pako from 'pako'
|
||||
@ -11,6 +10,7 @@ import { LZ4, LZ4_RAW } from './lz4.js'
|
||||
export const compressors = {
|
||||
SNAPPY: snappyUncompressor(),
|
||||
GZIP: input => pako.ungzip(input),
|
||||
// @ts-expect-error brotli expects Buffer but Uint8Array works
|
||||
BROTLI,
|
||||
ZSTD: input => ZSTD(input),
|
||||
LZ4,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user