emkornfield commented on a change in pull request #8475:
URL: https://github.com/apache/arrow/pull/8475#discussion_r508777323
##########
File path: cpp/src/arrow/array/array_dict_test.cc
##########
@@ -857,40 +857,48 @@ TEST(TestDecimalDictionaryBuilder, Basic) {
ASSERT_TRUE(expected.Equals(result));
}
-TEST(TestDecimalDictionaryBuilder, DoubleTableSize) {
- const auto& decimal_type = arrow::decimal(21, 0);
+TEST(TestDecimal128DictionaryBuilder, Basic) {
+ TestDecimalDictionaryBuilderBasic<Decimal128>(arrow::decimal128(2, 0));
+}
+
+TEST(TestDecimal256DictionaryBuilder, Basic) {
+ TestDecimalDictionaryBuilderBasic<Decimal256>(arrow::decimal256(76, 0));
+}
+void TestDecimalDictionaryBuilderDoubleTableSize(
+ std::shared_ptr<DataType> decimal_type, FixedSizeBinaryBuilder&
decimal_builder) {
// Build the dictionary Array
DictionaryBuilder<FixedSizeBinaryType> dict_builder(decimal_type);
// Build expected data
- Decimal128Builder decimal_builder(decimal_type);
Int16Builder int_builder;
// Fill with 1024 different values
for (int64_t i = 0; i < 1024; i++) {
- const uint8_t bytes[] = {0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 12,
- 12,
- static_cast<uint8_t>(i / 128),
- static_cast<uint8_t>(i % 128)};
+ // Decimal256Builder takes 32 bytes, while Decimal128Builder takes only
the first 16
+ // bytes.
+ const uint8_t bytes[32] = {0,
Review comment:
According o:
https://en.cppreference.com/w/c/language/array_initialization is should be.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]