Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query with more than one GROUP BY column does not work #27

Open
kristinriebe opened this issue Oct 16, 2014 · 0 comments
Open

Query with more than one GROUP BY column does not work #27

kristinriebe opened this issue Oct 16, 2014 · 0 comments

Comments

@kristinriebe
Copy link

Only the second GROUP BY column is transferred to the node-query, thus the result is not correct.
(Current work around: need to do several individual queries for each snapnum.)

Query:

SELECT snapnum, 0.25*(0.5+FLOOR(LOG10(Mvir)/0.25)) AS log_mass, COUNT(*) AS num FROM MDR1.BDMV WHERE hostFlag = -1 GROUP BY snapnum, FLOOR(LOG10(Mvir)/0.25) ORDER BY snapnum, log_mass

Query plan:

-- CALL paquExec('SELECT `snapnum` AS `snapnum`,0.25 * ( 0.5 + FLOOR( LOG10( `Mvir` ) / 0.25 ) ) AS `log_mass`,COUNT(*) AS `num`,FLOOR( LOG10( `Mvir` ) / 0.25 ) AS `_FLOOR_LOG10_Mvir_/_0__25_` FROM MDR1.BDMV WHERE ( `hostFlag` = -1 ) GROUP BY FLOOR( LOG10( Mvir ) / 0.25 ) ', 'aggregation_tmp_38308961')
-- USE spider_tmp_shard
-- SET @i=0-- CREATE TABLE cosmosim_user_kristin.`mdr1-massfunctions2` ENGINE=MyISAM SELECT @i:=@i+1 AS `row_id`, `snapnum`,`log_mass`,SUM(`num`) AS `num` FROM `aggregation_tmp_38308961` GROUP BY `snapnum`,`_FLOOR_LOG10_Mvir_/_0__25_` ORDER BY `snapnum` ASC,`log_mass` ASC 
-- CALL paquDropTmp('aggregation_tmp_38308961')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant