[
https://issues.apache.org/jira/browse/ARROW-14065?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17422101#comment-17422101
]
Tao He commented on ARROW-14065:
--------------------------------
The bitmap buffer is never touched and is a nullptr, and that is valid for
arrow arrays. In our compute engine we also assume there's no null values in
arrays and tables.
Its ok to me to depreated. If we have no plan for guarantee the semanticis,
deprecation is better than undocumented/unspecified behaviour, IMO.
> [C++] FixedSizeBinaryBuilder behaves incorrectly since v5.0 with
> "Resize+Advance" operation
> -------------------------------------------------------------------------------------------
>
> Key: ARROW-14065
> URL: https://issues.apache.org/jira/browse/ARROW-14065
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Affects Versions: 5.0.0
> Reporter: Tao He
> Assignee: Tao He
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> With the following code, we first "Resize" a builder, then fill the content,
> and finally use "Advance" to move the pointer to the end,
> ```cpp
> #include <iostream>
> #include <memory>
> #include "arrow/array/array_binary.h"
> #include "arrow/array/builder_binary.h"
> #include "arrow/status.h"
> #include "arrow/util/config.h"
> int main(int argc, char** argv) {
> struct S {
> int64_t a;
> double b;
> };
> arrow::FixedSizeBinaryBuilder b1(arrow::fixed_size_binary(sizeof(S)));
> arrow::FixedSizeBinaryBuilder b4(arrow::fixed_size_binary(sizeof(S)));
> b4.Resize(10);
> // ... fill the array data in random-access fashion ...
> b4.Advance(10);
> std::shared_ptr<arrow::FixedSizeBinaryArray> a4;
> b4.Finish(&a4);
> std::cout << "array length: " << a4->length() << std::endl;
> std::cout << "buffer size: " << a4->values()->size() << std::endl;
> return 0;
> }
> ```
> The output is 10 and 160 with arrow 4.0 (which is desired behavior) however
> arrow 5.0 yields 10 and 0, which means the length of array is not 0 but the
> underlying buffer is a null pointer.
> The same error doesn't happen to other types, e.g., IntBuilders.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)