mustafasrepo commented on issue #10421: URL: https://github.com/apache/datafusion/issues/10421#issuecomment-2230106142
Thanks @fabianmurarui. I have debugged your code, the problem seems to be these two lines [line1](https://github.com/fabianmurariu/df_sql_bug/blob/4301fd122dde58bfdd9f912eb6f3bcbb594567f2/src/main.rs#L77), [line2](https://github.com/fabianmurariu/df_sql_bug/blob/4301fd122dde58bfdd9f912eb6f3bcbb594567f2/src/main.rs#L134) where original schema of the table is passed to the Executor. However, if during `scan` call some of the columns are pruned (specified by `projection: Option<&Vec<usize>>` argument). Original schema is not valid. We should use corresponding correct fields in the schema. You can see, how schema projection is done in the [MemoryExec](https://github.com/apache/datafusion/blob/f204869ff55bb3e39cf23fc0a34ebd5021e6773f/datafusion/physical-plan/src/memory.rs#L166). I think, doing corresponding change would solve the problem. -- 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