apache / apache/arrow-js

[JS] Timestamp types are all the same

Open
#91 3 comments 1 reaction 0 assignees View on GitHub
Type: bug
Dominant language
TypeScript
Stars
112
Forks
23
Avg merge
21h 18m
Merged PRs (30d)
8

Description

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](https://issues.apache.org/jira/browse/ARROW-16543)

**Note**: *This issue was originally created as [ARROW-16543](https://issues.apache.org/jira/browse/ARROW-16543). Please see the [migration documentation](https://github.com/apache/arrow/issues/14542) for further details.*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.