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

Method CheckGeoStatistics

cpp/src/parquet/reader_test.cc:2357–2381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2355 }
2356
2357 void CheckGeoStatistics(std::shared_ptr<const LogicalType> type,
2358 std::shared_ptr<geospatial::GeoStatistics> geom_stats,
2359 int64_t start_index, int64_t num_rows) {
2360 // We don't yet generate statistics for Geography
2361 if (type->is_geography()) {
2362 ASSERT_EQ(geom_stats, nullptr);
2363 return;
2364 }
2365
2366 ASSERT_NE(geom_stats, nullptr);
2367 // We wrote exactly one geometry type (POINT, which has code 1)
2368 EXPECT_THAT(*geom_stats->geometry_types(), ::testing::ElementsAre(1));
2369
2370 double expected_xmin = static_cast<double>(start_index);
2371 double expected_xmax = expected_xmin + num_rows - 1;
2372 double expected_ymin = expected_xmin + 1;
2373 double expected_ymax = expected_xmax + 1;
2374
2375 EXPECT_EQ(geom_stats->lower_bound()[0], expected_xmin);
2376 EXPECT_EQ(geom_stats->upper_bound()[0], expected_xmax);
2377 EXPECT_EQ(geom_stats->lower_bound()[1], expected_ymin);
2378 EXPECT_EQ(geom_stats->upper_bound()[1], expected_ymax);
2379 EXPECT_THAT(geom_stats->dimension_valid(),
2380 ::testing::ElementsAre(true, true, false, false));
2381 }
2382
2383 protected:
2384 std::shared_ptr<Buffer> file_buf;

Callers

nothing calls this directly

Calls 5

is_geographyMethod · 0.80
lower_boundMethod · 0.80
upper_boundMethod · 0.80
dimension_validMethod · 0.80
geometry_typesMethod · 0.45

Tested by

no test coverage detected