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

Method Deserialize

r/src/extension-impl.cpp:70–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70arrow::Result<std::shared_ptr<arrow::DataType>> RExtensionType::Deserialize(
71 std::shared_ptr<arrow::DataType> storage_type,
72 const std::string& serialized_data) const {
73 std::unique_ptr<RExtensionType> cloned = Clone();
74 cloned->storage_type_ = storage_type;
75 cloned->extension_metadata_ = serialized_data;
76
77 // We could create an ephemeral R6 instance here, which will call the R6 instance's
78 // deserialize_instance() method, possibly erroring when the metadata is
79 // invalid or the deserialized values are invalid. The complexity of setting up
80 // an event loop from wherever this *might* be called is high and hard to
81 // predict. As a compromise, just create the instance when it is safe to
82 // do so.
83 if (MainRThread::GetInstance().IsMainThread()) {
84 r6_instance();
85 }
86
87 return std::shared_ptr<RExtensionType>(cloned.release());
88}
89
90std::string RExtensionType::ToString() const { return ToString(false); }
91

Callers 1

ExtensionEqualsMethod · 0.45

Calls 2

IsMainThreadMethod · 0.80
releaseMethod · 0.45

Tested by

no test coverage detected