You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "mihaibudiu (via GitHub)" <gi...@apache.org> on 2024/01/26 00:16:25 UTC
Re: [PR] [CALCITE-6168] RexExecutor can throw during compilation [calcite]
mihaibudiu commented on code in PR #3588:
URL: https://github.com/apache/calcite/pull/3588#discussion_r1467100622
##########
testkit/src/main/java/org/apache/calcite/sql/test/SqlTests.java:
##########
@@ -265,6 +265,20 @@ public static void checkEx(@Nullable Throwable ex,
}
}
+ // Search for an IllegalStateException somewhere in the stack.
+ // These are thrown by the enumerable implementors when evaluating
+ // an expression that produces an error.
+ IllegalStateException ise = null;
+ for (Throwable x = ex; x != null; x = x.getCause()) {
+ if (x instanceof IllegalStateException) {
+ ise = (IllegalStateException) x;
+ break;
+ }
+ if (x.getCause() == x) {
Review Comment:
I have seen this pattern used elsewhere in this function, so I have followed it. I am not sure whether a Throwable can have itself as a cause. It looks like the Java APIs make that possible, since you can create a Throwable and assign a cause to it later using initCause.
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org