forked from ZJONSSON/parquetjs
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note: The reference Brotli file doesn't work because it is too large. It decompresses to an extremely large size (1Gb+) Closes #140 Closes #125 (Likely?) A new brotli sample file was generated using python code seen below. ## What Changed? - Moved the esbuild work to mjs. This was required to get some of the builds working correctly - Fixed bug in the esbuild when it tried to build the browser code in parallel with the test code causing a race condition - Split the compression.ts file into a browser version and a node version - Swapped over to use `esbuild-plugin-wat` which worked better than the copy-pasted one from esbuild - Integrated the brotli-wasm correctly for browser, but used brotli natively in nodejs ## Testing! - There is a nodejs test for the node version - There is a browser test for it as well: 1. `npm i` 2. `npm run build:browser` 3. `npx serve .` 4. `open http://localhost:3000/test/browser/` in your preferred browser - The example server also has it: - cd examples/server/ - npm i - node app.js - cd ../../ && npm run serve - `open http://localhost:3000/` in your preferred browser ### Brotli Sample File generation script ```python import pandas as pd import pyarrow as pa import pyarrow.parquet as pq # Create a small sample DataFrame data = { 'id': [1, 2, 3, 4, 5], 'name': ['Alice', 'Bob', 'Charlie', 'David', 'Eve'], 'age': [25, 30, 35, 40, 45] } df = pd.DataFrame(data) # Convert DataFrame to PyArrow Table table = pa.Table.from_pandas(df) # Define output Parquet file path output_file = "sample_brotli_compressed.parquet" # Write to Parquet file with Brotli compression pq.write_table(table, output_file, compression='BROTLI') print(f"File {output_file} created successfully!") ``
- Loading branch information
Showing
24 changed files
with
903 additions
and
933 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ dist | |
!test/reference-test/files/*.parquet | ||
examples/server/package-lock.json | ||
test/browser/*.js | ||
main.js | ||
main.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import path from 'node:path'; | ||
/** | ||
* this plugin resolves to a browser version of compression.ts that uses different code for browsers | ||
*/ | ||
export const compressionBrowserPlugin = { | ||
name: 'compressionBrowser', | ||
setup(build) { | ||
build.onResolve({ filter: /^\.\/compression$/ }, (args) => { | ||
return { path: path.join(args.resolveDir, args.path.replace('compression', 'browser/compression.ts')) }; | ||
}); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Buffer as buffer } from 'buffer/'; | ||
export let Buffer = buffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.