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

Julian Hyde commented on CALCITE-2598:
--------------------------------------

Failure #3

{noformat}
java.lang.AssertionError: IS NOT NULL(COALESCE(-(COALESCE(+(null:INTEGER), 
CASE(=(IS NOT NULL(-(*(1614781498, null))), IS NOT FALSE(IS DISTINCT FROM(IS 
NOT TRUE(false), IS DISTINCT FROM(false, true)))), COALESCE(-264744344, 
+(CASE(false, COALESCE(?0.notNullInt0, ?0.int1, null:INTEGER), false, 
CASE(=(?0.bool0, ?0.notNullBool1), ?0.int1, null:INTEGER), true, +(?0.int0), 
-(1))), +(CASE(=(null, ?0.int1), -(CAST(1):INTEGER), -(null:INTEGER)))), 
COALESCE(+(+(*(CAST(100500):INTEGER, CAST(1):INTEGER), COALESCE(null:INTEGER, 
?0.notNullInt0, CAST(-380298452):INTEGER)), +(*(CAST(1):INTEGER, 
CAST(1):INTEGER), ?0.notNullInt0)), -(+(CASE(=(?0.bool0, false), 100500, 
null:INTEGER), -(?0.notNullInt0)), CAST(100500):INTEGER))), 
*(CASE(=(COALESCE(null:INTEGER, COALESCE(?0.notNullInt1, 1, ?0.notNullInt0, 
100500), CASE(=(?0.notNullInt1, null), ?0.notNullInt0, CAST(1):INTEGER)), 
CASE(=(null, ?0.notNullInt0), 1, =(null:INTEGER, null:INTEGER), +(-1, 
CAST(0):INTEGER), COALESCE(null:INTEGER, CAST(100500):INTEGER, ?0.int1, 
?0.int0))), null:INTEGER, =(COALESCE(null:INTEGER, COALESCE(?0.notNullInt1, 1, 
?0.notNullInt0, 100500), CASE(=(?0.notNullInt1, null), ?0.notNullInt0, 
CAST(1):INTEGER)), +(-(null:INTEGER, null:INTEGER), COALESCE(-862816891, 
?0.notNullInt0, null:INTEGER))), COALESCE(CASE(=(?0.bool0, true), CASE(false, 
null:INTEGER, -937491708), ?0.int1), COALESCE(CASE(=(null:INTEGER, 
null:INTEGER), 100500, CAST(1014357548):INTEGER), COALESCE(null:INTEGER, 
CAST(-1):INTEGER)), CAST(1):INTEGER, 100500), -(COALESCE(CASE(?0.notNullBool1, 
?0.int0, CAST(1782785328):INTEGER), COALESCE(null:INTEGER, ?0.int1, 
CAST(1):INTEGER, CAST(-172993226):INTEGER), CASE(?0.notNullBool0, 
?0.notNullInt1, null:INTEGER)))), null), +(null:INTEGER))), CASE(=(IS 
NULL(CASE(=(COALESCE(CASE(=(null, -1), CAST(0):INTEGER, null:INTEGER), 
COALESCE(null:INTEGER, null:INTEGER, ?0.notNullInt0), COALESCE(CAST(1):INTEGER, 
null:INTEGER, CAST(-1):INTEGER)), +(?0.int1, -(100500))), IS 
FALSE(>(CASE(=(true, ?0.notNullBool1), ?0.int1, ?0.int0), +(null:INTEGER))), 
=(COALESCE(CASE(=(null, -1), CAST(0):INTEGER, null:INTEGER), 
COALESCE(null:INTEGER, null:INTEGER, ?0.notNullInt0), COALESCE(CAST(1):INTEGER, 
null:INTEGER, CAST(-1):INTEGER)), +(*(null, ?0.notNullInt0))), CASE(IS 
FALSE(false), IS NOT TRUE(?0.bool0), COALESCE(true, ?0.notNullBool0, 
?0.notNullBool1), CASE(=(CAST(460191389):INTEGER, ?0.int1), IS NOT FALSE(true), 
=(CAST(460191389):INTEGER, null), NOT(true), =(?0.bool0, true)), IS 
FALSE(?0.notNullBool0), false, <=(IS NOT DISTINCT FROM(true, false), IS NOT 
NULL(?0.int1))), ?0.bool1)), IS NOT UNKNOWN(IS NOT FALSE(>=(+(COALESCE(1, 
CAST(-1037258589):INTEGER, CAST(-813806388):INTEGER), COALESCE(null:INTEGER, 
CAST(1):INTEGER, null:INTEGER, CAST(0):INTEGER)), COALESCE(-(1514115499, 
?0.int1), +(null:INTEGER), +(-682013927), -(null:INTEGER, null:INTEGER)))))), 
-(?0.notNullInt0), -(-(+(COALESCE(null:INTEGER, COALESCE(null:INTEGER, *(null, 
CAST(1):INTEGER), *(CAST(-1):INTEGER, 0)), COALESCE(?0.int0, +(null:INTEGER, 
null:INTEGER)), ?0.notNullInt0))))), 0))
isNotNull(coalesce(unaryMinus(coalesce(unaryPlus(nullInt), 
case_(eq(isNotNull(unaryMinus(mul(literal(1614781498), nullInt))), 
isNotFalse(isDistinctFrom(isNotTrue(falseLiteral), isDistinctFrom(falseLiteral, 
trueLiteral)))), coalesce(literal(-264744344), unaryPlus(case_(falseLiteral, 
coalesce(vIntNotNull(0), vInt(1), nullInt), falseLiteral, case_(eq(vBool(0), 
vBoolNotNull(1)), vInt(1), nullInt), trueLiteral, unaryPlus(vInt(0)), 
unaryMinus(literal(1)))), unaryPlus(case_(eq(nullInt, vInt(1)), 
unaryMinus(rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1))), 
unaryMinus(nullInt)))), 
coalesce(plus(plus(mul(rexBuilder.makeCall(SqlStdOperatorTable.CAST, 
literal(100500)), rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1))), 
coalesce(nullInt, vIntNotNull(0), rexBuilder.makeCall(SqlStdOperatorTable.CAST, 
literal(-380298452)))), plus(mul(rexBuilder.makeCall(SqlStdOperatorTable.CAST, 
literal(1)), rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1))), 
vIntNotNull(0))), sub(plus(case_(eq(vBool(0), falseLiteral), literal(100500), 
nullInt), unaryMinus(vIntNotNull(0))), 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(100500))))), 
mul(case_(eq(coalesce(nullInt, coalesce(vIntNotNull(1), literal(1), 
vIntNotNull(0), literal(100500)), case_(eq(vIntNotNull(1), nullInt), 
vIntNotNull(0), rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1)))), 
case_(eq(nullInt, vIntNotNull(0)), literal(1), eq(nullInt, nullInt), 
plus(literal(-1), rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(0))), 
coalesce(nullInt, rexBuilder.makeCall(SqlStdOperatorTable.CAST, 
literal(100500)), vInt(1), vInt(0)))), nullInt, eq(coalesce(nullInt, 
coalesce(vIntNotNull(1), literal(1), vIntNotNull(0), literal(100500)), 
case_(eq(vIntNotNull(1), nullInt), vIntNotNull(0), 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1)))), plus(sub(nullInt, 
nullInt), coalesce(literal(-862816891), vIntNotNull(0), nullInt))), 
coalesce(case_(eq(vBool(0), trueLiteral), case_(falseLiteral, nullInt, 
literal(-937491708)), vInt(1)), coalesce(case_(eq(nullInt, nullInt), 
literal(100500), rexBuilder.makeCall(SqlStdOperatorTable.CAST, 
literal(1014357548))), coalesce(nullInt, 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(-1)))), 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1)), literal(100500)), 
unaryMinus(coalesce(case_(vBoolNotNull(1), vInt(0), 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1782785328))), 
coalesce(nullInt, vInt(1), rexBuilder.makeCall(SqlStdOperatorTable.CAST, 
literal(1)), rexBuilder.makeCall(SqlStdOperatorTable.CAST, 
literal(-172993226))), case_(vBoolNotNull(0), vIntNotNull(1), nullInt)))), 
nullInt), unaryPlus(nullInt))), 
case_(eq(isNull(case_(eq(coalesce(case_(eq(nullInt, literal(-1)), 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(0)), nullInt), 
coalesce(nullInt, nullInt, vIntNotNull(0)), 
coalesce(rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1)), nullInt, 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(-1)))), plus(vInt(1), 
unaryMinus(literal(100500)))), isFalse(gt(case_(eq(trueLiteral, 
vBoolNotNull(1)), vInt(1), vInt(0)), unaryPlus(nullInt))), 
eq(coalesce(case_(eq(nullInt, literal(-1)), 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(0)), nullInt), 
coalesce(nullInt, nullInt, vIntNotNull(0)), 
coalesce(rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1)), nullInt, 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(-1)))), 
unaryPlus(mul(nullInt, vIntNotNull(0)))), case_(isFalse(falseLiteral), 
isNotTrue(vBool(0)), coalesce(trueLiteral, vBoolNotNull(0), vBoolNotNull(1)), 
case_(eq(rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(460191389)), 
vInt(1)), isNotFalse(trueLiteral), 
eq(rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(460191389)), nullInt), 
not(trueLiteral), eq(vBool(0), trueLiteral)), isFalse(vBoolNotNull(0)), 
falseLiteral, le(isNotDistinctFrom(trueLiteral, falseLiteral), 
isNotNull(vInt(1)))), vBool(1))), 
rexBuilder.makeCall(SqlStdOperatorTable.IS_NOT_UNKNOWN, 
isNotFalse(ge(plus(coalesce(literal(1), 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(-1037258589)), 
rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(-813806388))), 
coalesce(nullInt, rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(1)), 
nullInt, rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(0)))), 
coalesce(sub(literal(1514115499), vInt(1)), unaryPlus(nullInt), 
unaryPlus(literal(-682013927)), sub(nullInt, nullInt)))))), 
unaryMinus(vIntNotNull(0)), unaryMinus(unaryMinus(unaryPlus(coalesce(nullInt, 
coalesce(nullInt, mul(nullInt, rexBuilder.makeCall(SqlStdOperatorTable.CAST, 
literal(1))), mul(rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(-1)), 
literal(0))), coalesce(vInt(0), plus(nullInt, nullInt)), vIntNotNull(0)))))), 
literal(0))) isAlwaysTrue, so it should simplify to TRUE unknownAsFalse 
expected:<true> but was:<IS NOT NULL(COALESCE(-(CASE(IS NOT DISTINCT FROM(true, 
IS DISTINCT FROM(false, true)), -264744344, COALESCE(+(+(*(100500, 1), 
?0.notNullInt0), +(*(1, 1), ?0.notNullInt0)), -(+(CASE(NOT(?0.bool0), 100500, 
null:INTEGER), -(?0.notNullInt0)), 100500)))), CASE(IS NULL(OR(AND(IS 
TRUE(=(?0.notNullInt0, +(?0.int1, -(100500)))), IS FALSE(null:BOOLEAN)), 
AND(?0.bool1, IS NOT TRUE(=(?0.notNullInt0, +(?0.int1, -(100500))))))), 
-(?0.notNullInt0), -(-(+(COALESCE(*(-1, 0), ?0.int0, ?0.notNullInt0)))))))>
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at 
org.apache.calcite.test.fuzzer.RexProgramFuzzyTest.checkUnknownAs(RexProgramFuzzyTest.java:222)
        Suppressed: org.apache.calcite.test.fuzzer.RexProgramFuzzyTest$1: seed 
