You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/23 04:22:19 UTC

[GitHub] [spark] maropu commented on a change in pull request #24055: [SPARK-26820][SQL] Prints log messages when hints ignored in the analyzer

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org