Skip to content

Commit

Permalink
remove brotli compression
Browse files Browse the repository at this point in the history
Brotli compression was causing jest tests to hang simply by its inclusion.

It was not obvious how to resolve since much of brotli includes transpiled js. Since brotli was not needed for our use cases it was removed.
  • Loading branch information
jeffbski-rga committed Oct 29, 2019
1 parent 5d65786 commit 6a70c3e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 43 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ the [Parquet](https://parquet.apache.org/) file format. The implementation confo
[Parquet specification](https://github.com/apache/parquet-format) and is tested
for compatibility with Apache's Java [reference implementation](https://github.com/apache/parquet-mr).

This fork removed the lzo compression/decompression capability since it required on a compiled package `lzo`.
This fork removed the lzo compression/decompression capability since it required on a compiled package `lzo`. Brotli is also removed since it was causing hanging test in jest.

**What is Parquet?**: Parquet is a column-oriented file format; it allows you to
write a large amount of structured data to a file, compress it and then read parts
Expand Down Expand Up @@ -170,10 +170,11 @@ Compression
- UNCOMPRESSED - this is the default
- GZIP
- SNAPPY
- BROTLI

LZO compression is not supported in @jeffbski/parquetjs since it requires the lzo package which builds a binary node.js extension. To use LZO use the original `parquetjs` package.

BROTLI compression is also removed since it was causing hang in jest tests.

```js
var schema = new parquet.ParquetSchema({
age: { type: 'UINT_32', compression: 'SNAPPY' }
Expand Down
4 changes: 1 addition & 3 deletions gen-nodejs/parquet_types.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions lib/compression.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';
const zlib = require('zlib');
const snappy = require('snappyjs');
const brotli = require('brotli');

const PARQUET_COMPRESSION_METHODS = {
'UNCOMPRESSED': {
Expand All @@ -15,10 +14,6 @@ const PARQUET_COMPRESSION_METHODS = {
'SNAPPY': {
deflate: deflate_snappy,
inflate: inflate_snappy
},
'BROTLI': {
deflate: deflate_brotli,
inflate: inflate_brotli
}
};

Expand All @@ -45,14 +40,6 @@ function deflate_snappy(value) {
return snappy.compress(value);
}

function deflate_brotli(value) {
return new Buffer(brotli.compress(value, {
mode: 0,
quality: 8,
lgwin: 22
}));
}

/**
* Inflate a value using compression method `method`
*/
Expand All @@ -76,9 +63,5 @@ function inflate_snappy(value) {
return snappy.uncompress(value);
}

function inflate_brotli(value) {
return new Buffer(brotli.decompress(value));
}

module.exports = { PARQUET_COMPRESSION_METHODS, deflate, inflate };

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"url": "git://github.com/jeffbski/parquetjs.git"
},
"dependencies": {
"brotli": "^1.3.0",
"bson": "^1.0.4",
"int53": "^0.2.4",
"object-stream": "0.0.1",
Expand Down
20 changes: 0 additions & 20 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,26 +335,6 @@ describe('Parquet', function() {
return writeTestFile(opts).then(readTestFile);
});

// it('write a test file with LZO compression', function() {
// const opts = { useDataPageV2: true, compression: 'LZO' };
// return writeTestFile(opts);
// });

// it('write a test file with LZO compression and then read it back', function() {
// const opts = { useDataPageV2: true, compression: 'LZO' };
// return writeTestFile(opts).then(readTestFile);
// });

it('write a test file with BROTLI compression', function() {
const opts = { useDataPageV2: true, compression: 'BROTLI' };
return writeTestFile(opts);
});

it('write a test file with BROTLI compression and then read it back', function() {
const opts = { useDataPageV2: true, compression: 'BROTLI' };
return writeTestFile(opts).then(readTestFile);
});

});

describe('using the Stream/Transform API', function() {
Expand Down

0 comments on commit 6a70c3e

Please sign in to comment.