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

Method GetResult

cpp/src/arrow/ipc/metadata_internal.cc:813–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

811 }
812
813 Status GetResult(const std::shared_ptr<Field>& field, FieldOffset* offset) {
814 RETURN_NOT_OK(VisitType(*field->type()));
815
816 DictionaryOffset dictionary = 0;
817 const DataType* storage_type = field->type().get();
818 if (storage_type->id() == Type::EXTENSION) {
819 storage_type =
820 checked_cast<const ExtensionType&>(*storage_type).storage_type().get();
821 }
822 if (storage_type->id() == Type::DICTIONARY) {
823 ARROW_ASSIGN_OR_RAISE(const auto dictionary_id,
824 mapper_.GetFieldId(field_pos_.path()));
825 RETURN_NOT_OK(GetDictionaryEncoding(
826 fbb_, field, checked_cast<const DictionaryType&>(*storage_type), dictionary_id,
827 &dictionary));
828 }
829
830 auto metadata = field->metadata();
831
832 flatbuffers::Offset<KVVector> fb_custom_metadata;
833 std::vector<KeyValueOffset> key_values;
834 if (metadata != nullptr) {
835 AppendKeyValueMetadata(fbb_, *metadata, &key_values);
836 }
837
838 for (const auto& pair : extra_type_metadata_) {
839 key_values.push_back(AppendKeyValue(fbb_, pair.first, pair.second));
840 }
841
842 if (key_values.size() > 0) {
843 fb_custom_metadata = fbb_.CreateVector(key_values);
844 }
845
846 auto fb_name = fbb_.CreateString(field->name());
847 auto fb_children = fbb_.CreateVector(children_.data(), children_.size());
848 *offset =
849 flatbuf::CreateField(fbb_, fb_name, field->nullable(), fb_type_, type_offset_,
850 dictionary, fb_children, fb_custom_metadata);
851 return Status::OK();
852 }
853
854 private:
855 FBB& fbb_;

Callers 2

VisitChildFieldsMethod · 0.45
SchemaToFlatbufferFunction · 0.45

Calls 15

GetDictionaryEncodingFunction · 0.85
AppendKeyValueMetadataFunction · 0.85
AppendKeyValueFunction · 0.85
CreateFieldFunction · 0.85
storage_typeMethod · 0.80
push_backMethod · 0.80
nullableMethod · 0.80
VisitTypeFunction · 0.50
OKFunction · 0.50
typeMethod · 0.45
getMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected