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

Add support for new date, time data types #2550

Merged
merged 4 commits into from
Feb 28, 2025

Conversation

inv-jishnu
Copy link
Contributor

@inv-jishnu inv-jishnu commented Feb 24, 2025

Description

In this PR I have added support to newly added date and time data types in scalardb version 3.15 for data loader.

Related issues and/or PRs

NA

Changes made

Added support for the 4 new data types added in scalardb 3.15 in data export and import commands in data laoder.

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.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • 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)

This changes may not be needed for data loader versions below 3.15

Release notes

NA

@inv-jishnu inv-jishnu added the enhancement New feature or request label Feb 24, 2025
@inv-jishnu inv-jishnu marked this pull request as draft February 24, 2025 10:38
@ypeckstadt ypeckstadt marked this pull request as ready for review February 26, 2025 06:40
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

@Torch3333 Torch3333 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!

@@ -144,6 +145,18 @@ private String convertToString(Result result, String columnName, DataType dataTy
case TEXT:
value = result.getText(columnName);
break;
case DATE:
value = Objects.requireNonNull(result.getDate(columnName)).toString();
Copy link
Collaborator

@brfrn169 brfrn169 Feb 27, 2025

Choose a reason for hiding this comment

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

Since we already have the null check with result.isNull, I don't think we need to use Objects.requireNonNull() here. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brfrn169 san,
I added the Objects.requireNonNull() to fix a warning I saw when adding toString conversion (Method invocation 'toString' may produce 'NullPointerException' ) on IntelliJ. I have removed it.
Thank you.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I added the Objects.requireNonNull() to fix a warning I saw when adding toString conversion (Method invocation 'toString' may produce 'NullPointerException' ) on IntelliJ.

@inv-jishnu Okay, in that case, you can add assert as follows:

        LocalDate date = result.getDate(columnName);
        assert date != null;
        value = date.toString();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brfrn169 san,
Thank you.
I have updated the code as suggested.

@inv-jishnu inv-jishnu requested a review from brfrn169 February 27, 2025 06:31
@inv-jishnu
Copy link
Contributor Author

@brfrn169 san,
I have made changes based on your feedback.
Please take a look at this again when you get a chance.
Thank you.

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!

@ypeckstadt ypeckstadt merged commit 74c6925 into master Feb 28, 2025
48 checks passed
@ypeckstadt ypeckstadt deleted the feat/data-loader/add-time-based-type branch February 28, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants