Skip to content

Navigation Menu

Sign in
Sign up

Handling of UINT types and DictionaryBuilder #48399

LouisClt started this conversation in General
Discussion options

Hello,
I just upgraded my arrow version from 11 to 21 (C++).

But I think I have a new behaviour that I find almost buggy, here is the pseudo code :


std::shared_ptr<arrow::DataType> pDataType = ... ;
std::unique_ptr<arrow::ArrayBuilder> builder;
arrow::MakeBuilder(arrow::default_memory_pool(), pDataType, &builder)
std::shared_ptr<arrow::Array> pNewArray;
builder->Finish(&pNewArray);

The problem is that sometimes pDataType is a DICTIONARY type with an index type "UINT8". In this case, the builder seems to replace the index type with "INT8".

In this case this will later trigger FATAL asserts in the arrow code (because I am executing it in debug) and abort my program. This is due to a mismatch between the schema of the table and its field.
Furthermore I think this bahaviour can give problems when I really need to have the "unsigned" values.

What is the reason for this (I saw maybe for java compatibility reasons) ? How should I circumvent this issue ?
I also just saw that there is a method : MakeBuilderExactIndex. I suppose that this is the way to go ?

Regards,

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /