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

Add tuple argument support for argMin and argMax #17359

Merged
merged 2 commits into from Jan 22, 2021

Conversation

ildus
Copy link
Contributor

@ildus ildus commented Nov 24, 2020

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Add support of tuple argument to argMin and argMax functions.

Detailed description / Documentation draft:

This commit adds support of tuple argument (with two elements) to argMin and argMax functions, and for this kind of calls changes return value to the tuple too. This allows to use them in SimpleAggregateFunction, since the tuple works as a state. Also could be useful for discovering maximum and minimum values from comparisons.

@robot-clickhouse robot-clickhouse added doc-alert pr-feature Pull request with new product feature labels Nov 24, 2020
@Avogar Avogar self-assigned this Nov 24, 2020
@ildus
Copy link
Contributor Author

ildus commented Dec 21, 2020

@Avogar hi, could you look at ClickHouse/dragonbox#2? I suspect that build errors are related with dragonbox.

@Avogar
Copy link
Member

Avogar commented Dec 21, 2020

@Avogar hi, could you look at ClickHouse-Extras/dragonbox#2? I suspect that build errors are related with dragonbox.

Hi, I don't have rights to merge PR in ClickHouse-Extras, you can ask @alexey-milovidov. I had a look at build errors, it seems that splitting argMin(Max) creators to separate file was not enough and the translation unit is still too large. May be you can try to simplify it somehow?

@ildus
Copy link
Contributor Author

ildus commented Dec 21, 2020

I tried to run the failed command locally and the build failed on dragonbox. Just wanted to check it first. The simpilfying also makes sense, I'll look into it.

@ildus
Copy link
Contributor Author

ildus commented Jan 22, 2021

@Avogar Eventually I removed using templates for the tuple argument, and have added extracting of columns on addBatch* level, this gives almost same performance as with usual columns, but with the price of more code.

@Avogar Avogar merged commit b2d5370 into ClickHouse:master Jan 22, 2021
@ildus
Copy link
Contributor Author

ildus commented Jan 22, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature Pull request with new product feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants