pepijnve commented on issue #17801:
URL: https://github.com/apache/datafusion/issues/17801#issuecomment-3342623211

   Short update on my investigation so far.
   
   The query that's causing the failure is TPC-DS query 75. This should 
actually already be covered by the `tcpds_planning.rs` tests.
   
   In its current state, the test passes though. If I modify the test as 
follows then it fails with the same error. This was rather surprising since the 
first thing `SessionState::create_physical_plan` does is call 
`SessionState::optimize`. So I modified `create_physical_plan` to call 
`optimize` twice in a row and then, lo and behold, the test passes again. So it 
looks like the implicit second optimisation pass is hiding the problematic from 
the test case.
   
   I ran the entire `tpcds_planning` suite with this patch. Only query 75 
planning fails.
   
   ```
   diff --git a/datafusion/core/tests/tpcds_planning.rs 
b/datafusion/core/tests/tpcds_planning.rs
   --- a/datafusion/core/tests/tpcds_planning.rs        (revision 
e5dcc8c04f9559f8af6efea3c7ff8202f3c1c618)
   +++ b/datafusion/core/tests/tpcds_planning.rs        (date 1759050028279)
   @@ -1052,9 +1052,10 @@
        for sql in &sql {
            let df = ctx.sql(sql).await?;
            let (state, plan) = df.into_parts();
   -        let plan = state.optimize(&plan)?;
            if create_physical {
                let _ = state.create_physical_plan(&plan).await?;
   +        } else {
   +            let _ = state.optimize(&plan)?;
            }
        }
    
   
   ```


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