Skip to content

Commit

Permalink
Merge pull request ironSource#30 from Aletheios/master
Browse files Browse the repository at this point in the history
Added ENUM to types
  • Loading branch information
ZJONSSON authored Sep 7, 2018
2 parents f19fd63 + 4c4f179 commit 9e123a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ const PARQUET_LOGICAL_TYPES = {
toPrimitive: toPrimitive_UTF8,
fromPrimitive: fromPrimitive_UTF8
},
'ENUM': {
primitiveType: 'BYTE_ARRAY',
originalType: 'UTF8',
toPrimitive: toPrimitive_UTF8,
fromPrimitive: fromPrimitive_UTF8
},
'TIME_MILLIS': {
primitiveType: 'INT32',
originalType: 'TIME_MILLIS',
Expand Down
5 changes: 5 additions & 0 deletions test/test-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ describe('test-files', function() {
assert.deepEqual(data,[{foo: 'bar'},{}]);
});

it('test-enum-type.parquet loads', async function() {
const data = await readData('test-enum-type.parquet');
assert.deepEqual(data,[{foo: 'bar'}]);
});

it('test-null-dictionary.parquet loads', async function() {
const data = await readData('test-null-dictionary.parquet');
assert.deepEqual(data,[].concat.apply([{}],[...Array(3)].map( () => ([{foo: 'bar'}, {foo: 'baz'}]))));
Expand Down
Binary file added test/test-files/test-enum-type.parquet
Binary file not shown.

0 comments on commit 9e123a3

Please sign in to comment.