Skip to content

Commit

Permalink
Clean up dependencies and remove lodash (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
wilwade authored Aug 17, 2021
1 parent 81e38e4 commit 98871a2
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 84 deletions.
9 changes: 5 additions & 4 deletions lib/reader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
'use strict';
const fs = require('fs');
const thrift = require('thrift');
const Int64 = require('node-int64');
const parquet_thrift = require('../gen-nodejs/parquet_types')
const parquet_shredder = require('./shred')
Expand All @@ -11,7 +9,6 @@ const parquet_compression = require('./compression')
const parquet_types = require('./types');
const BufferReader = require('./bufferReader');
const bloomFilterReader = require('./bloomFilterIO/bloomFilterReader');
const groupBy = require("lodash/groupBy");
const fetch = require('cross-fetch');

const {
Expand Down Expand Up @@ -235,7 +232,11 @@ class ParquetReader {

async getBloomFiltersFor(columnNames) {
const bloomFilterData = await getBloomFiltersFor(columnNames, this.envelopeReader);
return groupBy(bloomFilterData, 'columnName');
return bloomFilterData.reduce((acc, value) => {
if (acc[value.columnName]) acc[value.columnName].push(value)
else acc[value.columnName] = [value]
return acc;
}, {});
}

/**
Expand Down
Loading

0 comments on commit 98871a2

Please sign in to comment.