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

Plugged binary layout #312

Merged
merged 3 commits into from
Dec 19, 2024
Merged

Conversation

JohanMabille
Copy link
Collaborator

No description provided.

@JohanMabille JohanMabille force-pushed the binary_layout branch 3 times, most recently from a22d0a3 to b1f981e Compare December 17, 2024 15:13
constexpr std::compare_three_way_result<T>
operator<=>(const vector_view<T>& lhs, const vector_view<T>& rhs)
{
return std::lexicographical_compare_three_way(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm if you can use the std here, it's means that we don't need the sparrow::lexicographical_compare_three_way implementation anymore (because we use newer version of Xcode I guess).
We should remove this code in another PR.

Comment on lines +58 to +65
arrow_proxy create_arrow_proxy()
{
ArrowSchema schema{};
ArrowArray array{};
const std::vector<size_t> false_bitmap{m_false_bitmap.begin(), m_false_bitmap.end()};
test::fill_schema_and_array<std::vector<byte_t>>(schema, array, m_length, m_offset, false_bitmap);
return arrow_proxy{std::move(array), std::move(schema)};
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should try to no use this anymore and always use the convenient constructors.
And in the convenient constructors test, check the arrow_proxy created.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this should be done in a dedicated PR where we totally hide the arrow_proxy. As long as the arrow_proxy and the array constructors accepting it are exposed, we need to test them.

CHECK_EQ(array[0].value(), word0);
CHECK_EQ(array[1].value(), word1);
CHECK_EQ(array[4].value(), word4);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please check the created arrow_proxy

Copy link
Collaborator Author

@JohanMabille JohanMabille Dec 18, 2024

Choose a reason for hiding this comment

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

I think we should not. We should totally hide the arrow_proxy, and have constructors accepting ArrowArray and ArrowSchema only. This should be done in a dedicated PR.

Comment on lines 100 to 104
CHECK_EQ(array[0].has_value(), true);
CHECK_EQ(array[1].has_value(), true);
CHECK_EQ(array[2].has_value(), false);
CHECK_EQ(array[3].has_value(), false);
CHECK_EQ(array[4].has_value(), true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
CHECK_EQ(array[0].has_value(), true);
CHECK_EQ(array[1].has_value(), true);
CHECK_EQ(array[2].has_value(), false);
CHECK_EQ(array[3].has_value(), false);
CHECK_EQ(array[4].has_value(), true);
CHECK(array[0].has_value());
CHECK(array[1].has_value());
CHECK_FALSE(array[2].has_value());
CHECK_FALSE(array[3].has_value());
CHECK(array[4].has_value());

word4
};
std::vector<std::size_t> where_nulls{2,3};
binary_array array(words, std::move(where_nulls));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
binary_array array(words, std::move(where_nulls));
const binary_array array(words, std::move(where_nulls));

Comment on lines 294 to 302
CHECK_EQ(*citer, true);
CHECK_EQ(*(++citer), false);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), false);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
CHECK_EQ(*citer, true);
CHECK_EQ(*(++citer), false);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), false);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), true);
CHECK_EQ(*(++citer), true);
CHECK(*citer);
CHECK_FALSE(*(++citer));
CHECK(*(++citer));
CHECK(*(++citer));
CHECK_FALSE(*(++citer));
CHECK(*(++citer));
CHECK(*(++citer));
CHECK(*(++citer));
CHECK(*(++citer));

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 60.71429% with 22 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@3b9e4da). Learn more about missing BASE report.

Files with missing lines Patch % Lines
..._size_binary_layout/variable_size_binary_array.hpp 55.00% 9 Missing ⚠️
include/sparrow/types/data_type.hpp 50.00% 6 Missing ⚠️
include/sparrow/layout/dispatch.hpp 0.00% 3 Missing ⚠️
src/array_factory.cpp 0.00% 3 Missing ⚠️
src/arrow_interface/arrow_array.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #312   +/-   ##
=======================================
  Coverage        ?   91.84%           
=======================================
  Files           ?       77           
  Lines           ?     5736           
  Branches        ?        0           
=======================================
  Hits            ?     5268           
  Misses          ?      468           
  Partials        ?        0           
Flag Coverage Δ
unittests 91.84% <60.71%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JohanMabille
Copy link
Collaborator Author

I'll update the builders in a dedicated PR, would be nice to finish to merge the remaining PRs so that we can enable precommit-ci and merge #311

@JohanMabille JohanMabille merged commit c015596 into man-group:main Dec 19, 2024
73 of 74 checks passed
@JohanMabille JohanMabille deleted the binary_layout branch December 19, 2024 10:39
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.

3 participants