| 107 | } |
| 108 | |
| 109 | Status InitLocalStateIfNeeded(size_t thread_index) { |
| 110 | DCHECK_LT(thread_index, local_states_.size()); |
| 111 | ThreadLocalState& local_state = local_states_[thread_index]; |
| 112 | if (!local_state.is_initialized) { |
| 113 | InitEncoder(0, HashJoinProjection::KEY, &local_state.exec_batch_keys); |
| 114 | bool has_payload = (schema_[0]->num_cols(HashJoinProjection::PAYLOAD) > 0); |
| 115 | if (has_payload) { |
| 116 | InitEncoder(0, HashJoinProjection::PAYLOAD, &local_state.exec_batch_payloads); |
| 117 | } |
| 118 | local_state.is_initialized = true; |
| 119 | } |
| 120 | return Status::OK(); |
| 121 | } |
| 122 | |
| 123 | Status EncodeBatch(int side, HashJoinProjection projection_handle, RowEncoder* encoder, |
| 124 | const ExecBatch& batch, ExecBatch* opt_projected_batch = nullptr) { |