You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/03/05 14:16:28 UTC
[GitHub] [hive] kasakrisz opened a new pull request #2039: HIVE-15757: Allow EXISTS/NOT EXISTS correlated subquery with aggregates
kasakrisz opened a new pull request #2039:
URL: https://github.com/apache/hive/pull/2039
### What changes were proposed in this pull request?
1. When transforming subquery AST to calcite plan check whether the subquery is a full aggregation: has aggregate functions without group by clause
2. When building subquery expression return `true` literal if subquery is a full aggregation having `EXISTS` operator instead of `RexSubQuery`
### Why are the changes needed?
To support queries like:
```
SELECT t1.bigint_col
FROM alltypestiny t1
WHERE EXISTS
(SELECT SUM(smallint_col) AS int_col
FROM alltypestiny
WHERE t1.date_string_col = string_col AND t1.timestamp_col = timestamp_col)
GROUP BY t1.bigint_col
```
### Does this PR introduce _any_ user-facing change?
Yes. Current Hive implementation throws exception when compiling queries like the example above. With this patch query compiles and runs.
### How was this patch tested?
```
mvn test -Dtest.output.overwrite -DskipSparkTests -Dtest=TestMiniLlapLocalCliDriver -Dqfile=subquery_full_aggregate.q -pl itests/qtest -Pitests
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] jcamachor commented on pull request #2039: HIVE-15757: Allow EXISTS/NOT EXISTS correlated subquery with aggregates
Posted by GitBox <gi...@apache.org>.
jcamachor commented on pull request #2039:
URL: https://github.com/apache/hive/pull/2039#issuecomment-791684687
I gave +1 based on the code but I see there are some test failures. Please let me know when those are addressed and I can take a look again. Thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] jcamachor edited a comment on pull request #2039: HIVE-15757: Allow EXISTS/NOT EXISTS correlated subquery with aggregates
Posted by GitBox <gi...@apache.org>.
jcamachor edited a comment on pull request #2039:
URL: https://github.com/apache/hive/pull/2039#issuecomment-791684687
I gave +1 based on the code but I have just seen there are some test failures. Please let me know when those are addressed and I can take a look again. Thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org
[GitHub] [hive] kasakrisz merged pull request #2039: HIVE-15757: Allow EXISTS/NOT EXISTS correlated subquery with aggregates
Posted by GitBox <gi...@apache.org>.
kasakrisz merged pull request #2039:
URL: https://github.com/apache/hive/pull/2039
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org