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

[native] Fix the intermediate type of approx_percentile #18386

Merged
merged 3 commits into from Oct 3, 2022

Conversation

Yuhta
Copy link
Contributor

@Yuhta Yuhta commented Sep 22, 2022

Summary:
Before this change, intermediate aggregation node for approx_percentile in worker only sees a type signature of VARBINARY -> VARBINARY, thus not be able to figure out the actual value type and cannot perform the merge properly when the value type is not DOUBLE.

This fix changes the intermediate result type to ROW so that we can get the value type from it and instantiate accumulator with proper type.

Fix facebookincubator/velox#2430

Differential Revision: D39733152

@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D39733152

Yuhta added a commit to Yuhta/velox that referenced this pull request Sep 22, 2022
Summary:
X-link: prestodb/presto#18386

Pull Request resolved: facebookincubator#2621

Before this change, intermediate aggregation node for `approx_percentile` in worker only sees a type signature of `VARBINARY -> VARBINARY`, thus not be able to figure out the actual value type and cannot perform the merge properly when the value type is not `DOUBLE`.

This fix changes the intermediate result type to `ROW` so that we can get the value type from it and instantiate accumulator with proper type.

Fix facebookincubator#2430

Differential Revision: D39733152

fbshipit-source-id: 6256b33f2ac3e6da405f0e0a0b14bfb85c17c8b0
Yuhta added a commit to Yuhta/velox that referenced this pull request Sep 27, 2022
Summary:
X-link: prestodb/presto#18386

Pull Request resolved: facebookincubator#2621

Before this change, intermediate aggregation node for `approx_percentile` in worker only sees a type signature of `VARBINARY -> VARBINARY`, thus not be able to figure out the actual value type and cannot perform the merge properly when the value type is not `DOUBLE`.

This fix changes the intermediate result type to `ROW` so that we can get the value type from it and instantiate accumulator with proper type.

Fix facebookincubator#2430

Differential Revision: D39733152

fbshipit-source-id: 5fc2ce9bbcecff2881d5e275393cc4ee4eab55c9
Yuhta added a commit to Yuhta/velox that referenced this pull request Sep 27, 2022
Summary:
X-link: prestodb/presto#18386

Pull Request resolved: facebookincubator#2621

Before this change, intermediate aggregation node for `approx_percentile` in worker only sees a type signature of `VARBINARY -> VARBINARY`, thus not be able to figure out the actual value type and cannot perform the merge properly when the value type is not `DOUBLE`.

This fix changes the intermediate result type to `ROW` so that we can get the value type from it and instantiate accumulator with proper type.

Fix facebookincubator#2430

Differential Revision: D39733152

fbshipit-source-id: 80ea0a3a9799ee7a070cc542b6b91268be71ae01
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D39733152

Yuhta added a commit to Yuhta/velox that referenced this pull request Sep 28, 2022
Summary:
X-link: prestodb/presto#18386

Pull Request resolved: facebookincubator#2621

Before this change, intermediate aggregation node for `approx_percentile` in worker only sees a type signature of `VARBINARY -> VARBINARY`, thus not be able to figure out the actual value type and cannot perform the merge properly when the value type is not `DOUBLE`.

This fix changes the intermediate result type to `ROW` so that we can get the value type from it and instantiate accumulator with proper type.

Fix facebookincubator#2430

Reviewed By: mbasmanova

Differential Revision: D39733152

fbshipit-source-id: f7476a9a4a2e92d7fdc976f388a07692787cada8
@facebook-github-bot
Copy link
Collaborator

This pull request was exported from Phabricator. Differential Revision: D39733152

facebook-github-bot pushed a commit to facebookincubator/velox that referenced this pull request Sep 28, 2022
Summary:
X-link: prestodb/presto#18386

Pull Request resolved: #2621

Before this change, intermediate aggregation node for `approx_percentile` in worker only sees a type signature of `VARBINARY -> VARBINARY`, thus not be able to figure out the actual value type and cannot perform the merge properly when the value type is not `DOUBLE`.

