alamb commented on issue #9870:
URL: 
https://github.com/apache/arrow-datafusion/issues/9870#issuecomment-2028018095

   I ran this reproducer on a  `36.0.0` build and it works, so thus I think 
this is a regression:
   
   ```shell
   (venv) andrewlamb@Andrews-MacBook-Pro:~/Software/arrow-datafusion$ 
~/Software/DataFusionArchive/datafusion-cli-36.0.0
   DataFusion CLI v36.0.0
   ❯ CREATE TABLE t1(
       time TIMESTAMP,
       load1 DOUBLE,
       load2 DOUBLE,
       host VARCHAR
   ) AS VALUES
     (to_timestamp_nanos(1527018806000000000), 1.1, 101, 'host1'),
     (to_timestamp_nanos(1527018806000000000), 2.2, 202, 'host2'),
     (to_timestamp_nanos(1527018806000000000), 3.3, 303, 'host3'),
     (to_timestamp_nanos(1527018806000000000), 1.1, 101, NULL)
   ;
   0 rows in set. Query took 0.028 seconds.
   
   ❯ select t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] as host, 
sum((case when t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] is not null 
then t2."struct(t1.time,t1.load1,t1.load2,t1.host)" end)['c1']), sum((case when 
t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] is not null then 
t2."struct(t1.time,t1.load1,t1.load2,t1.host)" end)['c2']) from (select 
struct(time,load1,load2,host) from t1) t2 where 
t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] IS NOT NULL group by 
t2."struct(t1.time,t1.load1,t1.load2,t1.host)"['c3'] order by host;
   
+-------+-----------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
   | host  | SUM(CASE WHEN (t2.struct(t1.time,t1.load1,t1.load2,t1.host))[c3] 
IS NOT NULL THEN t2.struct(t1.time,t1.load1,t1.load2,t1.host) END[c1]) | 
SUM(CASE WHEN (t2.struct(t1.time,t1.load1,t1.load2,t1.host))[c3] IS NOT NULL 
THEN t2.struct(t1.time,t1.load1,t1.load2,t1.host) END[c2]) |
   
+-------+-----------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
   | host1 | 1.1                                                                
                                                                     | 101.0    
                                                                                
                                               |
   | host2 | 2.2                                                                
                                                                     | 202.0    
                                                                                
                                               |
   | host3 | 3.3                                                                
                                                                     | 303.0    
                                                                                
                                               |
   
+-------+-----------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
   3 rows in set. Query took 0.031 seconds.
   ```
   
   I believe this was also introduced as part of the `TreeNode` refactor in 
https://github.com/apache/arrow-datafusion/pull/8891, similarly to  
https://github.com/apache/arrow-datafusion/issues/9678
   


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