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

Function StructToNode

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

Source from the content-addressed store, hash-verified

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