-
Notifications
You must be signed in to change notification settings - Fork 3.8k
GH-45723: [C++] FixedSizeListBuilder should have UnsafeAppend methods #46126
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
Open
cramosme
wants to merge
6
commits into
apache:main
Choose a base branch
from
cramosme:fixedsize-unsafe
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a1c4cf3
Set up build environment for FixedSizeListBuilder UnsafeAppend contri…
cramosme 3998fe9
Merge branch 'apache:main' into fixedsize-unsafe
cramosme 30d9903
Adding the functions
cramosme e681165
Changed Appends in files
cramosme f0f057d
Change another instance in scalar_sting_ascii.cc
cramosme e2ea78b
Merge branch 'apache:main' into fixedsize-unsafe
cramosme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -672,6 +672,7 @@ class ARROW_EXPORT FixedSizeListBuilder : public ArrayBuilder { | |
/// using the child array builder. | ||
Status Append(); | ||
|
||
void UnsafeAppend(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
/// \brief Vector append | ||
/// | ||
/// If passed, valid_bytes will be read and any zero byte | ||
|
@@ -687,12 +688,14 @@ class ARROW_EXPORT FixedSizeListBuilder : public ArrayBuilder { | |
/// The child array builder will have the appropriate number of nulls appended | ||
/// automatically. | ||
Status AppendNull() final; | ||
void UnsafeAppendNull(); | ||
|
||
/// \brief Append length null fixed length lists. | ||
/// | ||
/// The child array builder will have the appropriate number of nulls appended | ||
/// automatically. | ||
Status AppendNulls(int64_t length) final; | ||
void UnsafeAppendNulls(int64_t length); | ||
|
||
Status ValidateOverflow(int64_t new_elements); | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,7 +137,7 @@ Status NestedListGenerator::AppendNestedList(ArrayBuilder* nested_builder, | |
if (type->id() == Type::FIXED_SIZE_LIST) { | ||
auto* fsl_builder = checked_cast<FixedSizeListBuilder*>(builder); | ||
assert(list_size == checked_cast<FixedSizeListType&>(*type).list_size()); | ||
RETURN_NOT_OK(fsl_builder->Append()); | ||
fsl_builder->UnsafeAppend(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should change this one. This is a testing utility, so we value robustness over performance. |
||
builder = fsl_builder->value_builder(); | ||
} else { // type->id() == Type::LIST) | ||
auto* list_builder = checked_cast<ListBuilder*>(builder); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to ignore error returns, so instead we should call a hypothetical
UnsafeAppendNulls(list_size_)
.If such a method doesn't exist, it should be added.