yiguolei commented on code in PR #58582:
URL: https://github.com/apache/doris/pull/58582#discussion_r2587145716


##########
be/src/olap/accept_null_predicate.h:
##########
@@ -40,8 +40,30 @@ class AcceptNullPredicate : public ColumnPredicate {
     ENABLE_FACTORY_CREATOR(AcceptNullPredicate);
 
 public:
-    AcceptNullPredicate(ColumnPredicate* nested)
-            : ColumnPredicate(nested->column_id(), nested->opposite()), 
_nested {nested} {}
+    AcceptNullPredicate(std::shared_ptr<ColumnPredicate> nested)
+            : ColumnPredicate(nested->column_id(), nested->primitive_type(), 
nested->opposite()),
+              _nested {nested} {}
+    AcceptNullPredicate(const AcceptNullPredicate& other)
+            : ColumnPredicate(other),
+              _nested(assert_cast<const AcceptNullPredicate&>(other)._nested
+                              ? assert_cast<const 
AcceptNullPredicate&>(other)._nested->clone()
+                              : nullptr) {}
+    ~AcceptNullPredicate() override = default;
+    std::shared_ptr<ColumnPredicate> clone() const override {
+        return AcceptNullPredicate::create_shared(*this);
+    }
+    std::string debug_string() const override {
+        fmt::memory_buffer debug_string_buffer;
+        fmt::format_to(debug_string_buffer, "AcceptNullPredicate({}, 
nested={})",
+                       ColumnPredicate::debug_string(), _nested ? 
_nested->debug_string() : "null");
+        return fmt::to_string(debug_string_buffer);
+    }
+    void update_column_id(uint32_t col_id) override {

Review Comment:
   这个接口不太好, 这种设计,假如column predicate 已经在一个比如map 中,我们直接改column id 就可能出错。
   我们可以把column id 在clone的时候传递进去,比如clone(uint32_t new_column_id)



-- 
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]

Reply via email to