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

Function TEST_F

cpp/src/parquet/schema_test.cc:137–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135};
136
137TEST_F(TestPrimitiveNode, Attrs) {
138 PrimitiveNode node1("foo", Repetition::REPEATED, Type::INT32);
139
140 PrimitiveNode node2("bar", Repetition::OPTIONAL, Type::BYTE_ARRAY, ConvertedType::UTF8);
141
142 ASSERT_EQ("foo", node1.name());
143
144 ASSERT_TRUE(node1.is_primitive());
145 ASSERT_FALSE(node1.is_group());
146
147 ASSERT_EQ(Repetition::REPEATED, node1.repetition());
148 ASSERT_EQ(Repetition::OPTIONAL, node2.repetition());
149
150 ASSERT_EQ(Node::PRIMITIVE, node1.node_type());
151
152 ASSERT_EQ(Type::INT32, node1.physical_type());
153 ASSERT_EQ(Type::BYTE_ARRAY, node2.physical_type());
154
155 // logical types
156 ASSERT_EQ(ConvertedType::NONE, node1.converted_type());
157 ASSERT_EQ(ConvertedType::UTF8, node2.converted_type());
158
159 // repetition
160 PrimitiveNode node3("foo", Repetition::REPEATED, Type::INT32);
161 PrimitiveNode node4("foo", Repetition::REQUIRED, Type::INT32);
162 PrimitiveNode node5("foo", Repetition::OPTIONAL, Type::INT32);
163
164 ASSERT_TRUE(node3.is_repeated());
165 ASSERT_FALSE(node3.is_optional());
166
167 ASSERT_TRUE(node4.is_required());
168
169 ASSERT_TRUE(node5.is_optional());
170 ASSERT_FALSE(node5.is_required());
171}
172
173TEST_F(TestPrimitiveNode, FromParquet) {
174 SchemaElement elt =

Callers

nothing calls this directly

Calls 15

NewPrimitiveFunction · 0.85
NewGroupFunction · 0.85
ByteArrayClass · 0.85
StringClass · 0.85
EnumClass · 0.85
JSONClass · 0.85
BSONClass · 0.85
UUIDClass · 0.85
physical_typeMethod · 0.80
__set_converted_typeMethod · 0.80
__set_type_lengthMethod · 0.80

Tested by

no test coverage detected