Skip to content

Fix druid sql group by queries returning complex aggregation type#8099

Merged
gianm merged 2 commits intoapache:masterfrom
samarthjain:sqlfix
Jul 19, 2019
Merged

Fix druid sql group by queries returning complex aggregation type#8099
gianm merged 2 commits intoapache:masterfrom
samarthjain:sqlfix

Conversation

@samarthjain
Copy link
Copy Markdown
Contributor

Fixes #8093 .

@gianm - thanks for your suggestion. That fixed the issue. Please review when you get a chance.

Copy link
Copy Markdown
Contributor

@gianm gianm left a comment

Choose a reason for hiding this comment

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

Main code looks good, just had one comment about a needless check.

Could you also include a regression unit test that fails in master but passes with this patch? Maybe BloomFilterSqlAggregatorTest would be a good spot to put it.

I'd suggest including a comment like,

// Regression test for https://github.com/apache/incubator-druid/issues/8093.

);
// We don't really have a way to cast complex type. So might as well not do anything and return.
final ValueType columnValueType = aggregateRowSignature.getColumnType(expression.getDirectColumn());
if (expression.isDirectColumnAccess() && columnValueType == ValueType.COMPLEX) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

expression.isDirectColumnAccess() is already known true due to the check above, so isn't needed here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Main code looks good, just had one comment about a needless check.

Could you also include a regression unit test that fails in master but passes with this patch? Maybe BloomFilterSqlAggregatorTest would be a good spot to put it.

I'd suggest including a comment like,

// Regression test for https://github.com/apache/incubator-druid/issues/8093.

Removed the check.

I have a PR out for SQL support for t-digests that has a test testGeneratingSketchAndComputingQuantileOnFly (952a553#diff-506b4b10165c4dd7af44701956a3cea5R267) that fails without this patch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That sounds fine, but could you please add the comment to the other PR's test then? The idea is that if a test is verifying that a bug was fixed it's good for it to link to the original issue.

@gianm gianm merged commit ceb3a89 into apache:master Jul 19, 2019
@clintropolis clintropolis added this to the 0.16.0 milestone Aug 8, 2019
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.

SQL GroupBy query fails for aggregations returning complex type

3 participants