featzhang commented on PR #27609:
URL: https://github.com/apache/flink/pull/27609#issuecomment-4373140900

   @rionmonster Thanks for the detailed analysis! You're absolutely right about 
the duplicate output issue.
   
   ✅ **Fixed in commit bf6449cc**
   
   **Changes made:**
   - Enhanced the LogicalProject field removal logic in 
`RelTreeWriterImpl.scala`
   - Added removal of the 'fields' entry in addition to 'exprs' and 'inputs'
   - Changed to insert the new 'select' entry at position 0 for consistent 
formatting
   - Made the key comparison more explicit for better reliability
   
   **Root cause:**
   The duplication was occurring because `LogicalProject.explainTerms()` (from 
Calcite) adds field definitions like `a=[$0], b=[$1]`, and while we had logic 
to remove these entries, it wasn't catching all the field-related entries that 
Calcite was adding.
   
   **The fix:**
   The enhanced removal logic now ensures that only the new `select=[...]` 
format is rendered for LogicalProject nodes, preventing the duplicate output 
you identified.
   
   The tests should now pass with the new format. Please review when you have a 
chance!


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