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

DRILL-7237: Fix single_value aggregate function for variable length types #1782

Closed
wants to merge 1 commit into from

Conversation

vvysotskyi
Copy link
Member

  • Added implementations of single_value for complex data types

@arina-ielchiieva
Copy link
Member

@KazydubB could you please review?

result.release();
for (String columnName : columns) {
try {
test("select single_value(t.%1$s) as %1$s from %2$s t", columnName, tableName);
Copy link
Member

Choose a reason for hiding this comment

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

Why not use thrown field instead of try-catch as is done in method below (testSingleValueWithMultipleComplexInputs)?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was done because after the first query is failed, thrown checks the error, but the loop is not continued.

"cp.`parquet/alltypes_required.parquet`",
"cp.`parquet/alltypes_optional.parquet`");
for (String tableName : tableNames) {
QueryDataBatch result =
Copy link
Member

Choose a reason for hiding this comment

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

It'd be good to move logic from inner for-loops (here and below) to separate private methods, so that the method's body is not that large, what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, moved the logic for constructing baseline values into a separate method, but left code with a query in the test method for better readability.

…ypes

- Add implementations of single_value for complex data types
Copy link
Member Author

@vvysotskyi vvysotskyi left a comment

Choose a reason for hiding this comment

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

@KazydubB, thanks for the review, I have addressed your comments. Could you please take a look again?

"cp.`parquet/alltypes_required.parquet`",
"cp.`parquet/alltypes_optional.parquet`");
for (String tableName : tableNames) {
QueryDataBatch result =
Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, moved the logic for constructing baseline values into a separate method, but left code with a query in the test method for better readability.

result.release();
for (String columnName : columns) {
try {
test("select single_value(t.%1$s) as %1$s from %2$s t", columnName, tableName);
Copy link
Member Author

Choose a reason for hiding this comment

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

It was done because after the first query is failed, thrown checks the error, but the loop is not continued.

@KazydubB
Copy link
Member

KazydubB commented May 7, 2019

@vvysotskyi thanks, LGTM +1.

@Ben-Zvi
Copy link
Contributor

Ben-Zvi commented May 8, 2019

@arina-ielchiieva - Bohdan is not a committer, so can you please give a +1 ?

@arina-ielchiieva
Copy link
Member

+1

By the way, @Ben-Zvi as batch committer you don't need other committer +1 to commit the changes unless you are completely unsure what is going on in the PR.

@Ben-Zvi
Copy link
Contributor

Ben-Zvi commented May 9, 2019

Thanks @arina-ielchiieva ; in such a case a committer's +1 means - "I trust the reviewer's specific knowledge to do this review properly". And since you are more familiar with Bohdan's knowledge, I asked for your +1. -- Thanks.

@Ben-Zvi Ben-Zvi closed this in 0195d1f May 10, 2019
lushuifeng pushed a commit to lushuifeng/drill that referenced this pull request Jun 21, 2019
…ypes

- Add implementations of single_value for complex data types

closes apache#1782
KazydubB pushed a commit to KazydubB/drill that referenced this pull request Sep 25, 2019
…ypes

- Add implementations of single_value for complex data types

closes apache#1782

(cherry picked from commit 0195d1f)
xiangt920 pushed a commit to xiangt920/drill that referenced this pull request Dec 26, 2019
…ypes

- Add implementations of single_value for complex data types

closes apache#1782
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

Successfully merging this pull request may close these issues.

4 participants