Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[native] Add session property native_writer_flush_threshold_bytes #23891

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions presto-docs/src/main/sphinx/presto_cpp/properties-session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,14 @@ Native Execution only. Enable topN row number spilling on native engine.

Native Execution only. Enable window spilling on native engine.

``native_writer_spill_enabled``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``native_writer_flush_threshold_bytes``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* **Type:** ``boolean``
* **Default value:** ``true``
* **Type:** ``bigint``
* **Default value:** ``100663296``

Native Execution only. Enable writer spilling on native engine.
Minimum memory footprint size required to reclaim memory from a file writer by flushing its buffered data to disk.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider adding some info about the session properties to the release notes

Default is 96MB.

``native_max_output_buffer_size``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class NativeWorkerSessionPropertyProvider
public static final String NATIVE_JOIN_SPILL_ENABLED = "native_join_spill_enabled";
public static final String NATIVE_WINDOW_SPILL_ENABLED = "native_window_spill_enabled";
public static final String NATIVE_WRITER_SPILL_ENABLED = "native_writer_spill_enabled";
public static final String NATIVE_WRITER_FLUSH_THRESHOLD_BYTES = "native_writer_flush_threshold_bytes";
public static final String NATIVE_ROW_NUMBER_SPILL_ENABLED = "native_row_number_spill_enabled";
public static final String NATIVE_TOPN_ROW_NUMBER_SPILL_ENABLED = "native_topn_row_number_spill_enabled";
public static final String NATIVE_SPILLER_NUM_PARTITION_BITS = "native_spiller_num_partition_bits";
Expand Down Expand Up @@ -122,6 +123,12 @@ public NativeWorkerSessionPropertyProvider(FeaturesConfig featuresConfig)
"Native Execution only. Enable writer spilling on native engine",
false,
!nativeExecution),
longProperty(
NATIVE_WRITER_FLUSH_THRESHOLD_BYTES,
"Native Execution only. Minimum memory footprint size required to reclaim memory from a file " +
"writer by flushing its buffered data to disk.",
96L << 20,
false),
booleanProperty(
NATIVE_ROW_NUMBER_SPILL_ENABLED,
"Native Execution only. Enable row number spilling on native engine",
Expand Down
10 changes: 10 additions & 0 deletions presto-native-execution/presto_cpp/main/SessionProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ SessionProperties::SessionProperties() {
QueryConfig::kWriterSpillEnabled,
boolToString(c.writerSpillEnabled()));

addSessionProperty(
kWriterFlushThresholdBytes,
"Native Execution only. Minimum memory footprint size required "
"to reclaim memory from a file writer by flushing its buffered data to "
"disk.",
BIGINT(),
false,
QueryConfig::kWriterFlushThresholdBytes,
std::to_string(c.writerFlushThresholdBytes()));

addSessionProperty(
kRowNumberSpillEnabled,
"Native Execution only. Enable row number spilling on native engine",
Expand Down
5 changes: 5 additions & 0 deletions presto-native-execution/presto_cpp/main/SessionProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ class SessionProperties {
static constexpr const char* kWriterSpillEnabled =
"native_writer_spill_enabled";

/// Minimum memory footprint size required to reclaim memory from a file
/// writer by flushing its buffered data to disk.
static constexpr const char* kWriterFlushThresholdBytes =
"native_writer_flush_threshold_bytes";

/// The number of bits (N) used to calculate the spilling partition number for
/// hash join and RowNumber: 2 ^ N
static constexpr const char* kSpillerNumPartitionBits =
Expand Down
Loading