Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-6507

DistinctAggregatingResultIterator should keep original tuple order of the AggregatingResultIterator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.16.1, 5.1.2
    • 4.17.0, 5.2.0, 5.1.3
    • None
    • None

    Description

      Given following tables :

         create table test ( 
            pk1 varchar not null , 
            pk2 varchar not null, 
            pk3 varchar not null,
             v1 varchar, 
             v2 varchar, 
            CONSTRAINT TEST_PK PRIMARY KEY ( pk1,pk2,pk3))
      

      The result of the following sql may be incorrect:

         select distinct pk1,max(v1) from test group by pk1,pk2,pk3 order by pk1
      

      The problem is the order by is complied out because it is the prefix of the group by, but for distinct, DistinctAggregatingResultIterator using HashSet to rearrange the aggregated tuples.

      Attachments

        1. PHOENIX-6507_v2-4.x.patch
          27 kB
          chenglei
        2. PHOENIX-6507_v2-master.patch
          27 kB
          chenglei

        Issue Links

          Activity

            People

              comnetwork chenglei
              comnetwork chenglei
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: