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

Method Flatten

cpp/src/arrow/type.cc:843–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841}
842
843FieldVector Field::Flatten() const {
844 FieldVector flattened;
845 if (type_->id() == Type::STRUCT) {
846 for (const auto& child : type_->fields()) {
847 auto flattened_child = child->Copy();
848 flattened.push_back(flattened_child);
849 flattened_child->name_.insert(0, name() + ".");
850 flattened_child->nullable_ |= nullable_;
851 }
852 } else {
853 flattened.push_back(this->Copy());
854 }
855 return flattened;
856}
857
858std::shared_ptr<Field> Field::Copy() const {
859 return ::arrow::field(name_, type_, nullable_, metadata_);

Callers 6

FromDotPathMethod · 0.45
TESTFunction · 0.45
FromStructArrayMethod · 0.45
Ingest_some_nullsMethod · 0.45
StructArray__FlattenFunction · 0.45

Calls 8

CopyMethod · 0.95
push_backMethod · 0.80
nameFunction · 0.70
idMethod · 0.45
fieldsMethod · 0.45
insertMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by 1

TESTFunction · 0.36