ZJONSSON / parquetjs

fully asynchronous, pure JavaScript implementation of the Parquet file format
MIT License
34 stars 61 forks source link

fromPrimitive_TIMESTAMP_MICROS bug (TypeError when dividing a string by BigInt) #58

Open Irelynx opened 3 years ago

Irelynx commented 3 years ago

Hello!

I am trying to read some parquet files containing timestamps in micro-seconds, but cursor.next() throws an TypeError: Cannot mix BigInt and other types, use explicit conversions

In fromPrimitive_TIMESTAMP_MICROS(value: String): Date, value (string) divided by 1000n (BigInt), which causes this TypeError.

I am using Node v12.19.1 on Windows 10 (i think OS doesn't matter here..)

ena-so commented 2 years ago

I'm also having the same issue. When I try to iterate through the cursor it says "Cannot mix BigInt and other types, use explicit conversions".

This is what I get when I print the TIMESTAMP unit from the schema object. { MILLIS: null, MICROS: {} }

Here is the full schema of the column

{
  type: 2,
  type_length: null,
  repetition_type: 1,
  name: 'timestamp',
  num_children: null,
  converted_type: 10,
  scale: null,
  precision: null,
  field_id: null,
  logicalType: {
    STRING: null,
    MAP: null,
    LIST: null,
    ENUM: null,
    DECIMAL: null,
    DATE: null,
    TIME: null,
    TIMESTAMP: { isAdjustedToUTC: false, unit: [Object] },
    INTEGER: null,
    UNKNOWN: null,
    JSON: null,
    BSON: null
  }
}
benheb commented 2 years ago

Anyone find a solution here?