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

Function TEST_F

cpp/src/arrow/dataset/discovery_test.cc:99–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97};
98
99TEST_F(MockDatasetFactoryTest, UnifySchemas) {
100 MakeFactory({});
101 AssertInspect(schema({}));
102
103 MakeFactory({schema({i32}), schema({i32})});
104 AssertInspect(schema({i32}));
105
106 MakeFactory({schema({i32}), schema({i64})});
107 AssertInspect(schema({i32, i64}));
108
109 MakeFactory({schema({i32}), schema({i64})});
110 AssertInspect(schema({i32, i64}));
111
112 MakeFactory({schema({i32}), schema({i32_req})});
113 AssertInspect(schema({i32}));
114
115 MakeFactory({schema({i32, f64}), schema({i32_req, i64})});
116 AssertInspect(schema({i32, f64, i64}));
117
118 MakeFactory({schema({i32, f64}), schema({f64, i32_fake})});
119 // Unification fails when fields with the same name have clashing types.
120 ASSERT_RAISES(TypeError, factory_->Inspect());
121 // Return the individual schema for closer inspection should not fail.
122 AssertInspectSchemas({schema({i32, f64}), schema({f64, i32_fake})});
123
124 MakeFactory({schema({field("num", int32())}), schema({field("num", float64())})});
125 ASSERT_RAISES(TypeError, factory_->Inspect());
126 InspectOptions permissive_options;
127 permissive_options.field_merge_options = Field::MergeOptions::Permissive();
128 AssertInspect(schema({field("num", float64())}), permissive_options);
129}
130
131class FileSystemDatasetFactoryTest : public DatasetFactoryTest {
132 public:

Callers

nothing calls this directly

Calls 15

DirFunction · 0.85
equalFunction · 0.85
field_refFunction · 0.85
push_backMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
schemaFunction · 0.50
fieldFunction · 0.50
FileClass · 0.50
MakeFileSystemFunction · 0.50
MakeFunction · 0.50
literalFunction · 0.50
InspectMethod · 0.45

Tested by

no test coverage detected