chenkovsky opened a new pull request, #15457:
URL: https://github.com/apache/datafusion/pull/15457

   ## Which issue does this PR close?
   
   - Closes #15386 .
   
   ## Rationale for this change
   
   for sql
   
   ```
   with test AS (SELECT i as needle FROM generate_series(1, 10) t(i))
   select count(*) from test WHERE 1 = 1;
   ```
   
   The root cause is that after `optimize_projections`.
   columns are dropped from logical plan, but in physical plan, there is still 
a value column.
   
   ## What changes are included in this PR?
   
   I think current `optimize_projections` is correct. it's a corner case, just 
need to bypass the check schema
   when physical_schema.fields.len() == 1 && logical_schema.fields.len() == 0.
   
   ## Are these changes tested?
   
   UT
   
   ## Are there any user-facing changes?
   
   No
   


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to