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

Function GetExtensionRelCommon

cpp/src/arrow/engine/substrait/relation_internal.cc:239–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239std::optional<substrait::RelCommon> GetExtensionRelCommon(const substrait::Rel& rel) {
240 switch (rel.rel_type_case()) {
241 case substrait::Rel::RelTypeCase::kExtensionLeaf: {
242 const auto& ext = rel.extension_leaf();
243 return ext.has_common() ? std::optional(ext.common()) : std::nullopt;
244 }
245
246 case substrait::Rel::RelTypeCase::kExtensionSingle: {
247 const auto& ext = rel.extension_single();
248 return ext.has_common() ? std::optional(ext.common()) : std::nullopt;
249 }
250
251 case substrait::Rel::RelTypeCase::kExtensionMulti: {
252 const auto& ext = rel.extension_multi();
253 return ext.has_common() ? std::optional(ext.common()) : std::nullopt;
254 }
255
256 default: {
257 return std::nullopt;
258 }
259 }
260}
261
262template <typename RelMessage>
263Status CheckRelCommon(const RelMessage& rel,

Callers 1

FromProtoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected