GitHub user LouisClt created a discussion: Handling of UINT types and 
DictionaryBuilder

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,


GitHub link: https://github.com/apache/arrow/discussions/48399

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to