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

Class BoundRowTemplate

cpp/src/arrow/acero/pivot_longer_node.cc:44–72  ·  view source on GitHub ↗

A row template that's been bound to a schema

Source from the content-addressed store, hash-verified

42
43// A row template that's been bound to a schema
44struct BoundRowTemplate {
45 std::vector<std::string> feature_values;
46 std::vector<std::optional<FieldPath>> measurement_paths;
47
48 static Result<BoundRowTemplate> Make(const PivotLongerRowTemplate& unbound,
49 const Schema& schema) {
50 std::vector<std::optional<FieldPath>> measurement_paths;
51 for (const auto& meas_ref : unbound.measurement_values) {
52 if (meas_ref) {
53 ARROW_ASSIGN_OR_RAISE(FieldPath meas_path, meas_ref->FindOne(schema));
54 if (meas_path.indices().size() > 1) {
55 // This should actually be pretty easy to add. Just need to figure out how to
56 // convert from a nested measurement ref to a column in an exec batch
57 return Status::NotImplemented("nested measurement refs in pivot longer node");
58 }
59 measurement_paths.push_back(std::move(meas_path));
60 } else {
61 measurement_paths.push_back(std::nullopt);
62 }
63 }
64 return BoundRowTemplate(unbound.feature_values, std::move(measurement_paths));
65 }
66
67 private:
68 BoundRowTemplate(std::vector<std::string> feature_values,
69 std::vector<std::optional<FieldPath>> measurement_paths)
70 : feature_values(std::move(feature_values)),
71 measurement_paths(std::move(measurement_paths)) {}
72};
73
74class PivotLongerNode : public ExecNode, public TracedNode {
75 public:

Callers 1

MakeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected