[JS] Timestamp types are all the same

Open
#91 3 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
data

Research direction

Start by tracing the TimestampSecond, TimestampMillisecond, and TimestampNanosecond implementations, then follow the Date conversion path that raises the BigInt error. Compare the expected units and storage representation, and verify that second, millisecond, and nanosecond reads return the correct values without conversion failures.

Written by the indexing model from the issue text.

Description

Type: bug

Current timestamp types are all the same. They have the same representation. And also the same precision.

For example, TimestampSecond and TimestampMillisecond return the values as 1652118180000. Instead, I would expect the TimestampSecond to drop the 3 zeros when returning a value, e.g. 1652118180. Also, the representation underneath is still an int32 array. Even though for TimestampSecond every second value is 0, the array still has double the amount of integers.

I also got an error when trying to read a Date as TimestampNanosecond - TypeError: can't convert 1652118180000 to BigInt.

Reporter: Teodor Kostov

Note: This issue was originally created as ARROW-16543. Please see the migration documentation for further details.

Dominant language
TypeScript
Stars
114
Forks
35
Avg merge
13h 35m
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-js

All issues in apache/arrow-js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.