zabetak commented on a change in pull request #2932:
URL: https://github.com/apache/hive/pull/2932#discussion_r781323079
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveAggregateSortLimitRule.java
##########
@@ -55,29 +54,13 @@
*/
public class HiveAggregateSortLimitRule extends RelOptRule {
- private static HiveAggregateSortLimitRule instance = null;
-
- public static final HiveAggregateSortLimitRule getInstance(HiveConf
hiveConf) {
- if (instance == null) {
- RelFieldCollation.NullDirection defaultAscNullDirection;
- if (HiveConf.getBoolVar(hiveConf,
HiveConf.ConfVars.HIVE_DEFAULT_NULLS_LAST)) {
- defaultAscNullDirection = RelFieldCollation.NullDirection.LAST;
- } else {
- defaultAscNullDirection = RelFieldCollation.NullDirection.FIRST;
- }
- instance = new HiveAggregateSortLimitRule(defaultAscNullDirection);
- }
-
- return instance;
- }
-
private final RelFieldCollation.NullDirection defaultAscNullDirection;
-
- private HiveAggregateSortLimitRule(RelFieldCollation.NullDirection
defaultAscNullDirection) {
+ public HiveAggregateSortLimitRule(boolean nullsLast) {
Review comment:
@kasakrisz the rule introduces an "artificial" sort that is not really
requested by the user but exists as an implementation detail. I am thinking
that it may not even be necessary to make this rule configurable as far as it
concerns null ordering. We could hardcode `NULLS FIRST` or `NULLS LAST` and
should be fine I guess. WDYT?
--
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]