MCPcopy Create free account
hub / github.com/bytedance/bolt / MarkDistinct

Method MarkDistinct

bolt/exec/MarkDistinct.cpp:39–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37namespace bytedance::bolt::exec {
38
39MarkDistinct::MarkDistinct(
40 int32_t operatorId,
41 DriverCtx* driverCtx,
42 const std::shared_ptr<const core::MarkDistinctNode>& planNode)
43 : Operator(
44 driverCtx,
45 planNode->outputType(),
46 operatorId,
47 planNode->id(),
48 "MarkDistinct") {
49 const auto& inputType = planNode->sources()[0]->outputType();
50
51 // Set all input columns as identity projection.
52 for (auto i = 0; i < inputType->size(); ++i) {
53 identityProjections_.emplace_back(i, i);
54 }
55
56 // We will use result[0] for distinct mask output.
57 resultProjections_.emplace_back(0, inputType->size());
58
59 groupingSet_ = GroupingSet::createForMarkDistinct(
60 inputType,
61 createVectorHashers(inputType, planNode->distinctKeys()),
62 operatorCtx_.get(),
63 &nonReclaimableSection_);
64
65 results_.resize(1);
66}
67
68void MarkDistinct::addInput(RowVectorPtr input) {
69 groupingSet_->addInput(input, false /*mayPushdown*/);

Callers

nothing calls this directly

Calls 6

createVectorHashersFunction · 0.85
outputTypeMethod · 0.80
idMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected