LibertyDSNP / parquetjs

Fully asynchronous, pure JavaScript implementation of the Parquet file format with additional features
MIT License
43 stars 24 forks source link

RLE example does not work - 'bitWidth' does not exist in type 'FieldDefinition' #106

Closed benjamin-brady closed 5 months ago

benjamin-brady commented 6 months ago

Steps to reproduce

import parquetjs from "@dsnp/parquetjs"
var schema1 = new parquetjs.ParquetSchema({
age: { type: 'UINT_32', encoding: 'RLE', bitWidth: 7 },
});

Expected behaviour

It should at least compile.

Actual behaviour

Error because there is no bitWidth property on the FieldDefinition type.

Object literal may only specify known properties, and 'bitWidth' does not exist in type 'FieldDefinition'.ts(2353)
declare.d.ts(14, 5): 
The expected type comes from this index signature.
(property) bitWidth: number
wilwade commented 6 months ago

@benjamin-brady Looks like there was an upstream doc issue.

tldr: Use typeLength instead of bitWidth

https://github.com/ironSource/parquetjs/issues/100

I'll put up a PR to fix it with a simple test as well.