Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3265

Incorrect result if multiple aggregate functions used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 8.9
    • Embedded
    • None

      When using multiple aggregate functions the value returned by the first one is used as a result of the second one.

      With data looking like this:
      SYMBOL,PRICE
      GE,10.45
      GE,15.45
      GE,20.45

      and this query:
      select symbol, max(price), min(price) from mytable group by symbol

      result looks like this:
      GE, 20.45,20.45

      Note the last value is 20.45 which is not a correct value (10.45).

      To reproduce download teiid-8.9.0.Final-embedded-dist.zip from http://sourceforge.net/projects/teiid/files/teiid-8.9.0.Final-embedded-dist.zip/download
      replace content of examples/embedded-portfolio/data/marketdata-price.txt with
      SYMBOL,PRICE
      GE,10.45
      GE,15.45
      GE,20.45
      Then change the query at
      examples/embedded-portfolio/src/org/teiid/example/TeiidEmbeddedPortfolio.java line 186 to be "select symbol, max(price), min(price) from MyView.portfolio group by symbol"
      Then execute examples/embedded-portfolio/run.sh

            rhn-engineering-shawkins Steven Hawkins
            renat000 Renat Zhilkibaev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: