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

Add session properties for scaled table scan configs to workers #24275

Closed
Closed
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
17 changes: 17 additions & 0 deletions presto-native-execution/presto_cpp/main/SessionProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,23 @@ SessionProperties::SessionProperties() {
false,
QueryConfig::kScaleWriterMinProcessedBytesRebalanceThreshold,
std::to_string(c.scaleWriterMinProcessedBytesRebalanceThreshold()));

addSessionProperty(
kTableScanScaledProcessingEnabled,
"If set to true, enables scaled processing for table scans.",
BOOLEAN(),
false,
QueryConfig::kTableScanScaledProcessingEnabled,
std::to_string(c.tableScanScaledProcessingEnabled()));

addSessionProperty(
kTableScanScaleUpMemoryUsageRatio,
"Controls the ratio of available memory that can be used for scaling up table scans. "
"The value is in the range of (0, 1].",
DOUBLE(),
false,
QueryConfig::kTableScanScaleUpMemoryUsageRatio,
std::to_string(c.tableScanScaleUpMemoryUsageRatio()));
}

const std::unordered_map<std::string, std::shared_ptr<SessionProperty>>&
Expand Down
9 changes: 9 additions & 0 deletions presto-native-execution/presto_cpp/main/SessionProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ class SessionProperties {
static constexpr const char* kShuffleCompressionEnabled =
"exchange_compression";

/// If set to true, enables scaled processing for table scans.
static constexpr const char* kTableScanScaledProcessingEnabled =
"native_table_scan_scaled_processing_enabled";

/// Controls the ratio of available memory that can be used for scaling up
/// table scans. The value is in the range of (0, 1].
static constexpr const char* kTableScanScaleUpMemoryUsageRatio =
"native_table_scan_scale_up_memory_usage_ratio";

SessionProperties();

const std::unordered_map<std::string, std::shared_ptr<SessionProperty>>&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ TEST_F(SessionPropertiesTest, validateMapping) {
SessionProperties::kScaleWriterMaxPartitionsPerWriter,
SessionProperties::
kScaleWriterMinPartitionProcessedBytesRebalanceThreshold,
SessionProperties::kScaleWriterMinProcessedBytesRebalanceThreshold};
SessionProperties::kScaleWriterMinProcessedBytesRebalanceThreshold,
SessionProperties::kTableScanScaledProcessingEnabled,
SessionProperties::kTableScanScaleUpMemoryUsageRatio};
const std::vector<std::string> veloxConfigNames = {
core::QueryConfig::kAdjustTimestampToTimezone,
core::QueryConfig::kDriverCpuTimeSliceLimitMs,
Expand All @@ -40,7 +42,9 @@ TEST_F(SessionPropertiesTest, validateMapping) {
core::QueryConfig::kScaleWriterMaxPartitionsPerWriter,
core::QueryConfig::
kScaleWriterMinPartitionProcessedBytesRebalanceThreshold,
core::QueryConfig::kScaleWriterMinProcessedBytesRebalanceThreshold};
core::QueryConfig::kScaleWriterMinProcessedBytesRebalanceThreshold,
core::QueryConfig::kTableScanScaledProcessingEnabled,
core::QueryConfig::kTableScanScaleUpMemoryUsageRatio};
auto sessionProperties = SessionProperties().getSessionProperties();
const auto len = names.size();
for (auto i = 0; i < len; i++) {
Expand Down
Loading