You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/05 07:16:35 UTC

[GitHub] [arrow-datafusion] Dandandan opened a new issue #264: Wrong result from projection

Dandandan opened a new issue #264:
URL: https://github.com/apache/arrow-datafusion/issues/264


   **Describe the bug**
   Projection is removed when it contains the same fields.
   This 
   
   **To Reproduce**
   
   ```sql
   
   > select (1+1) as a from (select 1 as a);
   +---+
   | a |
   +---+
   | 1 |
   +---+
   1 rows in set. Query took 0 seconds.;
   ```
   
   **Expected behavior**
   Should return 2 instead of reusing the expression from the field.
   
   **Additional context**
   The bug seems to be from the `project` function https://github.com/apache/arrow-datafusion/blob/master/datafusion/src/sql/planner.rs#L652 .
   I think when we remove the "optimization" to get rid of the projection, the query will return the correct result.
   Removal of any redundant projections should move to a properly tested optimization pass rather than in the sql -> logical plan planner.  


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

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



[GitHub] [arrow-datafusion] Dandandan closed issue #264: Wrong result from projection

Posted by GitBox <gi...@apache.org>.
Dandandan closed issue #264:
URL: https://github.com/apache/arrow-datafusion/issues/264


   


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

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