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

Fix createTimestampVector without nulls buffer #8955

Closed
wants to merge 1 commit into from

Conversation

rui-mo
Copy link
Collaborator

@rui-mo rui-mo commented Mar 5, 2024

This PR fixes the failure of createTimestampVector when nulls buffer is
nullptr.
#7625 (comment)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 5, 2024
Copy link

netlify bot commented Mar 5, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 16adc9f
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/65e861f26b00b60009cb610b


auto output = importFromArrow(arrowSchema1, arrowArray1, pool_.get());
assertVectorContent(inputValues, output, arrowArray1.null_count);
if constexpr (std::is_same_v<TOutput, Timestamp>) {
std::vector<std::optional<Timestamp>> expectedValues;
Copy link
Contributor

Choose a reason for hiding this comment

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

Overall LGTM.
nit: it would be better to extract the detail of this brach to a separate function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated. Thanks.

@rui-mo rui-mo force-pushed the wip_ts_vector branch 2 times, most recently from 0027168 to 9e8fda9 Compare March 5, 2024 09:48
@rui-mo
Copy link
Collaborator Author

rui-mo commented Mar 5, 2024

Hi @mbasmanova @Yuhta, would you like to review this PR? Thanks.

@mbasmanova mbasmanova requested review from Yuhta and pedroerp March 5, 2024 13:23
Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

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

@Yuhta Jimmy, would you help review this PR?

@@ -1135,38 +1135,45 @@ class ArrowBridgeArrayImportTest : public ArrowBridgeArrayExportTest {
"ttn", {Timestamp(0, 0), std::nullopt, Timestamp(1699308257, 1234)});
}

void testImportWithoutNullsBuffer() {
std::vector<std::optional<int64_t>> inputValues = {1, 2, 3, 4, 5};
template <typename TInput, typename TOutput>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: TInput can be inferred from inputValues so we can move it to end of the type parameter list and omit it at call sites.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for your suggestion. Updated.

@rui-mo rui-mo force-pushed the wip_ts_vector branch 2 times, most recently from 9528e9b to 6ecdbb6 Compare March 6, 2024 01:26
@facebook-github-bot
Copy link
Contributor

@Yuhta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@Yuhta merged this pull request in ef7ca61.

Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request Jun 7, 2024
Summary:
This PR fixes the failure of `createTimestampVector` when nulls buffer is
nullptr.
facebookincubator#7625 (comment)

Pull Request resolved: facebookincubator#8955

Reviewed By: xiaoxmeng

Differential Revision: D54590232

Pulled By: Yuhta

fbshipit-source-id: a41846bbad9f51f4569623b013044c3c1feac24f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants