You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mslapek (via GitHub)" <gi...@apache.org> on 2023/03/01 18:38:38 UTC

[GitHub] [arrow-datafusion] mslapek commented on a diff in pull request #5421: Implement/fix Eq and Hash for Expr and LogicalPlan

mslapek commented on code in PR #5421:
URL: https://github.com/apache/arrow-datafusion/pull/5421#discussion_r1122161900


##########
datafusion/expr/src/logical_plan/plan.rs:
##########
@@ -1515,8 +1515,30 @@ pub struct TableScan {
     pub fetch: Option<usize>,
 }
 
+impl PartialEq for TableScan {
+    fn eq(&self, other: &Self) -> bool {
+        self.table_name == other.table_name

Review Comment:
   This `Arc::ptr_eq` might be **risky**... [Arc::ptr_eq](https://doc.rust-lang.org/std/sync/struct.Arc.html#method.ptr_eq) and [std::ptr::eq](https://doc.rust-lang.org/std/ptr/fn.eq.html) say that `dyn` trait comparisons are **unreliable**. 😕
   
   Even clippy gives an error [vtable_address_comparisons](https://rust-lang.github.io/rust-clippy/master/index.html#vtable_address_comparisons) from **correctness** 🔞 category.
   
   I suggest to reconsider the request about `source` comparison.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org