HuaHuaY commented on code in PR #47427:
URL: https://github.com/apache/arrow/pull/47427#discussion_r2307276025
##########
cpp/src/parquet/arrow/arrow_reader_writer_test.cc:
##########
@@ -5468,6 +5532,86 @@ TYPED_TEST(TestIntegerAnnotateDecimalTypeParquetIO,
SingleNullableDecimalColumn)
ASSERT_NO_FATAL_FAILURE(this->ReadAndCheckSingleDecimalColumnFile(*values));
}
+template <typename TestType>
+class TestIntegerAnnotateSmallestDecimalTypeParquetIO
+ : public TestIntegerAnnotateDecimalTypeParquetIO<TestType> {
+ public:
+ void ReadAndCheckSingleDecimalColumnFile(const Array& values) {
+ ArrowReaderProperties properties = default_arrow_reader_properties();
+ properties.set_smallest_decimal_enabled(true);
+
+ std::shared_ptr<Array> out;
+ std::unique_ptr<FileReader> reader;
+ this->ReaderFromSink(&reader, properties);
+ this->ReadSingleColumnFile(std::move(reader), &out);
+
+ if (values.type()->id() == out->type()->id()) {
+ AssertArraysEqual(values, *out);
+ } else {
+ auto& expected_values = values;
+ auto& read_values = *out;
+ ASSERT_EQ(expected_values.length(), read_values.length());
+ ASSERT_EQ(expected_values.null_count(), read_values.null_count());
+
+ auto format_decimal = [](const Array& values, int64_t index) {
Review Comment:
Fixed
--
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]