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


##########
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’ve dropped the whole “split on dot” logic, so we no longer try to invent 
qualifiers like min(t / c2). The rewrite now just reuses whatever alias string 
the projection produced (e.g. the flat "min(t.c2)"), and the unit test asserts 
that exact name using a derived_col("min(t.c2)"). So the expectations you 
highlighted are gone.



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