| 164 | } |
| 165 | |
| 166 | Status HashTableCtx::Init(ObjectPool* pool, RuntimeState* state, int num_build_tuples) { |
| 167 | int scratch_row_size = sizeof(Tuple*) * num_build_tuples; |
| 168 | scratch_row_ = reinterpret_cast<TupleRow*>(malloc(scratch_row_size)); |
| 169 | if (UNLIKELY(scratch_row_ == NULL)) { |
| 170 | return Status(Substitute("Failed to allocate $0 bytes for scratch row of " |
| 171 | "HashTableCtx.", scratch_row_size)); |
| 172 | } |
| 173 | RETURN_IF_ERROR(ScalarExprEvaluator::Create(build_exprs_, state, pool, expr_perm_pool_, |
| 174 | build_expr_results_pool_, &build_expr_evals_)); |
| 175 | DCHECK_EQ(build_exprs_.size(), build_expr_evals_.size()); |
| 176 | RETURN_IF_ERROR(ScalarExprEvaluator::Create(probe_exprs_, state, pool, expr_perm_pool_, |
| 177 | probe_expr_results_pool_, &probe_expr_evals_)); |
| 178 | DCHECK_EQ(probe_exprs_.size(), probe_expr_evals_.size()); |
| 179 | return expr_values_cache_.Init( |
| 180 | state, expr_perm_pool_->mem_tracker(), build_exprs_results_row_layout_); |
| 181 | } |
| 182 | |
| 183 | Status HashTableCtx::Create(ObjectPool* pool, RuntimeState* state, |
| 184 | const std::vector<ScalarExpr*>& build_exprs, |
no test coverage detected