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

Wrong result when non-deterministic functions are used in filter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.15.0
    • Future
    • None
    • 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

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

            Dates

              Created:
              Updated: