Skip to content

[SQL] Fix missing postAggregations for Timeseries and TopN#5912

Merged
gianm merged 3 commits intoapache:masterfrom
jihoonson:fix-post-agg-for-timeseries-topn
Jun 29, 2018
Merged

[SQL] Fix missing postAggregations for Timeseries and TopN#5912
gianm merged 3 commits intoapache:masterfrom
jihoonson:fix-post-agg-for-timeseries-topn

Conversation

@jihoonson
Copy link
Copy Markdown
Contributor

@jihoonson jihoonson commented Jun 27, 2018

In SQL, postAggregations such as SUM(m1) + SUM(m2) are missing in the query plan, thereby resulting in nulls. See the newly added unit tests in the patch for example queries.


This change is Reviewable

Copy link
Copy Markdown
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gianm
Copy link
Copy Markdown
Contributor

gianm commented Jun 28, 2018

@jihoonson the failure looks legit… probably related to "second" query granularity being too much for the test box to handle?

testPostAggWithTimeseries(io.druid.sql.calcite.CalciteQueryTest)  Time elapsed: 88.982 sec  <<< ERROR!
java.lang.OutOfMemoryError: GC overhead limit exceeded
	at io.druid.java.util.common.granularity.PeriodGranularity.increment(PeriodGranularity.java:115)
	at io.druid.java.util.common.granularity.Granularity$IntervalIterator.next(Granularity.java:235)
	at io.druid.java.util.common.granularity.Granularity$IntervalIterator.next(Granularity.java:205)
	at com.google.common.collect.ImmutableCollection$Builder.addAll(ImmutableCollection.java:301)
	at com.google.common.collect.ImmutableList$Builder.addAll(ImmutableList.java:691)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:275)
	at com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:226)
	at io.druid.segment.QueryableIndexStorageAdapter$CursorSequenceBuilder.build(QueryableIndexStorageAdapter.java:381)
	at io.druid.segment.QueryableIndexStorageAdapter.makeCursors(QueryableIndexStorageAdapter.java:313)
	at io.druid.query.QueryRunnerHelper.makeCursorBasedQuery(QueryRunnerHelper.java:59)
	at io.druid.query.timeseries.TimeseriesQueryEngine.process(TimeseriesQueryEngine.java:50)
	at io.druid.query.timeseries.TimeseriesQueryRunnerFactory$TimeseriesQueryRunner.run(TimeseriesQueryRunnerFactory.java:104)

@jihoonson
Copy link
Copy Markdown
Contributor Author

@gianm thanks. I've fixed the test.

@gianm gianm merged commit 10a01d6 into apache:master Jun 29, 2018
@gianm
Copy link
Copy Markdown
Contributor

gianm commented Jun 29, 2018

thanks @jihoonson!

gianm pushed a commit to implydata/druid-public that referenced this pull request Jul 2, 2018
* [SQL] Fix missing postAggregations for Timeseries and TopN

* fix build

* fix test
@jihoonson jihoonson added this to the 0.13.0 milestone Jul 5, 2018
@gianm
Copy link
Copy Markdown
Contributor

gianm commented Aug 25, 2018

I believe this fixes a bug introduced by #5788, so it must be included in 0.12.3. I'll mark it.

@gianm gianm modified the milestones: 0.13.0, 0.12.3 Aug 25, 2018
gianm pushed a commit to gianm/druid that referenced this pull request Aug 26, 2018
* [SQL] Fix missing postAggregations for Timeseries and TopN

* fix build

* fix test
fjy pushed a commit that referenced this pull request Aug 27, 2018
…6237)

* [SQL] Fix missing postAggregations for Timeseries and TopN

* fix build

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants