MCPcopy Create free account
hub / github.com/bytedance/bolt / extractGroupsInRowFormat

Method extractGroupsInRowFormat

bolt/exec/GroupingSet.cpp:814–843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

812#endif
813 const int32_t numGroups = table_
814 ? table_->rows()->listRows(
815 &iterator, maxOutputRows, maxOutputBytes, groups)
816 : 0;
817 if (numGroups == 0) {
818 if (table_ != nullptr) {
819 table_->clear();
820 }
821 return false;
822 }
823 if (supportRowBasedOutput_) {
824 extractGroupsInRowFormat(folly::Range<char**>(groups, numGroups), result);
825 } else {
826 extractGroups(folly::Range<char**>(groups, numGroups), result);
827 }
828 return true;
829}
830
831void GroupingSet::extractGroupsInRowFormat(
832 folly::Range<char**> groups,
833 RowVectorPtr& result) {
834 BOLT_DCHECK(!sortedAggregations_ && isPartial_ && rowInfo_.has_value());
835 NanosecondTimer timer(&stats_.aggExtractGroupsTimeNs);
836 if (groups.empty()) {
837 return;
838 }
839 result->resize(groups.size());
840 // 4 bytes for rowSize
841 static constexpr int32_t headerSize = sizeof(RowSizeType);
842 const auto& rowInfo = rowInfo_.value();
843 char *rowStart = nullptr, *newRow = nullptr;
844 RowSizeType rowSize = 0, actualRowSize = 0;
845 const auto& compositeResult =
846 std::dynamic_pointer_cast<CompositeRowVector>(result);

Callers

nothing calls this directly

Calls 10

has_valueMethod · 0.80
setRowOffsetMethod · 0.80
childAtMethod · 0.80
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
valueMethod · 0.45
rowsMethod · 0.45
extractColumnMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected