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

Method Window

bolt/exec/Window.cpp:54–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54Window::Window(
55 int32_t operatorId,
56 DriverCtx* driverCtx,
57 const std::shared_ptr<const core::WindowNode>& windowNode)
58 : Operator(
59 driverCtx,
60 windowNode->outputType(),
61 operatorId,
62 windowNode->id(),
63 "Window",
64 windowNode->inputsSorted()
65 ? (windowNode->canSpill(driverCtx->queryConfig())
66 ? driverCtx->makeSpillConfig(operatorId)
67 : std::nullopt)
68 : (windowNode->canSpill(driverCtx->queryConfig())
69 ? driverCtx->makeSpillConfig(
70 operatorId,
71 driverCtx->queryConfig().rowBasedSpillMode())
72 : std::nullopt)),
73 numInputColumns_(windowNode->inputType()->size()),
74 stringAllocator_(pool()),
75 windowNode_(windowNode),
76 currentPartition_(nullptr) {
77 enableJit_ = driverCtx->queryConfig().enableJitRowCmpRow();
78 const auto numPartitionKeys = windowNode->partitionKeys().size();
79 const auto numSortingKeys = windowNode->sortingKeys().size();
80 for (auto i = 0; i < numSortingKeys; ++i) {
81 sortKeyInfo_.push_back(
82 std::make_pair(numPartitionKeys + i, windowNode->sortingOrders()[i]));
83 }
84
85 auto* spillConfig =
86 spillConfig_.has_value() ? &spillConfig_.value() : nullptr;
87 needSort_ = !(windowNode->inputsSorted());
88 const auto windowBuildType = getWindowBuildType();
89 const bool ignore = ignorePeer();
90 const auto maxBatchRows = driverCtx->queryConfig().maxOutputBatchRows();
91 const auto preferredBatchBytes =
92 driverCtx->queryConfig().preferredOutputBatchBytes();
93 const auto spillThreshold =
94 operatorCtx_->driverCtx()->queryConfig().orderBySpillMemoryThreshold();
95
96 setWindowBuild(
97 windowBuildType,
98 spillConfig,
99 spillThreshold,
100 ignore,
101 maxBatchRows,
102 preferredBatchBytes);
103}
104
105void Window::setRowsStreamingWindowBuild(
106 bool ignorePeer,

Callers

nothing calls this directly

Calls 15

outputTypeMethod · 0.80
inputsSortedMethod · 0.80
makeSpillConfigMethod · 0.80
rowBasedSpillModeMethod · 0.80
inputTypeMethod · 0.80
enableJitRowCmpRowMethod · 0.80
has_valueMethod · 0.80
maxOutputBatchRowsMethod · 0.80
poolFunction · 0.50
idMethod · 0.45

Tested by

no test coverage detected