46 virtual Result<Metrics>
GetMetrics(std::shared_ptr<Schema> schema,
47 std::shared_ptr<::arrow::Array> records) = 0;
50 virtual Result<Metrics>
GetMetrics(std::shared_ptr<Schema> schema,
51 std::shared_ptr<MetricsConfig> config,
52 std::shared_ptr<::arrow::Array> records) = 0;
67 void AssertCounts(
int field_id, std::optional<int64_t> expected_value_count,
68 std::optional<int64_t> expected_null_count,
const Metrics& metrics);
70 void AssertCounts(
int field_id, std::optional<int64_t> expected_value_count,
71 std::optional<int64_t> expected_null_count,
72 std::optional<int64_t> expected_nan_count,
const Metrics& metrics);
74 void AssertColumnSizeFields(std::vector<int32_t> expected_field_ids,
78 void AssertBounds(
int field_id, std::shared_ptr<PrimitiveType> type,
79 std::optional<T> expected_lower, std::optional<T> expected_upper,
83 std::shared_ptr<::arrow::Array> CreateRecordArrays(
84 const std::shared_ptr<::arrow::Schema>& arrow_schema,
const std::string& json_data);
87 static std::shared_ptr<Schema> SimpleSchema();
88 static std::shared_ptr<Schema> NestedSchema();
89 static std::shared_ptr<Schema> FloatDoubleSchema();
92 void MetricsForRepeatedValues();
93 void MetricsForTopLevelFields();
94 void MetricsForDecimals();
95 void MetricsForNestedStructFields();
96 void MetricsModeForNestedStructFields();
97 void MetricsForListAndMapElements();
98 void MetricsForNullColumns();
99 void MetricsForNaNColumns();
100 void ColumnBoundsWithNaNValueAtFront();
101 void ColumnBoundsWithNaNValueInMiddle();
102 void ColumnBoundsWithNaNValueAtEnd();
103 void MetricsForTopLevelWithMultipleRowGroup();
104 void MetricsForNestedStructFieldsWithMultipleRowGroup();
105 void NoneMetricsMode();
106 void CountsMetricsMode();
107 void FullMetricsMode();
108 void TruncateStringMetricsMode();
109 void TruncateBinaryMetricsMode();
112 Result<std::shared_ptr<::arrow::Array>> BuildSimpleRecords(
113 std::shared_ptr<::arrow::Schema> arrow_schema, int32_t count = 1);
114 Result<std::shared_ptr<::arrow::Array>> BuildNestedRecords(int32_t count = 1);
117 std::shared_ptr<FileIO> file_io_;
118 std::string temp_dir_;
virtual Result< Metrics > GetMetrics(std::shared_ptr< Schema > schema, std::shared_ptr< MetricsConfig > config, std::shared_ptr<::arrow::Array > records)=0
Get metrics with custom MetricsConfig.