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

join query produces inconsistent result set

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.4.0
    • None
    • None

    Description

      In sqlline, submit the following query multiple times:

      select count
      from (select l.l_orderkey as x, c.c_custkey as y
      from lineitem l
      left outer join customer c
      on l.l_orderkey = c.c_custkey) as foo
      where y < 10000;

      Observation:
      Exactly the same query executed in Postgres produces the following:

      count
      -------
      1467
      (1 row)

      In drill via, results are different each time it is submitted:

      0: jdbc:drill:schema=dfs.TpcH001> select count
      . . . . . . . . . . . . . . . . > from (select l.l_orderkey as x, c.c_custkey as y
      . . . . . . . . . . . . . . . . > from lineitem l
      . . . . . . . . . . . . . . . . > left outer join customer c
      . . . . . . . . . . . . . . . . > on l.l_orderkey = c.c_custkey) as foo
      . . . . . . . . . . . . . . . . > where y < 10000;
      ------------

      EXPR$0

      ------------

      45748

      ------------
      1 row selected (3.592 seconds)
      0: jdbc:drill:schema=dfs.TpcH001> select count
      . . . . . . . . . . . . . . . . > from (select l.l_orderkey as x, c.c_custkey as y
      . . . . . . . . . . . . . . . . > from lineitem l
      . . . . . . . . . . . . . . . . > left outer join customer c
      . . . . . . . . . . . . . . . . > on l.l_orderkey = c.c_custkey) as foo
      . . . . . . . . . . . . . . . . > where y < 10000;
      ------------

      EXPR$0

      ------------

      32292

      ------------
      1 row selected (3.532 seconds)
      0: jdbc:drill:schema=dfs.TpcH001> select count
      . . . . . . . . . . . . . . . . > from (select l.l_orderkey as x, c.c_custkey as y
      . . . . . . . . . . . . . . . . > from lineitem l
      . . . . . . . . . . . . . . . . > left outer join customer c
      . . . . . . . . . . . . . . . . > on l.l_orderkey = c.c_custkey) as foo
      . . . . . . . . . . . . . . . . > where y < 10000;
      ------------

      EXPR$0

      ------------

      35970

      ------------
      1 row selected (3.57 seconds)

      Attachments

        Activity

          People

            Unassigned Unassigned
            zhiyongliu Zhiyong Liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: