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

Change DATE type encoding to integer #2491

Merged
merged 1 commit into from
Jan 31, 2025
Merged

Conversation

Torch3333
Copy link
Contributor

@Torch3333 Torch3333 commented Jan 30, 2025

Description

The DATE type value was encoded as a long for DynamoDB, Cosmos DB, and SQLite. But since the full range of DATE values fits into an int, we change the encoding type from long to int

Related issues and/or PRs

Changes made

Updates the DynamoDB, CosmosDB, and SQLite adapters to encode DATE value as int instead of long

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

Release notes

Same as #2468

@Torch3333 Torch3333 self-assigned this Jan 30, 2025
Comment on lines +25 to +26
public static int encode(LocalDate date) {
return Math.toIntExact(date.toEpochDay());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Encode DATE value as int instead of long

@Torch3333 Torch3333 marked this pull request as ready for review January 30, 2025 03:05
Copy link
Collaborator

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

I've updated the release note.

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@feeblefakie feeblefakie merged commit 9cb1867 into master Jan 31, 2025
48 checks passed
@feeblefakie feeblefakie deleted the encode_date_as_int branch January 31, 2025 03:59
Torch3333 added a commit that referenced this pull request Jan 31, 2025
# Conflicts:
#	core/src/test/java/com/scalar/db/storage/jdbc/JdbcAdminTestBase.java
Torch3333 added a commit that referenced this pull request Jan 31, 2025
# Conflicts:
#	core/src/test/java/com/scalar/db/storage/jdbc/JdbcAdminTestBase.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants