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 typo of calculating offsets for slicing index #206

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Conversation

eddyxu
Copy link
Contributor

@eddyxu eddyxu commented Sep 27, 2022

Closes #203

@@ -92,7 +92,7 @@ include_directories(src)
include_directories(${CMAKE_BINARY_DIR}/src) # for format.pb.{h/cc}

function(add_lance_test test_name)
if (NOT CMAKE_BUILD_TYPE STREQUAL "Release")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Change CMakeFile to allow python side to build ReleaseWithDebugInfo mode , easier to see call stack.

Copy link
Contributor

@changhiskhan changhiskhan left a comment

Choose a reason for hiding this comment

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

one nit/question

@@ -32,7 +32,7 @@ ScanBatch ScanBatch::Slice(int64_t off, int64_t length) const {
auto sliced_batch = batch->Slice(off, length);
decltype(indices) sliced_indices;
if (indices) {
sliced_indices = std::dynamic_pointer_cast<::arrow::Int32Array>(indices->Slice(offset, length));
sliced_indices = std::dynamic_pointer_cast<::arrow::Int32Array>(indices->Slice(off, length));
Copy link
Contributor

Choose a reason for hiding this comment

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

not a blocker for this PR but should we go with the convention to add an _ suffix to member variables? Would that have made it clearer here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This ScanBatch struct was a POD struct in the beginning, so that the caller can directly use scan_batch.batch to access its fields. It becomes more complicated lately, we could change it to class and wrap the fields as private and with _ suffix later?

I am fine to work on it after the release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added #207 to follow up with the remaining concerns.

@eddyxu eddyxu mentioned this pull request Sep 27, 2022
2 tasks
@eddyxu eddyxu merged commit 60d7412 into main Sep 27, 2022
@eddyxu eddyxu deleted the lei/offset_segfault branch September 27, 2022 17:49
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.

filter segfault
2 participants