manuzhang commented on code in PR #998:
URL: https://github.com/apache/iceberg-cpp/pull/998#discussion_r4240134446


##########
src/iceberg/manifest/manifest_reader.cc:
##########
@@ -416,6 +417,16 @@ Status ParsePartitionValues(ArrowArrayView* view, int64_t 
row_idx,
     case ArrowType::NANOARROW_TYPE_DOUBLE:
       partition.AddValue(Literal::Double(ArrowArrayViewGetDoubleUnsafe(view, 
row_idx)));
       break;
+    case ArrowType::NANOARROW_TYPE_DECIMAL128: {
+      const auto& type = static_cast<const DecimalType&>(*field_type);
+      ArrowDecimal value;
+      ArrowDecimalInit(&value, Decimal::kBitWidth, type.precision(), 
type.scale());
+      ArrowArrayViewGetDecimalUnsafe(view, row_idx, &value);
+      int128_t unscaled;
+      std::memcpy(&unscaled, value.words, sizeof(unscaled));

Review Comment:
   Thanks junwang for raising the question. Yes, it's a real issue. I also 
asked AI to carry out a thorough audit of the whole project and find similar 
issues in several places. Please check out 
https://github.com/apache/iceberg-cpp/issues/1000. cc @wgtmac 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to