From e3b3ddafa77b9171fb88cff74d49b5b5ccd95d55 Mon Sep 17 00:00:00 2001 From: Kenny Daniel Date: Wed, 3 Apr 2024 13:30:08 -0700 Subject: [PATCH] Add parquetRead example to README --- README.md | 17 ++++++++++++++++- package.json | 8 ++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3981b8c..fcf2423 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,20 @@ const metadata = parquetMetadata(arrayBuffer) To parse parquet files from a user drag-and-drop action, see example in [index.html](index.html). +## Reading Data + +To read the entire contents of a parquet file in a browser environment: + +```js +const { parquetRead } = await import("https://cdn.jsdelivr.net/npm/hyparquet/src/hyparquet.min.js") +const res = await fetch(url) +const arrayBuffer = await res.arrayBuffer() +await parquetRead({ + file: arrayBuffer, + onComplete: data => console.log(data) +}) +``` + ## Async Hyparquet supports asynchronous fetching of parquet files, over a network. @@ -76,7 +90,8 @@ You can provide an `AsyncBuffer` which is like a js `ArrayBuffer` but the `slice ## Supported Parquet Files -The parquet format supports a number of different compression and encoding types. +The parquet format is known to be a sprawling format which includes options for a wide array of compression schemes, encoding types, and data structures. + Hyparquet does not support 100% of all parquet files. Supporting every possible compression codec available in parquet would blow up the size of the hyparquet library. In practice, most parquet files use snappy compression. diff --git a/package.json b/package.json index 6905dc5..f4d4945 100644 --- a/package.json +++ b/package.json @@ -27,15 +27,15 @@ "typecheck": "tsc" }, "devDependencies": { - "@types/node": "20.11.30", - "@typescript-eslint/eslint-plugin": "7.3.1", + "@types/node": "20.12.3", + "@typescript-eslint/eslint-plugin": "7.5.0", "@vitest/coverage-v8": "1.4.0", "eslint": "8.57.0", "eslint-plugin-import": "2.29.1", - "eslint-plugin-jsdoc": "48.2.1", + "eslint-plugin-jsdoc": "48.2.2", "http-server": "14.1.1", "hysnappy": "0.3.0", - "typescript": "5.4.2", + "typescript": "5.4.3", "vitest": "1.4.0" } }