miklosgergely commented on a change in pull request #544: HIVE-16924 Support
distinct in presence of Group By
URL: https://github.com/apache/hive/pull/544#discussion_r259958209
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
##########
@@ -4230,6 +4229,34 @@ public static long unsetBit(long bitmap, int bitIdx) {
}
}
+ protected boolean isGroupBy(ASTNode expr) {
+ boolean isGroupBy = false;
+ if (expr.getParent() != null && expr.getParent() instanceof Node)
+ for (Node sibling : ((Node)expr.getParent()).getChildren()) {
+ isGroupBy |= sibling instanceof ASTNode && ((ASTNode)sibling).getType()
== HiveParser.TOK_GROUPBY;
+ }
+
+ return isGroupBy;
+ }
+
+ protected boolean isSelectDistinct(ASTNode expr) {
+ return expr.getType() == HiveParser.TOK_SELECTDI;
+ }
+
+ protected boolean isAggregateInSelect(Node node, Collection<ASTNode>
aggregateFunction) {
+ if (node.getChildren() == null) {
+ return false;
+ }
+
+ for (Node child : node.getChildren()) {
Review comment:
I doubt there is any. The above example is not valid, it says:
Unsupported SubQuery Expression Invalid subquery. Subquery with DISTINCT
clause is not supported!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services