Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4256

RexSimplify should not simplify P AND P to P, if it contains a call to RAND or RAND_INTEGER

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Example: RAND_INTEGER() = 1 AND RAND_INTEGER() = 1 is false with a higher probability than RAND_INTEGER() = 1

      Here a test case for RexProgramTest:

      @Test void testSimplifyRandomAnd() {
          checkSimplifyUnchanged(
              and(
                  eq(rexBuilder.makeCall(SqlStdOperatorTable.RAND_INTEGER), literal(1)),
                  eq(rexBuilder.makeCall(SqlStdOperatorTable.RAND_INTEGER), literal(1))
              ));
        }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            thomas.rebele Thomas Rebele
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: