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

Function MapToNode

cpp/src/parquet/arrow/schema.cc:115–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115Status MapToNode(const std::shared_ptr<::arrow::MapType>& type, const std::string& name,
116 bool nullable, int field_id, const WriterProperties& properties,
117 const ArrowWriterProperties& arrow_properties, NodePtr* out) {
118 // TODO: Should we offer a non-compliant mode that forwards the type names?
119 NodePtr key_node;
120 RETURN_NOT_OK(
121 FieldToNode("key", type->key_field(), properties, arrow_properties, &key_node));
122
123 NodePtr value_node;
124 RETURN_NOT_OK(FieldToNode("value", type->item_field(), properties, arrow_properties,
125 &value_node));
126
127 NodePtr key_value =
128 GroupNode::Make("key_value", Repetition::REPEATED, {key_node, value_node});
129 *out = GroupNode::Make(name, RepetitionFromNullable(nullable), {key_value},
130 LogicalType::Map(), field_id);
131 return Status::OK();
132}
133
134Status VariantToNode(
135 const std::shared_ptr<::arrow::extension::VariantExtensionType>& type,

Callers 1

FieldToNodeFunction · 0.85

Calls 5

FieldToNodeFunction · 0.85
RepetitionFromNullableFunction · 0.85
MakeFunction · 0.50
MapClass · 0.50
OKFunction · 0.50

Tested by

no test coverage detected