rubenada commented on PR #3640:
URL: https://github.com/apache/calcite/pull/3640#issuecomment-1934283981

   > The trimUnusedField ,in the prepareSql function call path, is called 
conditionally based on the configHolder's isTrimUnusedFields flag and due to 
this it results in **trimUnusedFields getting called before decorrelateQuery** 
is called.
   
   Maybe I'm missing something, but isn't `decorrelateQuery` called before 
`trimUnusedFields` in `prepareSql` ? (so either we trim after decorrelate, or 
we don't trim at all, depending on the configHolder)
   ```
       if (this.context.config().forceDecorrelate()) {
         // Sub-query decorrelation.
         root = root.withRel(decorrelate(sqlToRelConverter, sqlQuery, 
root.rel));
       }
   
       if (configHolder.get().isTrimUnusedFields()) {
         // Trim unused fields.
         root = trimUnusedFields(root);
   
         Hook.TRIMMED.run(root.rel);
       }
   ```


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