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

Function TEST_F

cpp/src/parquet/schema_test.cc:139–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

NewPrimitiveFunction · 0.85
NewGroupFunction · 0.85
to_stringFunction · 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

Tested by

no test coverage detected