[ 
https://issues.apache.org/jira/browse/CALCITE-2535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16611365#comment-16611365
 ] 

Julian Hyde edited comment on CALCITE-2535 at 9/11/18 11:18 PM:
----------------------------------------------------------------

I wouldn't disable the constant folding. It is useful. (Memoization doesn't 
allow some of the "bigger" optimizations like removing dead code.)

If you can, construct a test where that the constant folding cannot kick in 
because it cannot see the constants. One idea use an "identity" table function: 
{code}select x / y from (table identity(cursor values (1, 0)) as t (x, y){code}

The important thing is that errors related to data occur at run-time not 
compile time. That's what the "boolean runtime" parameter to the test method is 
about. Calcite doesn't have a mechanism to have SQL expressions throw at 
runtime, and it needs one, and that mechanism needs to be tested.


was (Author: julianhyde):
I wouldn't disable the constant folding. It is useful. (Memoization doesn't 
allow some of the "bigger" optimizations like removing dead code.)

If you can, construct a test where that the constant folding cannot kick in 
because it cannot see the constants. One idea use an "identity" table function: 
{code}select x / y from (table identity(cursor values (1, 0)) as t (x, y){code}

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

Reply via email to