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

Function MapToNode

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

Source from the content-addressed store, hash-verified

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