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

Function StructToNode

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

Source from the content-addressed store, hash-verified

151}
152
153Status StructToNode(const std::shared_ptr<::arrow::StructType>& type,
154 const std::string& name, bool nullable, int field_id,
155 const WriterProperties& properties,
156 const ArrowWriterProperties& arrow_properties, NodePtr* out) {
157 std::vector<NodePtr> children(type->num_fields());
158 if (type->num_fields() != 0) {
159 for (int i = 0; i < type->num_fields(); i++) {
160 RETURN_NOT_OK(FieldToNode(type->field(i)->name(), type->field(i), properties,
161 arrow_properties, &children[i]));
162 }
163 } else {
164 // XXX (ARROW-10928) We could add a dummy primitive node but that would
165 // require special handling when writing and reading, to avoid column index
166 // mismatches.
167 return Status::NotImplemented("Cannot write struct type '", name,
168 "' with no child field to Parquet. "
169 "Consider adding a dummy child field.");
170 }
171
172 *out = GroupNode::Make(name, RepetitionFromNullable(nullable), children, nullptr,
173 field_id);
174 return Status::OK();
175}
176
177static std::shared_ptr<const LogicalType> TimestampLogicalTypeFromArrowTimestamp(
178 const ::arrow::TimestampType& timestamp_type, ::arrow::TimeUnit::type time_unit) {

Callers 1

FieldToNodeFunction · 0.85

Calls 8

FieldToNodeFunction · 0.85
RepetitionFromNullableFunction · 0.85
NotImplementedFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50
num_fieldsMethod · 0.45
nameMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected