| 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 | |
| 831 | void 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); |
nothing calls this directly
no test coverage detected