goldmedal commented on code in PR #11724: URL: https://github.com/apache/datafusion/pull/11724#discussion_r1702037283
########## datafusion/common/src/column.rs: ########## @@ -372,7 +372,7 @@ impl FromStr for Column { impl fmt::Display for Column { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.flat_name()) + write!(f, "{}", self.quoted_flat_name()) Review Comment: > I think only adding double quote for identifier that includes dot is probably a better idea. > > If we have column that has name includes dot, we display it like `qualifier."name.with.dot"` I'm rethinking what you said. I did a test for the function name using the original method (flat_name). ``` let schema = Schema::new(vec![ Field::new("id", DataType::Int32, false), Field::new("MAX(id)", DataType::Int32, false), Field::new("state", DataType::Utf8, false), ]); let plan = table_scan(Some("t"), &schema, None) .unwrap() .filter(col("state").eq(lit("CO"))) .unwrap() .project(vec![col("MAX(id)"), max(col("id"))]) .unwrap() .build() .unwrap(); ----- right: "Projection: t.MAX(id), MAX(t.id)\n Filter: t.state = Utf8(\"CO\")\n TableScan: t" ``` We can distinguish between them easily. Indeed, maybe we don't need to quote the identifier if it contains a bracket. Only quoting it for the dot might be simpler. 🤔 -- 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