TJX2014 opened a new pull request #29156:
URL: https://github.com/apache/spark/pull/29156


   ### What changes were proposed in this pull request?
   Add in CTE hint resolve in 
`org.apache.spark.sql.catalyst.analysis.ResolveHints.ResolveJoinStrategyHints#apply`
   Add a UT in `org.apache.spark.sql.test.SQLTestUtils#test`
   
   ### Why are the changes needed?
   Branch 2.4, when resolve CTE in 
`org.apache.spark.sql.catalyst.analysis.Analyzer.CTESubstitution`, we have a 
chance `executeSameContext` to apply all rules to CTE include hint resolve.
   Branch 3.0, because `CTESubstitution` is moved to a separated class, we miss 
the feature as follow:
   `
   scala> sql("create temporary view t as select 1 as id")
   res0: org.apache.spark.sql.DataFrame = []
   
   scala> sql("with cte as (select /*+ BROADCAST(id) */ id from t) select id 
from cte")
   org.apache.spark.sql.AnalysisException: cannot resolve '`id`' given input 
columns: [cte.id]; line 1 pos 59;
   'Project ['id]
   +- SubqueryAlias cte
      +- Project [id#0]
         +- SubqueryAlias t
            +- Project [1 AS id#0]
               +- OneRowRelation
   `
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### How was this patch tested?
   Unit test.


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