maropu commented on a change in pull request #24055: [SPARK-26820][SQL] Prints
log messages when hints ignored in the analyzer
URL: https://github.com/apache/spark/pull/24055#discussion_r337844067
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveHints.scala
##########
@@ -134,9 +134,42 @@ object ResolveHints {
* This must be executed after all the other hint rules are executed.
*/
object RemoveAllHints extends Rule[LogicalPlan] {
- def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperatorsUp {
- case h: UnresolvedHint => h.child
+
+ def apply(plan: LogicalPlan): LogicalPlan = {
+ val ignoredHintLogger = new IgnoredHintLogger()
+ plan resolveOperatorsUp {
+ case h: UnresolvedHint =>
+ // Logs the unused plan hint before we remove it
+ ignoredHintLogger.log(h)
+ h.child
+ }
}
- }
+ private class IgnoredHintLogger {
Review comment:
Yea, HintErrorLogger can covert all the case in this pr, so I'll close this.
Thanks.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]