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

Function MakeInvalidPartitionSkipDataset

cpp/src/arrow/dataset/scanner_test.cc:717–728  ·  view source on GitHub ↗

Make a dataset where the dataset schema expects the "filterable" column to be a date but the partitioning interprets it as an integer

Source from the content-addressed store, hash-verified

715// Make a dataset where the dataset schema expects the "filterable" column to
716// be a date but the partitioning interprets it as an integer
717std::shared_ptr<MockDataset> MakeInvalidPartitionSkipDataset() {
718 std::shared_ptr<Schema> test_schema = ScannerTestSchema();
719 EXPECT_OK_AND_ASSIGN(test_schema,
720 test_schema->SetField(1, field("filterable", date64())));
721 MockDatasetBuilder builder(test_schema);
722 builder.AddFragment(test_schema, /*inspection=*/nullptr,
723 equal(field_ref({1}), literal(100)));
724 std::shared_ptr<RecordBatch> batch = MakeTestBatch(0);
725 EXPECT_OK_AND_ASSIGN(batch, batch->RemoveColumn(1));
726 builder.AddBatch(std::move(batch));
727 return builder.Finish();
728}
729
730TEST(TestNewScanner, PartitionSkip) {
731 internal::Initialize();

Callers 1

TESTFunction · 0.85

Calls 12

ScannerTestSchemaFunction · 0.85
EXPECT_OK_AND_ASSIGNFunction · 0.85
equalFunction · 0.85
field_refFunction · 0.85
MakeTestBatchFunction · 0.85
AddFragmentMethod · 0.80
AddBatchMethod · 0.80
fieldFunction · 0.50
literalFunction · 0.50
SetFieldMethod · 0.45
RemoveColumnMethod · 0.45
FinishMethod · 0.45

Tested by

no test coverage detected