morrySnow commented on code in PR #25715:
URL: https://github.com/apache/doris/pull/25715#discussion_r1380027404


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/pattern/PatternDescriptor.java:
##########
@@ -63,6 +66,22 @@ public <OUTPUT_TYPE extends Plan> PatternMatcher<INPUT_TYPE, 
OUTPUT_TYPE> thenAp
         return new PatternMatcher<>(pattern, defaultPromise, matchedAction);
     }
 
+    /**
+     * Same as thenApply, but catch all exception and return null
+     */
+    public <OUTPUT_TYPE extends Plan> PatternMatcher<INPUT_TYPE, OUTPUT_TYPE> 
thenApplyNoThrow(
+            MatchedAction<INPUT_TYPE, OUTPUT_TYPE> matchedAction) {
+        MatchedAction<INPUT_TYPE, OUTPUT_TYPE> adaptMatchedAction = ctx -> {
+            try {
+                return matchedAction.apply(ctx);
+            } catch (Exception ex) {
+                LOG.warn("nereids apply rule failed, because {}", 
ex.getMessage());

Review Comment:
   log ex too
   ```suggestion
                   LOG.warn("nereids apply rule failed, because {}", 
ex.getMessage(), ex);
   ```



-- 
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: [email protected]

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