Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added timestamp support #1884

Open
wants to merge 31 commits into
base: SNOW-873466-arrow-batches
Choose a base branch
from

Conversation

sfc-gh-astachowski
Copy link
Collaborator

Overview

Added tmestamp support

Pre-review self checklist

  • The code is correctly formatted (run mvn -P check-style validate)
  • New public API is not unnecessary exposed (run mvn verify and inspect target/japicmp/japicmp.html)
  • The pull request name is prefixed with SNOW-XXXX:
  • Code is in compliance with internal logging requirements

@sfc-gh-astachowski sfc-gh-astachowski marked this pull request as ready for review September 3, 2024 14:22
@sfc-gh-astachowski sfc-gh-astachowski requested a review from a team as a code owner September 3, 2024 14:22
private ValueVector vector;
private DataConversionContext context;
private TimeZone timeZoneToUse;
private boolean isNTZ;
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO it would be better to have a boolean switched - isTZ. It seems that it would be more user-friendly as the timeZoneToUse is just next to the bool.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

isNTZ is used to distinguish between LTZ and NTZ cases - isTZ would be more confusing here I think. I'd go with just adding some comments here to clarify what these mean

vector.allocateNew(length);
vector.setValueCount(length);
for (int i = 0; i < length; i++) {
vector.set(i, 1440);
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about defining the const for TZ offset?

offsets.set(
i,
1440
+ timeZone.getOffset(seconds.get(i) * 1000 + fractions.get(i) / 1000000)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we define & use consts for these calculations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, forgot to do that after initial testing

…e-types

# Conflicts:
#	src/main/java/net/snowflake/client/core/arrow/fullvectorconverters/ArrowFullVectorConverter.java
#	src/main/java/net/snowflake/client/jdbc/ArrowResultChunk.java
Base automatically changed from arrow-batches-all-simple-types to SNOW-873466-arrow-batches September 20, 2024 08:10
…stamps

# Conflicts:
#	src/main/java/net/snowflake/client/core/arrow/fullvectorconverters/ArrowFullVectorConverter.java
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.

2 participants