| 61 | |
| 62 | template <bool AGGREGATED_ROWS> |
| 63 | void IR_ALWAYS_INLINE GroupingAggregator::EvalAndHashPrefetchGroup(RowBatch* batch, |
| 64 | int start_row_idx, TPrefetchMode::type prefetch_mode, HashTableCtx* ht_ctx) { |
| 65 | HashTableCtx::ExprValuesCache* expr_vals_cache = ht_ctx->expr_values_cache(); |
| 66 | const int cache_size = expr_vals_cache->capacity(); |
| 67 | |
| 68 | expr_vals_cache->Reset(); |
| 69 | FOREACH_ROW_LIMIT(batch, start_row_idx, cache_size, batch_iter) { |
| 70 | TupleRow* row = batch_iter.Get(); |
| 71 | bool is_null; |
| 72 | if (AGGREGATED_ROWS) { |
| 73 | is_null = !ht_ctx->EvalAndHashBuild(row); |
| 74 | } else { |
| 75 | is_null = !ht_ctx->EvalAndHashProbe(row); |
| 76 | } |
| 77 | // Hoist lookups out of non-null branch to speed up non-null case. |
| 78 | const uint32_t hash = expr_vals_cache->CurExprValuesHash(); |
| 79 | const uint32_t partition_idx = hash >> (32 - NUM_PARTITIONING_BITS); |
| 80 | HashTable* hash_tbl = GetHashTable(partition_idx); |
| 81 | if (is_null) { |
| 82 | expr_vals_cache->SetRowNull(); |
| 83 | } else if (prefetch_mode != TPrefetchMode::NONE) { |
| 84 | if (LIKELY(hash_tbl != nullptr)) hash_tbl->PrefetchBucket<false>(hash); |
| 85 | } |
| 86 | expr_vals_cache->NextRow(); |
| 87 | } |
| 88 | |
| 89 | expr_vals_cache->ResetForRead(); |
| 90 | } |
| 91 | |
| 92 | template <bool AGGREGATED_ROWS> |
| 93 | Status GroupingAggregator::ProcessRow( |
nothing calls this directly
no test coverage detected