Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-7194

Wrong result when non-deterministic functions are used in filter

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.15.0
    • Fix Version/s: Future
    • Component/s: None
    • Labels:
      None

      Description

      Drill returns the wrong result when non-deterministic functions are used in filter condition, for example, the next query:

      select 1 from (values(1)) where random()=random();
      

      returns

      +--------+
      | EXPR$0 |
      +--------+
      | 1      |
      +--------+
      1 row selected (0.105 seconds)
      

      but random()=random() should be false, and therefore query shouldn't return any rows.

      If this condition is used in projection, it returns the correct result:

      select random()=random();
      

      returns

      +--------+
      | EXPR$0 |
      +--------+
      | false  |
      +--------+
      1 row selected (1.558 seconds)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              volodymyr Vova Vysotskyi
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: