[teiid-issues] [JBoss JIRA] (TEIID-3265) Incorrect result if multiple aggregate functions used

Renat Zhilkibaev (JIRA) issues at jboss.org
Wed Dec 17 13:34:29 EST 2014


     [ https://issues.jboss.org/browse/TEIID-3265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Renat Zhilkibaev updated TEIID-3265:
------------------------------------
    Description: 
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"

  was:
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).

Attached is incorrect-result-if-multiple-aggregate-functions-used.tar.gz which is modified (changed query and text table data) embedded quick start example.
To reproduce execute examples/embedded-portfolio/run.sh



> Incorrect result if multiple aggregate functions used
> -----------------------------------------------------
>
>                 Key: TEIID-3265
>                 URL: https://issues.jboss.org/browse/TEIID-3265
>             Project: Teiid
>          Issue Type: Bug
>          Components: Embedded
>    Affects Versions: 8.9
>            Reporter: Renat Zhilkibaev
>            Assignee: Steven Hawkins
>
> 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"



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the teiid-issues mailing list