[
https://issues.apache.org/jira/browse/CALCITE-2535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16609574#comment-16609574
]
Julian Hyde commented on CALCITE-2535:
--------------------------------------
The {{ExceptionInInitializerError}} is kind of a red herring. We want to write
tests that check that we are detecting runtime errors and unfortunately our
constantĀ folding code is so good that it turns into an exception that gets
thrown when the generated code is loaded.
For example, suppose we want to check how we are handling divide-by-zero. We
generate a test
{code:java}
select x / y from (values (1, 0)) as t(x, y){code} and the compiler creates a
constant whose value is 1 / 0. But in the real world the values would come from
a table, and the system doesn't see the values until the query is run.
So please don't over-fit the code and the testing to where the exception is
discovered before the query is even run.
> Runtime failure check not working in SqlTesterImpl.java
> -------------------------------------------------------
>
> Key: CALCITE-2535
> URL: https://issues.apache.org/jira/browse/CALCITE-2535
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Hongze Zhang
> Assignee: Julian Hyde
> Priority: Major
>
> Problem at SqlTesterImpl#checkFails:
> When argument "runtime" is specified as true, error assertion and error
> message matching will not be performed.
> This issue could result in wrong test result in SqlOperatorBaseTest.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)