Skip to content

Conversation

@j4ys0n
Copy link

@j4ys0n j4ys0n commented Mar 15, 2025

Problem

There's currently no way to handle INT96 timestamps.

Closes #158

Solution

add a flag to enable treating all INT96 fields in a file as timestamps.

Change summary:

const reader = await ParquetReader.openFile('your-file.parquet', { 
  treatInt96AsTimestamp: true 
})

Steps to Verify:

npm test -- -g "INT96 timestamp handling"

  INT96 timestamp handling
    ✔ should handle INT96 values as numbers by default (4593ms)
block_timestamp timestamp: 2016-05-22T08:22:02.000Z
last_modified timestamp: 2022-09-12T01:05:04.629Z
    ✔ should convert INT96 values to timestamps when option is enabled (3125ms)

@j4ys0n j4ys0n changed the title add capability and option flag to treat in96 as a timestamp add capability and option flag to treat int96 as a timestamp Mar 15, 2025
@wilwade wilwade requested a review from shannonwells March 17, 2025 18:54
@wilwade wilwade enabled auto-merge (squash) March 17, 2025 18:56
@shannonwells shannonwells self-assigned this Mar 17, 2025
Copy link

@shannonwells shannonwells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests may not pull from real endpoints. The functional changes look good though, thank you.

this.timeout(30000); // Increase timeout for URL fetching

const testUrl =
'https://aws-public-blockchain.s3.us-east-2.amazonaws.com/v1.0/eth/traces/date%3D2016-05-22/part-00000-54f4b70c-db10-479c-a117-e3cc760a7e26-c000.snappy.parquet';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change this to read in a small reference file (<10-20kb) that is checked into test/test-files, with or without an S3 mock client as in test/reader.js

Copy link
Author

@j4ys0n j4ys0n Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah.. i don't have this. i have that file. thousands of them, actually. 🙃
but, on the bright side, at least i wrote tests this time! 😄

Copy link

@shannonwells shannonwells Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, if you can truncate one of your files and check it into the PR that'd be much appreciated. if that's not possible let us know.

auto-merge was automatically disabled March 18, 2025 01:41

Head branch was pushed to by a user without write access

Copy link

@shannonwells shannonwells left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this change so I'm approving and will set an issue to add a small test file.

@shannonwells shannonwells merged commit 41e3a9e into LibertyDSNP:main May 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

INT96 blindly truncated upon decoding?

2 participants