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 2022/03/09 03:28:18 UTC

[GitHub] [spark] LuciferYang opened a new pull request #35780: [SPARK-38458][SQL] Fix always false condition in `LogDivertAppender#initLayout`

LuciferYang opened a new pull request #35780:
URL: https://github.com/apache/spark/pull/35780


   ### What changes were proposed in this pull request?
   `initLayout` method in `LogDivertAppender` as follows:
   
   ```java
   private static StringLayout initLayout(OperationLog.LoggingLevel loggingMode) {
      ...
       for (Map.Entry<String, Appender> entry : appenders.entrySet()) {
         Appender ap = entry.getValue();
         if (ap.getClass().equals(ConsoleAppender.class)) {
           Layout l = ap.getLayout();
           if (l.getClass().equals(StringLayout.class)) {
             layout = (StringLayout) l;
             break;
           }
         }
       }
       return getLayout(isVerbose, layout);
     } 
   ```
   
   `l.getClass().equals(StringLayout.class)` in above method is always return `false` because `StringLayout` is an interface, 
   for example, `JsonLayout` is an implementation of `StringLayout`, but `JsonLayout.class.equals(StringLayout.class)` will return false.
   
   This pr change to use `instanceof` to fix the issue.
   
   
   ### Why are the changes needed?
   Bug fix
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   Pass GA


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] viirya closed pull request #35780: [SPARK-38458][SQL] Fix always false condition in `LogDivertAppender#initLayout`

Posted by GitBox <gi...@apache.org>.
viirya closed pull request #35780:
URL: https://github.com/apache/spark/pull/35780


   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] viirya commented on pull request #35780: [SPARK-38458][SQL] Fix always false condition in `LogDivertAppender#initLayout`

Posted by GitBox <gi...@apache.org>.
viirya commented on pull request #35780:
URL: https://github.com/apache/spark/pull/35780#issuecomment-1062588144


   Thanks. Merging to master.


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] LuciferYang commented on pull request #35780: [SPARK-38458][SQL] Fix always false condition in `LogDivertAppender#initLayout`

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #35780:
URL: https://github.com/apache/spark/pull/35780#issuecomment-1062578038


   cc @viirya 


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] LuciferYang commented on pull request #35780: [SPARK-38458][SQL] Fix always false condition in `LogDivertAppender#initLayout`

Posted by GitBox <gi...@apache.org>.
LuciferYang commented on pull request #35780:
URL: https://github.com/apache/spark/pull/35780#issuecomment-1062592049


   thanks @viirya 


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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