| 37 | namespace bytedance::bolt::exec { |
| 38 | |
| 39 | MarkDistinct::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 | |
| 68 | void MarkDistinct::addInput(RowVectorPtr input) { |
| 69 | groupingSet_->addInput(input, false /*mayPushdown*/); |
nothing calls this directly
no test coverage detected