zabetak commented on code in PR #6560:
URL: https://github.com/apache/hive/pull/6560#discussion_r3479982027
##########
ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java:
##########
@@ -64,25 +83,8 @@ public String getName() {
int outerQueryLimit;
boolean hasJoin = false;
- boolean hasGroupBy = false;
- boolean hasOrderBy = false;
- boolean hasOuterOrderBy = false;
- boolean hasSortBy = false;
- boolean hasLimit = false;
- boolean hasJoinFollowedByGroupBy = false;
- boolean hasPTF = false;
- boolean hasWindowing = false;
- boolean hasQualify = false;
- boolean hasExcept = false;
- boolean hasIntersect = false;
-
- // does the query have a using clause
- boolean usesScript = false;
-
- boolean hasDistributeBy = false;
- boolean hasClusterBy = false;
+ private final EnumSet<QueryFeature> features =
EnumSet.noneOf(QueryFeature.class);
boolean mapJoinRemoved = false;
Review Comment:
This seems to be unused so it can be dropped; it is set but never
queried/accessed. Check if there are other unused feature/flags and remove them
as well.
##########
ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java:
##########
Review Comment:
I would put CTAS, and ANALYZE as feature as wells. For the mutliple analyze
variants maybe we could use multiple enum entries:
analyzeCommand -> QueryFeature.ANALYZE
noScanAnalyze -> QueryFeature.ANALYZE + QueryFeature.NO_SCAN
analyzeRewrite -> QueryFeature.ANALYZE + QueryFeature.REWRITE
##########
ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java:
##########
@@ -64,25 +83,8 @@ public String getName() {
int outerQueryLimit;
boolean hasJoin = false;
Review Comment:
Feature as well.
##########
ql/src/java/org/apache/hadoop/hive/ql/QueryProperties.java:
##########
@@ -196,116 +198,124 @@ public boolean isCBOSupportedLateralViews() {
return cboSupportedLateralViews;
}
+ public void addFeature(QueryFeature feature) {
+ features.add(feature);
+ }
+
+ public boolean hasFeature(QueryFeature feature) {
+ return features.contains(feature);
+ }
+
public boolean hasGroupBy() {
Review Comment:
Agree, it would be nice to get rid of the setters/getters. It's a rather
internal class so I don't think we need to deprecate first.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]