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

Method RepartitionBuildInput

be/src/exec/partitioned-hash-join-builder.cc:1097–1131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1095}
1096
1097Status PhjBuilder::RepartitionBuildInput(PhjBuilderPartition* input_partition) {
1098 int new_level = input_partition->level() + 1;
1099 DCHECK_GE(new_level, 1);
1100 SCOPED_TIMER(repartition_timer_);
1101 COUNTER_ADD(num_repartitions_, 1);
1102 RuntimeState* state = runtime_state_;
1103
1104 // Setup the read buffer and the new partitions.
1105 BufferedTupleStream* build_rows = input_partition->build_rows();
1106 DCHECK(build_rows != nullptr);
1107 bool got_read_buffer;
1108 RETURN_IF_ERROR(build_rows->PrepareForRead(true, &got_read_buffer));
1109 if (!got_read_buffer) {
1110 return mem_tracker()->MemLimitExceeded(
1111 state, Substitute(PREPARE_FOR_READ_FAILED_ERROR_MSG, join_node_id_));
1112 }
1113 RETURN_IF_ERROR(CreateHashPartitions(new_level));
1114
1115 // Repartition 'input_stream' into 'hash_partitions_'.
1116 RowBatch build_batch(row_desc_, state->batch_size(), mem_tracker());
1117 bool eos = false;
1118 while (!eos) {
1119 RETURN_IF_CANCELLED(state);
1120 RETURN_IF_ERROR(state->CheckQueryState());
1121
1122 RETURN_IF_ERROR(build_rows->GetNext(&build_batch, &eos));
1123 RETURN_IF_ERROR(AddBatch(&build_batch));
1124 build_batch.Reset();
1125 }
1126
1127 // Done reading the input, we can safely close it now to free memory.
1128 input_partition->Close(nullptr);
1129 RETURN_IF_ERROR(FinalizeBuild(state));
1130 return Status::OK();
1131}
1132
1133int64_t PhjBuilder::LargestPartitionRows() const {
1134 int64_t max_rows = 0;

Callers

nothing calls this directly

Calls 11

SubstituteFunction · 0.85
OKFunction · 0.85
build_rowsMethod · 0.80
batch_sizeMethod · 0.80
CheckQueryStateMethod · 0.80
levelMethod · 0.45
PrepareForReadMethod · 0.45
MemLimitExceededMethod · 0.45
GetNextMethod · 0.45
ResetMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected