ulysses-you commented on a change in pull request #31368:
URL: https://github.com/apache/spark/pull/31368#discussion_r566523700



##########
File path: sql/core/src/test/resources/sql-tests/results/group-by-filter.sql.out
##########
@@ -796,14 +796,16 @@ IN/EXISTS predicate sub-queries can only be used in 
Filter/Join and a few comman
 :     +- Filter (dept_id#x = outer(dept_id#x))
 :        +- SubqueryAlias dept
 :           +- View (`DEPT`, [dept_id#x,dept_name#x,state#x])
-:              +- Project [dept_id#x, dept_name#x, state#x]
-:                 +- SubqueryAlias DEPT
-:                    +- LocalRelation [dept_id#x, dept_name#x, state#x]
+:              +- Project [cast(dept_id#x as int) AS dept_id#x, 
cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x]

Review comment:
       Can we add a rule at the end of `Analyzer` if the plan is resolved to 
check the top `Project` and reduce the`Cast` if is redundant ? The UpCast seems 
to avoid the table reference changed before view analysis but we can remove it 
after analysis.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to