maryannxue 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_r335202499
##########
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:
Why do we need a new class here? Is there any reason why we can't use
`HintErrorLogger`?
----------------------------------------------------------------
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]