Omega359 commented on issue #9091:
URL: 
https://github.com/apache/arrow-datafusion/issues/9091#issuecomment-1920056439

   verified in main branch, sqllogic test to verify fix:
   ```
   ####
   # #9091 -- incorrect order on a joined table column (without selecting it's 
fields)
   ####
   
   statement ok
   CREATE TABLE companies(name VARCHAR, employees INT) AS VALUES ('Jeyork', 
150),('Shalk', 350),('ShuttlP', 75);
   
   statement ok
   CREATE TABLE leads(name VARCHAR, company VARCHAR) AS VALUES ('Alex F', 
'Jeyork'),('John B', 'Shalk'),('Samanta J', 'ShuttlP'),('Trevor R', 
'Jeyork'),('Alice B', 'ShuttlP');
   
   query TT
   SELECT l.* FROM leads l LEFT JOIN companies c ON c."name" = l."company" 
ORDER BY c."name", l."name";
   ----
   Alex F Jeyork
   Trevor R Jeyork
   John B Shalk
   Alice B ShuttlP
   Samanta J ShuttlP
   
   query TTT
   SELECT l.*, c.name FROM leads l LEFT JOIN companies c ON c."name" = 
l."company" ORDER BY c."name", l."name";
   ----
   Alex F Jeyork Jeyork
   Trevor R Jeyork Jeyork
   John B Shalk Shalk
   Alice B ShuttlP ShuttlP
   Samanta J ShuttlP ShuttlP
   ```
   


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