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

Support grouped execution for window function #169

Merged
merged 1 commit into from
Feb 7, 2019

Conversation

dain
Copy link
Member

@dain dain commented Feb 6, 2019

@cla-bot
Copy link

cla-bot bot commented Feb 6, 2019

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@prestosql.io. If you are contributing on behalf of someone else (e.g., your employer), the individual CLA may not be sufficient and your employer may need the Corporate CLA signed.

Copy link
Member

@martint martint left a comment

Choose a reason for hiding this comment

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

The logic looks good, but I have some comments about naming and the flag that gates this behavior.

@cla-bot
Copy link

cla-bot bot commented Feb 6, 2019

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@prestosql.io. If you are contributing on behalf of someone else (e.g., your employer), the individual CLA may not be sufficient and your employer may need the Corporate CLA signed.

@dain
Copy link
Member Author

dain commented Feb 6, 2019

Failure:

[ERROR] testGroupedExecution(io.prestosql.plugin.hive.TestHiveIntegrationSmokeTest)  Time elapsed: 1.115 s  <<< FAILURE!
java.lang.AssertionError: 
Expected [
1
] remote exchanges but found [
2
] remote exchanges. Actual plan is [

- Output[key, _col1] => [key:bigint, count:bigint]
        _col1 := count
    - RemoteExchange[GATHER] => key:bigint, count:bigint
        - Project[] => [key:bigint, count:bigint]
            - Window[partition by (key), order by (value ASC_NULLS_LAST)][$hashvalue] => [key:bigint, value:bigint, $hashvalue:bigint, count:bigint]
                    count := count() RANGE UNBOUNDED_PRECEDING CURRENT_ROW
                - LocalExchange[HASH][$hashvalue] ("key") => key:bigint, value:bigint, $hashvalue:bigint
                    - RemoteExchange[REPARTITION][$hashvalue_9] => key:bigint, value:bigint, $hashvalue_9:bigint
                        - ScanProject[table = hive:HiveTableHandle{schemaName=tpch, tableName=test_grouped_window, analyzePartitionValues=Optional.empty}] => [key:bigint, value:bigint, $hashvalue_10:bigint]
                                $hashvalue_10 := "combine_hash"(bigint '0', COALESCE("$operator$hash_code"("key"), 0))
                                LAYOUT: tpch.test_grouped_window bucket=5
                                value := value:bigint:1:REGULAR
                                key := key:bigint:0:REGULAR

]
	at io.prestosql.plugin.hive.TestHiveIntegrationSmokeTest.lambda$assertRemoteExchangesCount$12(TestHiveIntegrationSmokeTest.java:2877)
	at io.prestosql.tests.QueryAssertions.assertQuery(QueryAssertions.java:154)
	at io.prestosql.tests.QueryAssertions.assertQuery(QueryAssertions.java:119)
	at io.prestosql.tests.AbstractTestQueryFramework.assertQuery(AbstractTestQueryFramework.java:148)
	at io.prestosql.plugin.hive.TestHiveIntegrationSmokeTest.testGroupedExecution(TestHiveIntegrationSmokeTest.java:2773)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

@cla-bot
Copy link

cla-bot bot commented Feb 7, 2019

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to cla@prestosql.io. If you are contributing on behalf of someone else (e.g., your employer), the individual CLA may not be sufficient and your employer may need the Corporate CLA signed.

@dain dain merged commit cd45f35 into trinodb:master Feb 7, 2019
@electrum electrum added this to the 303 milestone Feb 13, 2019
@dain dain mentioned this pull request Feb 14, 2019
6 tasks
rice668 pushed a commit to rice668/trino that referenced this pull request Jan 31, 2023
rice668 added a commit to rice668/trino that referenced this pull request Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants