+1 to what Francois said. You either want to use the method that takes a
length or string_view for this case:
https://github.com/apache/arrow/blob/843e8bb556a03f0e4c18841a623d1a0e9c236ee5/cpp/src/arrow/array/builder_binary.h#L72
On Wed, Nov 18, 2020 at 11:05 AM Francois Saint-Jacques <
I would say at first sight that it's due to your usage of char[] and
builder.Append(d) implicitly does a strlen.
François
On Wed, Nov 18, 2020 at 2:00 PM Ying Zhou wrote:
>
> Sure!
>
> BinaryBuilder builder;
> char d[] = "\x00\x01\xbf\x5b”;
> (void)(builder.Append(d));
> std::shared_ptr array;
Sure!
BinaryBuilder builder;
char d[] = "\x00\x01\xbf\x5b”;
(void)(builder.Append(d));
std::shared_ptr array;
(void)(builder.Finish());
int32_t dataLength = 0;
auto aarray = std::static_pointer_cast(array);
const uint8_t* data = aarray->GetValue(0, );
data = aarray->GetValue(3, );
Hello,
Le 18/11/2020 à 19:06, Ying Zhou a écrit :
>
> According to the documentation BINARY is "Variable-length bytes (no guarantee
> of UTF8-ness)”. However in practice if I embed 0x00 in the middle of a char
> array and Append it to a BinaryBuilder the 0x00 is converted to 0xff,
>
Hello,
According to the documentation BINARY is "Variable-length bytes (no guarantee
of UTF8-ness)”. However in practice if I embed 0x00 in the middle of a char
array and Append it to a BinaryBuilder the 0x00 is converted to 0xff,
everything after it is not appended and the length is computed