goldmedal commented on code in PR #11724: URL: https://github.com/apache/datafusion/pull/11724#discussion_r1703144179
########## datafusion/common/src/column.rs: ########## @@ -156,6 +157,17 @@ impl Column { } } + fn quoted_flat_name_if_contain_dot(&self) -> String { + match &self.relation { + Some(r) => format!( + "{}.{}", + table_reference_to_quoted_string(r), + quoted_if_contain_dot(&self.name) + ), + None => quoted_if_contain_dot(&self.name).to_string(), + } + } Review Comment: > Maybe instead of modifying `Column`, we should modify the `display_name` for `Expr`, so if we found column inside ScalarFunction, we could skip the double quote anyway. (by something like boolean flag?) I'm not sure if it's that simple 🤔. In my experience, the column might look like this: ``` Column { qualifier: None, name: "sum(t1.c1)" } ``` I think it's hard to find a consistent pattern for it because we use many `Column::from_name` calls to create projections. For example, in https://github.com/apache/datafusion/blob/f4e519f9df9ab5972638d3f2743da01887a52668/datafusion/sql/src/relation/join.rs#L118 the column name could be complex and unruly. -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org