8499718751902159681
{noformat}

> Failure in RexProgramFuzzyTest
> ------------------------------
>
>                 Key: CALCITE-2598
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2598
>             Project: Calcite
>          Issue Type: Task
>            Reporter: Julian Hyde
>            Priority: Major
>
> I got the following failure in RexProgramFuzzyTest. Is it a duplicate issue?
> Failure #1
> {noformat}
> 2018-09-28 03:52:59,737 [pool-1-thread-1] INFO  - Using seed 44 for rex 
> fuzzing
> 2018-09-28 03:52:59,748 [pool-1-thread-1] INFO  - Rex fuzzing results: number 
> of cases tested=18, failed cases=0, duplicate failures=0, fuzz rate=1636 per 
> second
> 2018-09-28 03:52:59,751 [pool-1-thread-1] INFO  - Rex fuzzing results: number 
> of cases tested=2, failed cases=1, duplicate failures=0, fuzz rate=666 per 
> second
> 2018-09-28 03:52:59,754 [pool-1-thread-1] INFO  - Randomized test identified 
> a potential defect. Feel free to fix that issue
> java.lang.AssertionError: COALESCE(CASE(IS NOT FALSE(true), 
> -(COALESCE(CAST(-1):INTEGER, null, ?0.notNullInt1), *(CAST(100500):INTEGER, 
> ?0.notNullInt0)), -(+(-1990568273))), +(-(COALESCE(null, ?0.notNullInt0, 
> ?0.notNullInt0))))
> coalesce(case_(isNotFalse(trueLiteral), 
> sub(coalesce(rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(-1)), 
> nullInt, vIntNotNull(1)), rexBuilder.makeCall(SqlStdOperatorTable.*, 
> rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(100500)), 
> vIntNotNull(0))), unaryMinus(unaryPlus(literal(-1990568273)))), 
> unaryPlus(unaryMinus(coalesce(nullInt, vIntNotNull(0), vIntNotNull(0))))) had 
> non-nullable type INTEGER, and it was optimized to CASE(IS NOT FALSE(true), 
> -(COALESCE(CAST(-1):INTEGER, null, ?0.notNullInt1), *(CAST(100500):INTEGER, 
> ?0.notNullInt0)), -(+(-1990568273)))
> case_(isNotFalse(trueLiteral), 
> sub(coalesce(rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(-1)), 
> nullInt, vIntNotNull(1)), rexBuilder.makeCall(SqlStdOperatorTable.*, 
> rexBuilder.makeCall(SqlStdOperatorTable.CAST, literal(100500)), 
> vIntNotNull(0))), unaryMinus(unaryPlus(literal(-1990568273)))) that has 
> nullable type INTEGER, unknownAsFalse {noformat}
> I suggest that we append new failures to this case. If they are new issues, 
> log new cases, but there is also a good chance that they are variants of, or 
> related to, other open cases.
> In this case, it could be one of the two COALESCE issues already open.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to