MCPcopy Create free account
hub / github.com/apache/impala / ProcessBuildBatch

Method ProcessBuildBatch

be/src/exec/partitioned-hash-join-builder-ir.cc:45–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45Status PhjBuilder::ProcessBuildBatch(
46 RowBatch* build_batch, HashTableCtx* ctx, bool build_filters, bool is_null_aware) {
47 Status status;
48 HashTableCtx::ExprValuesCache* expr_vals_cache = ctx->expr_values_cache();
49 expr_vals_cache->Reset();
50 FOREACH_ROW(build_batch, 0, build_batch_iter) {
51 TupleRow* build_row = build_batch_iter.Get();
52 if (!ctx->EvalAndHashBuild(build_row)) {
53 if (is_null_aware) {
54 // If we are NULL aware and this build row has NULL in the eq join slot,
55 // append it to the null_aware partition. We will need it later.
56 if (UNLIKELY(
57 !AppendRow(null_aware_partition_->build_rows(), build_row, &status))) {
58 return status;
59 }
60 }
61 continue;
62 }
63 if (build_filters) {
64 DCHECK_EQ(ctx->level(), 0)
65 << "Runtime filters should not be built during repartitioning.";
66 InsertRuntimeFilters(filter_ctxs_.data(), build_row);
67 }
68 const uint32_t hash = expr_vals_cache->CurExprValuesHash();
69 const uint32_t partition_idx = hash >> (32 - NUM_PARTITIONING_BITS);
70 PhjBuilderPartition* partition = hash_partitions_[partition_idx].get();
71 if (UNLIKELY(!AppendRow(partition->build_rows(), build_row, &status))) {
72 return status;
73 }
74 }
75 for (const FilterContext& ctx : filter_ctxs_) ctx.MaterializeValues();
76 return Status::OK();
77}
78
79bool PhjBuilderPartition::InsertBatch(TPrefetchMode::type prefetch_mode,
80 HashTableCtx* ht_ctx, RowBatch* batch,

Callers

nothing calls this directly

Calls 12

FOREACH_ROWFunction · 0.85
OKFunction · 0.85
expr_values_cacheMethod · 0.80
EvalAndHashBuildMethod · 0.80
build_rowsMethod · 0.80
CurExprValuesHashMethod · 0.80
getMethod · 0.65
ResetMethod · 0.45
GetMethod · 0.45
levelMethod · 0.45
dataMethod · 0.45
MaterializeValuesMethod · 0.45

Tested by

no test coverage detected