kumarUjjawal commented on code in PR #18767:
URL: https://github.com/apache/datafusion/pull/18767#discussion_r2536562283


##########
datafusion/expr/src/expr_rewriter/order_by.rs:
##########
@@ -363,4 +363,59 @@ mod test {
         let nulls_first = true;
         expr.sort(asc, nulls_first)
     }
+
+    #[test]
+    fn qualify_column_handles_dotted_and_simple_names() {
+        let qualified =
+            Column::new(Some(TableReference::Bare { table: "t".into() }), 
"c1");
+        assert_eq!(qualify_column(qualified.clone()), qualified);
+
+        let simple = Column::new_unqualified("alias_without_dot");
+        assert_eq!(qualify_column(simple.clone()), simple);
+
+        let dotted = Column::new_unqualified("min(t.c2)");
+        let parsed = qualify_column(dotted);
+        assert_eq!(
+            parsed.relation,
+            Some(TableReference::Bare {
+                table: "min(t".into()
+            })
+        );
+        assert_eq!(parsed.name, "c2)");

Review Comment:
   I think you might have reviewed a earlier version of my code because I have 
reverted to simply reusing the projection’s alias string, so we no longer 
invent table references like min(t).



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