yiguolei commented on code in PR #66903:
URL: https://github.com/apache/doris/pull/66903#discussion_r3809420144
##########
be/src/exec/operator/operator.h:
##########
@@ -946,29 +941,39 @@ class OperatorXBase : public OperatorBase {
[[nodiscard]] OperatorPtr get_child() { return _child; }
[[nodiscard]] VExprContextSPtrs& conjuncts() { return _conjuncts; }
- [[nodiscard]] VExprContextSPtrs& projections() { return _projections; }
- [[nodiscard]] virtual RowDescriptor& row_descriptor() { return
_row_descriptor; }
+ // Describes the operator's original output before its optional
projection. For most operators
+ // this is the block returned by get_block(); Scan uses it to describe
Scanner's unprojected
+ // block because Scan executes the projection before
ScanOperatorX::get_block_impl().
+ [[nodiscard]] const RowDescriptor& operator_row_desc() const { return
_row_descriptor; }
[[nodiscard]] int operator_id() const { return _operator_id; }
[[nodiscard]] int node_id() const override { return _node_id; }
[[nodiscard]] int nereids_id() const { return _nereids_id; }
[[nodiscard]] int64_t limit() const { return _limit; }
- [[nodiscard]] const RowDescriptor& row_desc() const override {
- return _output_row_descriptor ? *_output_row_descriptor :
_row_descriptor;
+ // Describes the final block returned by get_block_after_projects() to
downstream operators.
+ // Without a projection, the original and final row descriptors are the
same.
+ [[nodiscard]] const RowDescriptor& row_desc() const {
+ return has_projection() ? _projection->output_row_descriptor :
operator_row_desc();
}
- [[nodiscard]] const RowDescriptor* output_row_descriptor() {
- return _output_row_descriptor.get();
+ [[nodiscard]] bool has_projection() const { return
_projection.has_value(); }
+
+ [[nodiscard]] bool has_intermediate_projection() const {
Review Comment:
这个方法,需要放在operator 这个层级吗?是不是我们需要在operator 通用考虑的问题?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]