nealrichardson commented on code in PR #19706:
URL: https://github.com/apache/arrow/pull/19706#discussion_r1067156579


##########
r/src/expression.cpp:
##########
@@ -79,6 +110,7 @@ std::shared_ptr<compute::Expression> compute___expr__scalar(
 
 // [[arrow::export]]
 std::string compute___expr__ToString(const 
std::shared_ptr<compute::Expression>& x) {
+  // TODO: something different if is field ref and IsNested?
   return x->ToString();

Review Comment:
   It's not awful, it's just not pretty. `FieldRef.Nested(FieldRef.Name(df_col) 
FieldRef.Name(a))`, whereas for a non-nested FieldRef, you just get `col`, not 
`FieldRef.Name(col)`. For R, I might want to print that as `df_col$a`, or 
`df_col[["a"]]` if we want to avoid messing with whether `a` needs backticks. 
   
   Trouble is, even if we improve this for where we call ToString from R, it 
doesn't change how it works when it is called recursively inside an 
Expression's ToString method. So you still would get e.g. 
`multiply_checked(FieldRef.Nested(FieldRef.Name(df_col) FieldRef.Name(a)), 2)`, 
and there's nothing we could do about that. 
   
   I'll just remove this comment.



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

Reply via email to