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

Method TestScan

cpp/src/arrow/dataset/test_util_internal.h:1295–1310  ·  view source on GitHub ↗

Shared test cases

Source from the content-addressed store, hash-verified

1293
1294 // Shared test cases
1295 void TestScan() {
1296 // Basic test to make sure we can scan data
1297 auto random_data = GetRandomData(schema({field("f64", float64())}));
1298 auto source = this->MakeBufferSource(random_data.get());
1299
1300 this->SetDatasetSchema(random_data->schema()->fields());
1301 auto fragment = this->MakeFragment(*source);
1302
1303 int64_t row_count = 0;
1304 ASSERT_OK_AND_ASSIGN(std::unique_ptr<RecordBatchReader> scanner, Scan(fragment));
1305 for (auto maybe_batch : *scanner) {
1306 ASSERT_OK_AND_ASSIGN(auto batch, maybe_batch);
1307 row_count += batch->num_rows();
1308 }
1309 ASSERT_EQ(row_count, GetParam().expected_rows());
1310 }
1311
1312 // TestScanBatchSize is no longer relevant because batch size is an internal concern.
1313 // Consumers should only really care about batch sizing at the sink.

Callers

nothing calls this directly

Calls 11

MakeBufferSourceMethod · 0.80
SetDatasetSchemaMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
schemaFunction · 0.50
fieldFunction · 0.50
getMethod · 0.45
fieldsMethod · 0.45
schemaMethod · 0.45
MakeFragmentMethod · 0.45
num_rowsMethod · 0.45
expected_rowsMethod · 0.45

Tested by

no test coverage detected