You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:31:34 UTC
[GitHub] [incubator-pinot] wuwenw opened a new pull request #7052: Add Query Options for GroupBy In-Segment Trim
wuwenw opened a new pull request #7052:
URL: https://github.com/apache/incubator-pinot/pull/7052
## Description
<!-- Add a description of your PR here.
A good description should include pointers to an issue or design document, etc.
-->
This PR adds query options for groupBy in-segment trim. Two options are added: segmentMinTrimSize and segmentEnableTrim.
If segmentMinTrimSize is set to be positive in the query option, it will override the server config and trigger the trim based on the given number. If segmentEnableTrim is set to be true in the query option, it will override the server config and trigger the trim based on the default trim size (5000).
Example:
minTrimSize in server config: 0
Query: "SELECT metric_0, max(metric_1) FROM testTable GROUP BY metric_0 ORDER BY max(metric_1) DESC LIMIT 50 OPTION(segmentMinTrimSize=1000)")
=> max(5*limit, 1000): 1000
=> so expectedSize from each segment: 1000
## Upgrade Notes
Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
* [ ] Yes (Please label as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
Does this PR fix a zero-downtime upgrade introduced earlier?
* [ ] Yes (Please label this as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
Does this PR otherwise need attention when creating release notes? Things to consider:
- New configuration options
- Deprecation of configurations
- Signature changes to public methods/interfaces
- New plugins added or old plugins removed
* [ ] Yes (Please label this PR as **<code>release-notes</code>** and complete the section on Release Notes)
## Release Notes
<!-- If you have tagged this as either backward-incompat or release-notes,
you MUST add text here that you would like to see appear in release notes of the
next release. -->
<!-- If you have a series of commits adding or enabling a feature, then
add this section only in final commit that marks the feature completed.
Refer to earlier release notes to see examples of text.
-->
## Documentation
<!-- If you have introduced a new feature or configuration, please add it to the documentation as well.
See https://docs.pinot.apache.org/developers/developers-and-contributors/update-document
-->
--
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] wuwenw commented on a change in pull request #7052: Add Query Options for GroupBy In-Segment Trim
Posted by GitBox <gi...@apache.org>.
wuwenw commented on a change in pull request #7052:
URL: https://github.com/apache/incubator-pinot/pull/7052#discussion_r654124536
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptions.java
##########
@@ -82,4 +98,24 @@ public static Long getTimeoutMs(Map<String, String> queryOptions) {
return null;
}
}
+
+ @Nullable
+ public static Boolean getEnableSegmentTrim(Map<String, String> queryOptions) {
+ String enableSegmentTrim = queryOptions.get(Request.QueryOptionKey.SEGMENT_ENABLE_TRIM);
+ if (enableSegmentTrim != null) {
+ return Boolean.parseBoolean(enableSegmentTrim);
+ } else {
+ return null;
+ }
+ }
Review comment:
Has to bring back null check to avoid nullpointerexception
--
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-commenter edited a comment on pull request #7052: Add Query Options for GroupBy In-Segment Trim
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #7052:
URL: https://github.com/apache/incubator-pinot/pull/7052#issuecomment-859828970
--
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #7052: Add Query Options for GroupBy In-Segment Trim
Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #7052:
URL: https://github.com/apache/incubator-pinot/pull/7052#discussion_r653803756
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptions.java
##########
@@ -41,15 +43,39 @@ public QueryOptions(@Nullable Map<String, String> queryOptions) {
_responseFormatSQL = Request.SQL.equalsIgnoreCase(queryOptions.get(Request.QueryOptionKey.RESPONSE_FORMAT));
_preserveType = Boolean.parseBoolean(queryOptions.get(Request.QueryOptionKey.PRESERVE_TYPE));
_skipUpsert = Boolean.parseBoolean(queryOptions.get(Request.QueryOptionKey.SKIP_UPSERT));
+ _enableSegmentTrim = Boolean.parseBoolean(queryOptions.get(Request.QueryOptionKey.ENABLE_SEGMENT_TRIM));
+ _minSegmentTrimSize = Integer.parseInt(queryOptions.get(Request.QueryOptionKey.MIN_SEGMENT_TRIM_SIZE));
} else {
_timeoutMs = null;
_groupByModeSQL = false;
_responseFormatSQL = false;
_preserveType = false;
_skipUpsert = false;
+ _enableSegmentTrim = false;
+ _minSegmentTrimSize = -1;
}
}
+ @Nullable
+ public static Long getTimeoutMs(Map<String, String> queryOptions) {
+ String timeoutMsString = queryOptions.get(Request.QueryOptionKey.TIMEOUT_MS);
+ if (timeoutMsString != null) {
+ long timeoutMs = Long.parseLong(timeoutMsString);
+ Preconditions.checkState(timeoutMs > 0, "Query timeout must be positive, got: %s", timeoutMs);
+ return timeoutMs;
+ } else {
+ return null;
+ }
+ }
+
+ public static boolean getEnableSegmentTrim(Map<String, String> queryOptions) {
Review comment:
```suggestion
public static boolean isEnableSegmentTrim(Map<String, String> queryOptions) {
```
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptions.java
##########
@@ -72,14 +98,12 @@ public boolean isSkipUpsert() {
}
@Nullable
- public static Long getTimeoutMs(Map<String, String> queryOptions) {
- String timeoutMsString = queryOptions.get(Request.QueryOptionKey.TIMEOUT_MS);
- if (timeoutMsString != null) {
- long timeoutMs = Long.parseLong(timeoutMsString);
- Preconditions.checkState(timeoutMs > 0, "Query timeout must be positive, got: %s", timeoutMs);
- return timeoutMs;
- } else {
- return null;
- }
+ public Boolean isEnableSegmentTrim() {
+ return _enableSegmentTrim;
+ }
+
+ @Nullable
+ public Integer getMinSegmentTrimSize() {
+ return _minSegmentTrimSize;
}
-}
+}
Review comment:
(nit) new line
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptions.java
##########
@@ -41,15 +43,39 @@ public QueryOptions(@Nullable Map<String, String> queryOptions) {
_responseFormatSQL = Request.SQL.equalsIgnoreCase(queryOptions.get(Request.QueryOptionKey.RESPONSE_FORMAT));
_preserveType = Boolean.parseBoolean(queryOptions.get(Request.QueryOptionKey.PRESERVE_TYPE));
_skipUpsert = Boolean.parseBoolean(queryOptions.get(Request.QueryOptionKey.SKIP_UPSERT));
+ _enableSegmentTrim = Boolean.parseBoolean(queryOptions.get(Request.QueryOptionKey.ENABLE_SEGMENT_TRIM));
+ _minSegmentTrimSize = Integer.parseInt(queryOptions.get(Request.QueryOptionKey.MIN_SEGMENT_TRIM_SIZE));
} else {
_timeoutMs = null;
_groupByModeSQL = false;
_responseFormatSQL = false;
_preserveType = false;
_skipUpsert = false;
+ _enableSegmentTrim = false;
+ _minSegmentTrimSize = -1;
}
}
+ @Nullable
+ public static Long getTimeoutMs(Map<String, String> queryOptions) {
+ String timeoutMsString = queryOptions.get(Request.QueryOptionKey.TIMEOUT_MS);
+ if (timeoutMsString != null) {
+ long timeoutMs = Long.parseLong(timeoutMsString);
+ Preconditions.checkState(timeoutMs > 0, "Query timeout must be positive, got: %s", timeoutMs);
+ return timeoutMs;
+ } else {
+ return null;
+ }
+ }
+
+ public static boolean getEnableSegmentTrim(Map<String, String> queryOptions) {
+ return Boolean.parseBoolean(queryOptions.get(Request.QueryOptionKey.ENABLE_SEGMENT_TRIM));
+ }
+
+ public static int getSegmentTrimSize(Map<String, String> queryOptions) {
Review comment:
```suggestion
public static int getMinSegmentTrimSize(Map<String, String> queryOptions) {
```
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptions.java
##########
@@ -82,4 +98,24 @@ public static Long getTimeoutMs(Map<String, String> queryOptions) {
return null;
}
}
+
+ @Nullable
+ public static Boolean getEnableSegmentTrim(Map<String, String> queryOptions) {
+ String enableSegmentTrim = queryOptions.get(Request.QueryOptionKey.SEGMENT_ENABLE_TRIM);
+ if (enableSegmentTrim != null) {
+ return Boolean.parseBoolean(enableSegmentTrim);
+ } else {
+ return null;
+ }
+ }
Review comment:
While that's not the case. `Boolean.parseBoolean()` will never through NPE
--
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] codecov-commenter commented on pull request #7052: Add Query Options for GroupBy In-Segment Trim
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #7052:
URL: https://github.com/apache/incubator-pinot/pull/7052#issuecomment-859828970
# [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7052?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#7052](https://codecov.io/gh/apache/incubator-pinot/pull/7052?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d0096b6) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/f8e7f06ecd962c40e28d7a5353c0f89f8aee1122?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f8e7f06) will **decrease** coverage by `7.88%`.
> The diff coverage is `61.81%`.
> :exclamation: Current head d0096b6 differs from pull request most recent head acca59d. Consider uploading reports for the commit acca59d to get more accurate results
[](https://codecov.io/gh/apache/incubator-pinot/pull/7052?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #7052 +/- ##
============================================
- Coverage 73.32% 65.43% -7.89%
Complexity 12 12
============================================
Files 1454 1454
Lines 72097 72150 +53
Branches 10441 10452 +11
============================================
- Hits 52863 47213 -5650
- Misses 15698 21522 +5824
+ Partials 3536 3415 -121
```
| Flag | Coverage Δ | |
|---|---|---|
| integration | `?` | |
| unittests | `65.43% <61.81%> (-0.01%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/7052?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...i/config/table/ingestion/BatchIngestionConfig.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvY29uZmlnL3RhYmxlL2luZ2VzdGlvbi9CYXRjaEluZ2VzdGlvbkNvbmZpZy5qYXZh) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
| [...ot/spi/config/table/ingestion/IngestionConfig.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvY29uZmlnL3RhYmxlL2luZ2VzdGlvbi9Jbmdlc3Rpb25Db25maWcuamF2YQ==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
| [...va/org/apache/pinot/spi/utils/CommonConstants.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvQ29tbW9uQ29uc3RhbnRzLmphdmE=) | `29.82% <ø> (ø)` | |
| [...he/pinot/common/utils/config/TableConfigUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdXRpbHMvY29uZmlnL1RhYmxlQ29uZmlnVXRpbHMuamF2YQ==) | `86.04% <50.00%> (-7.42%)` | :arrow_down: |
| [...rator/query/AggregationGroupByOrderByOperator.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9vcGVyYXRvci9xdWVyeS9BZ2dyZWdhdGlvbkdyb3VwQnlPcmRlckJ5T3BlcmF0b3IuamF2YQ==) | `90.90% <81.81%> (-2.57%)` | :arrow_down: |
| [.../java/org/apache/pinot/core/util/QueryOptions.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS91dGlsL1F1ZXJ5T3B0aW9ucy5qYXZh) | `86.84% <100.00%> (-4.83%)` | :arrow_down: |
| [...a/org/apache/pinot/minion/metrics/MinionMeter.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25NZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [.../apache/pinot/common/metrics/BrokerQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Ccm9rZXJRdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [.../apache/pinot/minion/metrics/MinionQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25RdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [...pache/pinot/common/utils/grpc/GrpcQueryClient.java](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdXRpbHMvZ3JwYy9HcnBjUXVlcnlDbGllbnQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [344 more](https://codecov.io/gh/apache/incubator-pinot/pull/7052/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7052?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7052?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [beb5804...acca59d](https://codecov.io/gh/apache/incubator-pinot/pull/7052?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] Jackie-Jiang merged pull request #7052: Add Query Options for GroupBy In-Segment Trim
Posted by GitBox <gi...@apache.org>.
Jackie-Jiang merged pull request #7052:
URL: https://github.com/apache/incubator-pinot/pull/7052
--
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org
[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #7052: Add Query Options for GroupBy In-Segment Trim
Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #7052:
URL: https://github.com/apache/incubator-pinot/pull/7052#discussion_r651297625
##########
File path: pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java
##########
@@ -213,6 +213,8 @@
public static final String RESPONSE_FORMAT = "responseFormat";
public static final String GROUP_BY_MODE = "groupByMode";
public static final String SKIP_UPSERT = "skipUpsert";
+ public static final String SEGMENT_ENABLE_TRIM = "segmentEnableTrim";
+ public static final String SEGMENT_MIN_TRIM_SIZE = "segmentMinTrimSize";
Review comment:
```suggestion
public static final String ENABLE_SEGMENT_TRIM = "enableSegmentTrim";
public static final String MIN_SEGMENT_TRIM_SIZE = "minSegmentTrimSize";
```
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptions.java
##########
@@ -33,6 +33,8 @@
private final boolean _responseFormatSQL;
private final boolean _preserveType;
private final boolean _skipUpsert;
+ private final Boolean _enableSegmentTrim;
+ private final Integer _segmentTrimSize;
Review comment:
No need to use object
```suggestion
private final boolean _enableSegmentTrim;
private final int _minSegmentTrimSize;
```
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationGroupByOrderByOperator.java
##########
@@ -145,4 +148,19 @@ public ExecutionStatistics getExecutionStatistics() {
return new ExecutionStatistics(_numDocsScanned, numEntriesScannedInFilter, numEntriesScannedPostFilter,
_numTotalDocs);
}
+
+ private int calculateMinTrimSize () {
Review comment:
(nit) `calculateMinSegmentTrimSize`
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/util/QueryOptions.java
##########
@@ -82,4 +98,24 @@ public static Long getTimeoutMs(Map<String, String> queryOptions) {
return null;
}
}
+
+ @Nullable
+ public static Boolean getEnableSegmentTrim(Map<String, String> queryOptions) {
+ String enableSegmentTrim = queryOptions.get(Request.QueryOptionKey.SEGMENT_ENABLE_TRIM);
+ if (enableSegmentTrim != null) {
+ return Boolean.parseBoolean(enableSegmentTrim);
+ } else {
+ return null;
+ }
+ }
Review comment:
```suggestion
public static boolean getEnableSegmentTrim(Map<String, String> queryOptions) {
return Boolean.parseBoolean(queryOptions.get(Request.QueryOptionKey.SEGMENT_ENABLE_TRIM));
}
```
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationGroupByOrderByOperator.java
##########
@@ -145,4 +148,19 @@ public ExecutionStatistics getExecutionStatistics() {
return new ExecutionStatistics(_numDocsScanned, numEntriesScannedInFilter, numEntriesScannedPostFilter,
_numTotalDocs);
}
+
+ private int calculateMinTrimSize () {
+ // In query option, if a positive min trim size is given, we use it to override the server settings. Otherwise
Review comment:
Move the comment as javadoc for the method
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationGroupByOrderByOperator.java
##########
@@ -145,4 +148,19 @@ public ExecutionStatistics getExecutionStatistics() {
return new ExecutionStatistics(_numDocsScanned, numEntriesScannedInFilter, numEntriesScannedPostFilter,
_numTotalDocs);
}
+
+ private int calculateMinTrimSize () {
+ // In query option, if a positive min trim size is given, we use it to override the server settings. Otherwise
+ // check if a simple boolean option is given and use default trim size.
+ QueryOptions queryOptions = new QueryOptions(_queryContext.getQueryOptions());
+ Boolean queryOptionEnableTrim = queryOptions.isEnableSegmentTrim();
+ Integer queryOptionTrimSize = queryOptions.getMinSegmentTrimSize();
+ if (queryOptionTrimSize != null && queryOptionTrimSize > 0) {
+ return queryOptionTrimSize;
+ } else if (queryOptionEnableTrim != null && queryOptionEnableTrim) {
+ // TODO: if query option is true and a server minTrimSize is given, shall we use default value or server config?
Review comment:
Here if `_minSegmentTrimSize` is configured (> 0), we should use the server config. If not, use the default
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/operator/query/AggregationGroupByOrderByOperator.java
##########
@@ -145,4 +148,19 @@ public ExecutionStatistics getExecutionStatistics() {
return new ExecutionStatistics(_numDocsScanned, numEntriesScannedInFilter, numEntriesScannedPostFilter,
_numTotalDocs);
}
+
+ private int calculateMinTrimSize () {
+ // In query option, if a positive min trim size is given, we use it to override the server settings. Otherwise
+ // check if a simple boolean option is given and use default trim size.
+ QueryOptions queryOptions = new QueryOptions(_queryContext.getQueryOptions());
Review comment:
Use the static method instead of the constructor to avoid the overhead of parsing unrelated fields
--
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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org