This fix changes the intermediate result type to `ROW` so that we can get the value type from it and instantiate accumulator with proper type.

Fix #2430

Reviewed By: mbasmanova

Differential Revision: D39733152

fbshipit-source-id: b47e784aabd70ba4324f0208bee35d427b7a1dc1
@Yuhta
Copy link
Contributor Author

Yuhta commented Sep 29, 2022

@ChunxuTang Hi can you take a look? The test will pass once we advance the Velox version

@Yuhta
Copy link
Contributor Author

Yuhta commented Sep 30, 2022

@mbasmanova Can you help stamp and merge this PR?

@mbasmanova
Copy link
Contributor

@Yuhta Jimmy, there are test failures. Would you take a look?

@Yuhta
Copy link
Contributor Author

Yuhta commented Sep 30, 2022

@Yuhta Jimmy, there are test failures. Would you take a look?

The test should pass if we sync up the Velox version (I ran it on devserver before I land the change internally). Should I advance the version in this PR to make it pass?

@mbasmanova
Copy link
Contributor

Yes, let's advance Velox version and add an e2e test that runs intermediate aggregation using approx_percentile. Also, please, update the commit message to following the guidelines at https://cbea.ms/git-commit/ and wrap it at 72 characters.

@Yuhta Yuhta requested a review from a team as a code owner September 30, 2022 17:45
@Yuhta Yuhta changed the title Change the intermediate type of approx_percentile to ROW [native] Fix the intermediate type of approx_percentile Sep 30, 2022
Before this change, intermediate aggregation node for
`approx_percentile` in worker only sees a type signature of `VARBINARY
-> VARBINARY`, thus not be able to figure out the actual value type and
cannot perform the merge properly when the value type is not `DOUBLE`.

This fix changes the intermediate result type to `ROW` so that we can
get the value type from it and instantiate accumulator with proper type.

Fix facebookincubator/velox#2430
@Yuhta
Copy link
Contributor Author

Yuhta commented Oct 1, 2022

@spershin @mbasmanova Some unrelated tests failed, can we still merge it?

Failures: 
Error:    TestHiveQueriesUsingThrift.testCatalogWithCacheEnabled:16->TestHiveQueries.testCatalogWithCacheEnabled:52->AbstractTestQueryFramework.assertQuery:144->AbstractTestQueryFramework.assertQuery:149 Execution of 'actual' query failed: SELECT * FROM tmp
Error:    TestHiveQueriesUsingThrift.testCreateTableAsSelect:16->TestHiveQueries.testCreateTableAsSelect:578 ? Runtime Unable to rename from file:/tmp/presto-hive/eed1f451-83d9-4c44-96e9-763adc3fe805 to file:/tmp/hive_data/tpch/tmp: target directory already exists

@mbasmanova
Copy link
Contributor

@majetideepak Deepak, I thought you fixed these failures. Would you take a look?

Failures: 
Error:    TestHiveQueriesUsingThrift.testCatalogWithCacheEnabled:16->TestHiveQueries.testCatalogWithCacheEnabled:52->AbstractTestQueryFramework.assertQuery:144->AbstractTestQueryFramework.assertQuery:149 Execution of 'actual' query failed: SELECT * FROM tmp
Error:    TestHiveQueriesUsingThrift.testCreateTableAsSelect:16->TestHiveQueries.testCreateTableAsSelect:578 ? Runtime Unable to rename from file:/tmp/presto-hive/eed1f451-83d9-4c44-96e9-763adc3fe805 to file:/tmp/hive_data/tpch/tmp: target directory already exists

@majetideepak
Copy link
Collaborator

@mbasmanova these failures are different. #18437 is tracking this. I am going to take a look.

Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

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

@Yuhta Thank you, Jimmy. Accepting based on @majetideepak comment that suggests that test failures are unrelated and are being looked into separately.

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.

Use transparent row type instead of varbinary as intermediate type for approx_percentile
5 participants