MCPcopy Create free account
hub / github.com/apache/arrow / TestByteArrayStatisticsFromArrow

Function TestByteArrayStatisticsFromArrow

cpp/src/parquet/statistics_test.cc:1229–1248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1227
1228template <typename ArrowType>
1229void TestByteArrayStatisticsFromArrow() {
1230 using TypeTraits = ::arrow::TypeTraits<ArrowType>;
1231 using ArrayType = typename TypeTraits::ArrayType;
1232
1233 auto values = ArrayFromJSON(TypeTraits::type_singleton(),
1234 "[\"c123\", \"b123\", \"a123\", null, "
1235 "null, \"f123\", \"g123\", \"h123\", \"i123\", \"ü123\"]");
1236
1237 const auto& typed_values = static_cast<const ArrayType&>(*values);
1238
1239 NodePtr node = PrimitiveNode::Make("field", Repetition::REQUIRED, Type::BYTE_ARRAY,
1240 ConvertedType::UTF8);
1241 ColumnDescriptor descr(node, 0, 0);
1242 auto stats = MakeStatistics<ByteArrayType>(&descr);
1243 ASSERT_NO_FATAL_FAILURE(stats->Update(*values));
1244
1245 ASSERT_EQ(ByteArray(typed_values.GetView(2)), stats->min());
1246 ASSERT_EQ(ByteArray(typed_values.GetView(9)), stats->max());
1247 ASSERT_EQ(2, stats->null_count());
1248}
1249
1250TEST(TestByteArrayStatisticsFromArrow, StringType) {
1251 // Part of ARROW-3246. Replicating TestStatisticsSortOrder test but via Arrow

Callers

nothing calls this directly

Calls 9

ArrayFromJSONFunction · 0.85
ByteArrayClass · 0.85
MakeFunction · 0.70
type_singletonFunction · 0.50
UpdateMethod · 0.45
GetViewMethod · 0.45
minMethod · 0.45
maxMethod · 0.45
null_countMethod · 0.45

Tested by

no test coverage detected