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

Function CheckForGetSegments

cpp/src/arrow/compute/row/grouper.cc:59–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57auto g_group_id_type = std::make_shared<GroupIdType>();
58
59Status CheckForGetSegments(const ExecSpan& batch,
60 const std::vector<TypeHolder>& key_types) {
61 if (batch.values.size() != key_types.size()) {
62 return Status::Invalid("expected batch size ", key_types.size(), " but got ",
63 batch.values.size());
64 }
65 for (size_t i = 0; i < key_types.size(); i++) {
66 const auto& value = batch.values[i];
67 const auto& key_type = key_types[i];
68 if (*value.type() != *key_type.type) {
69 return Status::Invalid("expected batch value ", i, " of type ", *key_type.type,
70 " but got ", *value.type());
71 }
72 }
73 return Status::OK();
74}
75
76struct BaseRowSegmenter : public RowSegmenter {
77 explicit BaseRowSegmenter(const std::vector<TypeHolder>& key_types)

Callers 3

GetSegmentsMethod · 0.85
GetSegmentsMethod · 0.85
GetSegmentsMethod · 0.85

Calls 4

InvalidFunction · 0.50
OKFunction · 0.50
sizeMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected