Skip to content

Commit 941ffb2

Browse files
authored
Add request-data-sizes-max-wait-sec to session properties (#24918)
Summary: As title Differential Revision: D73019179
1 parent 3a6ae85 commit 941ffb2

File tree

5 files changed

+35
-7
lines changed

5 files changed

+35
-7
lines changed

presto-docs/src/main/sphinx/presto_cpp/properties-session.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ This property can only be enabled with native execution.
117117
* **Default value:** ``false``
118118

119119
Temporary flag to control whether selective Nimble reader should be used in this
120-
query or not.
120+
query or not.
121121

122122
``native_join_spill_enabled``
123123
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -197,7 +197,7 @@ Native Execution only. Enable simplified path in expression evaluation.
197197
* **Type:** ``integer``
198198
* **Default value:** ``100000``
199199

200-
Native Execution only. The `reduce <https://prestodb.io/docs/current/functions/array.html#reduce-array-T-initialState-S-inputFunction-S-T-S-outputFunction-S-R-R>`_
200+
Native Execution only. The `reduce <https://prestodb.io/docs/current/functions/array.html#reduce-array-T-initialState-S-inputFunction-S-T-S-outputFunction-S-R-R>`_
201201
function will throw an error if it encounters an array of size greater than this value.
202202

203203
``native_expression_max_compiled_regexes``
@@ -459,6 +459,14 @@ while a lower value limits the amount of memory used.
459459
* **Type:** ``integer``
460460
* **Default value:** ``0``
461461

462-
In streaming aggregation, wait until there are enough output rows
463-
to produce a batch of the size specified by this property. If set to ``0``, then
464-
``Operator::outputBatchRows`` is used as the minimum number of output batch rows.
462+
In streaming aggregation, wait until there are enough output rows
463+
to produce a batch of the size specified by this property. If set to ``0``, then
464+
``Operator::outputBatchRows`` is used as the minimum number of output batch rows.
465+
466+
``native_request_data_sizes_max_wait_sec``
467+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
468+
469+
* **Type:** ``integer``
470+
* **Default value:** ``10``
471+
472+
Maximum wait time for exchange long poll requests in seconds.

presto-main-base/src/main/java/com/facebook/presto/sessionpropertyproviders/NativeWorkerSessionPropertyProvider.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public class NativeWorkerSessionPropertyProvider
7777
public static final String NATIVE_TABLE_SCAN_SCALED_PROCESSING_ENABLED = "native_table_scan_scaled_processing_enabled";
7878
public static final String NATIVE_TABLE_SCAN_SCALE_UP_MEMORY_USAGE_RATIO = "native_table_scan_scale_up_memory_usage_ratio";
7979
public static final String NATIVE_STREAMING_AGGREGATION_MIN_OUTPUT_BATCH_ROWS = "native_streaming_aggregation_min_output_batch_rows";
80+
public static final String NATIVE_REQUEST_DATA_SIZES_MAX_WAIT_SEC = "native_request_data_sizes_max_wait_sec";
8081
private final List<PropertyMetadata<?>> sessionProperties;
8182

8283
@Inject
@@ -344,6 +345,11 @@ public NativeWorkerSessionPropertyProvider(FeaturesConfig featuresConfig)
344345
"to produce a batch of size specified by this. If set to 0, then " +
345346
"Operator::outputBatchRows will be used as the min output batch rows.",
346347
0,
348+
!nativeExecution),
349+
integerProperty(
350+
NATIVE_REQUEST_DATA_SIZES_MAX_WAIT_SEC,
351+
"Maximum wait time for exchange long poll requests in seconds.",
352+
10,
347353
!nativeExecution));
348354
}
349355

presto-native-execution/presto_cpp/main/SessionProperties.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,14 @@ SessionProperties::SessionProperties() {
481481
false,
482482
QueryConfig::kStreamingAggregationMinOutputBatchRows,
483483
std::to_string(c.streamingAggregationMinOutputBatchRows()));
484+
485+
addSessionProperty(
486+
kRequestDataSizesMaxWaitSec,
487+
"Maximum wait time for exchange long poll requests in seconds.",
488+
INTEGER(),
489+
10,
490+
QueryConfig::kRequestDataSizesMaxWaitSec,
491+
std::to_string(c.requestDataSizesMaxWaitSec()));
484492
}
485493

486494
const std::unordered_map<std::string, std::shared_ptr<SessionProperty>>&

presto-native-execution/presto_cpp/main/SessionProperties.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,10 @@ class SessionProperties {
309309
static constexpr const char* kStreamingAggregationMinOutputBatchRows =
310310
"native_streaming_aggregation_min_output_batch_rows";
311311

312+
/// Maximum wait time for exchange long poll requests in seconds.
313+
static constexpr const char* kRequestDataSizesMaxWaitSec =
314+
"native_request_data_sizes_max_wait_sec";
315+
312316
SessionProperties();
313317

314318
const std::unordered_map<std::string, std::shared_ptr<SessionProperty>>&

presto-native-execution/presto_cpp/main/tests/SessionPropertiesTest.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ TEST_F(SessionPropertiesTest, validateMapping) {
3434
SessionProperties::kScaleWriterMinProcessedBytesRebalanceThreshold,
3535
SessionProperties::kTableScanScaledProcessingEnabled,
3636
SessionProperties::kTableScanScaleUpMemoryUsageRatio,
37-
SessionProperties::kStreamingAggregationMinOutputBatchRows};
37+
SessionProperties::kStreamingAggregationMinOutputBatchRows,
38+
SessionProperties::kRequestDataSizesMaxWaitSec};
3839
const std::vector<std::string> veloxConfigNames = {
3940
core::QueryConfig::kAdjustTimestampToTimezone,
4041
core::QueryConfig::kDriverCpuTimeSliceLimitMs,
@@ -46,7 +47,8 @@ TEST_F(SessionPropertiesTest, validateMapping) {
4647
core::QueryConfig::kScaleWriterMinProcessedBytesRebalanceThreshold,
4748
core::QueryConfig::kTableScanScaledProcessingEnabled,
4849
core::QueryConfig::kTableScanScaleUpMemoryUsageRatio,
49-
core::QueryConfig::kStreamingAggregationMinOutputBatchRows};
50+
core::QueryConfig::kStreamingAggregationMinOutputBatchRows,
51+
core::QueryConfig::kRequestDataSizesMaxWaitSec};
5052
auto sessionProperties = SessionProperties().getSessionProperties();
5153
const auto len = names.size();
5254
for (auto i = 0; i < len; i++) {

0 commit comments

Comments
 (0)