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

4 participants
@dain
Copy link
Member

dain commented Feb 6, 2019

@cla-bot

This comment has been minimized.

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.

@martint
Copy link
Member

martint left a comment

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

@dain dain force-pushed the dain:grouped-window-function branch from a8f852a to b3cdf75 Feb 6, 2019

@cla-bot

This comment has been minimized.

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.

@martint

martint approved these changes Feb 6, 2019

@dain

This comment has been minimized.

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)

@dain dain force-pushed the dain:grouped-window-function branch from b3cdf75 to 39e0013 Feb 7, 2019

@cla-bot

This comment has been minimized.

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 prestosql:master Feb 7, 2019

1 check failed

verification/cla-signed
Details

@electrum electrum added this to the 303 milestone Feb 13, 2019

@dain dain referenced this pull request Feb 14, 2019

Closed

Release notes for 303 #181

5 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment