paleolimbot commented on code in PR #683:
URL: https://github.com/apache/arrow-nanoarrow/pull/683#discussion_r1850612877


##########
src/nanoarrow/common/inline_types.h:
##########
@@ -916,13 +922,14 @@ static inline void ArrowDecimalInit(struct ArrowDecimal* 
decimal, int32_t bitwid
   memset(decimal->words, 0, sizeof(decimal->words));
   decimal->precision = precision;
   decimal->scale = scale;
+  // n_words will be 0 for bitwidth == 32

Review Comment:
   I see!
   
   Can you add a note to the documentation for `n_words` explaining that a 
value of 0 is special-cased for 32-bit decimals?
   
   
https://github.com/apache/arrow-nanoarrow/blob/253b7ec0cb3cc4a5fb15c90c3879c2f2785d5600/src/nanoarrow/common/inline_types.h#L893-L894



##########
src/nanoarrow/common/array_test.cc:
##########
@@ -3821,6 +3901,80 @@ TEST(ArrayViewTest, 
ArrayViewTestGetIntervalMonthDayNano) {
   ArrowArrayRelease(&array);
 }
 
+TEST(ArrayViewTest, ArrayViewTestGetDecimal32) {

Review Comment:
   We'll do this in a follow-up (not your fault I didn't know how to use GTest 
properly when I wrote the first two!)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to