zuochunwei commented on a change in pull request #7145:
URL: https://github.com/apache/incubator-doris/pull/7145#discussion_r752819977
##########
File path: be/src/exec/exec_node.h
##########
@@ -135,6 +135,12 @@ class ExecNode {
// each implementation should start out by calling the default
implementation.
virtual Status close(RuntimeState* state);
+ virtual void set_num_senders(int num_senders) {}
Review comment:
when you need cast by hand writing in C++, it's almost means existed
some design issues. try resolving this problem by cast is wrong, the problem of
design should resolved by re-design.
when you hold a pointer or reference, but you want to use the interfaces
designed for subclass, so the problem is type info missed, using cast is
similar said to compiler: "don't trouble me, don't help me to check security"
we should write code fit for compiler, not discard compiler, it's dangerous.
this viewpoint is not mine, but a major standpoint in OOP, you can find so
much related articles, such as CppCoreGuildlines, edited by Bjarne
Stroustrup(the father of C++) and Herb Sutter(C++ committee chairman)
--
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]