Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-43185: [C++] Suggest a cast when Concatenate fails due to of…
…fsets overflow (apache#43190) ## Rationale for this change When arrays using 32-bit offsets into data buffers are concatenated and the data buffers of the results grow beyond 2GB, `Concatenate` returns a bad `Status` with a very simple message: `"offset overflow while concatenating arrays"` The contract that `Concatenate` honors is very simple: arrays of input type T lead to output of the same type T, so we can't, for instance, return a `LARGE_STRING` [1] array when the input is `STRING`. But we can **suggest a cast** to the caller in case an overflow error is detected. Either programatically (by taking an output parameter) or by giving a better error message to users. [1] `LARGE_STRING` can use 64-bit offsets ### What changes are included in this PR? - Suggest casts when concatenation of the values of an FSL fail due to overflow - Suggest casts when concatenation of [LARGE_]LIST_VIEW array fails due to overflow - Suggest casts when concatenation of [LARGE_]LIST array fails due to overflow - Suggest a cast to LARGE_(BINARY|STRING) when offsets overflow ### Are these changes tested? Yes. * GitHub Issue: apache#43185 Lead-authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Co-authored-by: Benjamin Kietzman <bengilgit@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
- Loading branch information