peter-toth commented on code in PR #10939:
URL: https://github.com/apache/datafusion/pull/10939#discussion_r1642663015


##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -714,14 +689,7 @@ impl<'n> TreeNodeVisitor<'n> for ExprIdentifierVisitor<'_> 
{
         self.id_array[down_index].0 = self.up_index;
         if !self.expr_mask.ignores(expr) {
             self.id_array[down_index].1.clone_from(&expr_id);
-
-            // TODO: can we capture the data type in the second traversal only 
for
-            //  replaced expressions?
-            let data_type = expr.get_type(&self.input_schema)?;
-            let (count, _) = self
-                .expr_stats
-                .entry(expr_id.clone())
-                .or_insert((0, data_type));
+            let count = self.expr_stats.entry(expr_id.clone()).or_insert(0);

Review Comment:
   The reason why I wouldn't change this in this PR is because my 
https://github.com/apache/datafusion/pull/10473 
(https://github.com/apache/datafusion/pull/10473/files#diff-351499880963d6a383c92e156e75019cd9ce33107724a9635853d7d4cd1898d0R761)
 will completely eliminate string identifiers and removes these clones.



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