Skip to content

Handling of short Decimal types from Arrow to Velox causing potential data correctness issue? #9412

Closed Answered by majetideepak
dingxin-tech asked this question in Q&A
Discussion options

You must be logged in to vote

@zdx19981006 I see that ArrowArray to VeloxVector for short decimals is handled here https://github.com/facebookincubator/velox/blob/main/velox/vector/arrow/Bridge.cpp#L1738

How will Velox correct the memory size when reading short decimal types back from Arrow format since they were expanded to 128 bits during write?

createShortDecimalVector converts a 128-bit value to a 64-bit value.

Could the current approach lead to a data correctness issue if it assumes the short decimal data are 64 bits wide when they have been stored as 128 bits?

The maximum precision of a short decimal is 18. The max decimal value with precision 18 999.. 99 will fit in a 64 bit value.
If the ArrowArray has pre…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dingxin-tech
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants