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

Drill never returns when we use aggregate functions after a join with an order by

    XMLWordPrintableJSON

Details

    Description

      git.commit.id.abbrev=6676f2d

      The below query never returns : (Order by seems to be the culprit)

      create view v1 as select uid, flatten(events) event from `data.json`;
      create view v2 as select uid, flatten(transactions) transaction from `data.json`;
      select v1.uid, MAX(v2.transaction.amount), MIN(v1.event.event_time) from v1 inner join v2 on v1.uid = v2.uid where v2.transaction.trans_time < 0 group by v1.uid order by v1.uid;
      

      There seems to be constant activity in the drillbit.log file. The below message is continuously displayed in the log file

      2015-02-20 23:35:04,450 [2b183b65-4551-bb9a-35ca-b71b9eedc4d6:frag:1:2] INFO  o.a.d.exec.vector.BaseValueVector - Realloc vector null. [32768] -> [65536]
      2015-02-20 23:35:04,451 [2b183b65-4551-bb9a-35ca-b71b9eedc4d6:frag:1:2] INFO  o.a.d.exec.vector.BaseValueVector - Realloc vector null. [32768] -> [65536]
      2015-02-20 23:35:04,451 [2b183b65-4551-bb9a-35ca-b71b9eedc4d6:frag:1:2] INFO  o.a.d.exec.vector.BaseValueVector - Realloc vector null. [32768] -> [65536]
      

      Drill returns correct data when we remove one of the agg functions or use multiple aggs from the same side of the join. The below queries work :

       select v1.uid, MAX(v2.transaction.amount) from v1 inner join v2 on v1.uid = v2.uid where v2.transaction.trans_time < 0 group by v1.uid order by v1.uid;
      
       select v1.uid, MAX(v2.transaction.amount), MAX(v2.transaction.amount) from v1 inner join v2 on v1.uid = v2.uid where v2.transaction.trans_time < 0 group by v1.uid order by v1.uid;
      

      Attached the dataset which contains 2 records. I copied over the same 2 records 50000 times and ran the queries on the data set. Let me know if you need anything else.

      Attachments

        1. data.json
          4 kB
          Rahul Kumar Challapalli

        Activity

          People

            adeneche Abdel Hakim Deneche
            rkins Rahul Kumar Challapalli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: