| 237 | } |
| 238 | |
| 239 | std::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 | |
| 262 | template <typename RelMessage> |
| 263 | Status CheckRelCommon(const RelMessage& rel, |