Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ void updateFromSystemConfigs(
std::string(SystemConfig::kAggregationSpillEnabled),
.veloxConfig = velox::core::QueryConfig::kAggregationSpillEnabled},

{.prestoSystemConfig = std::string(SystemConfig::kMaxSpillBytes),
.veloxConfig = velox::core::QueryConfig::kMaxSpillBytes},

{.prestoSystemConfig =
std::string(SystemConfig::kRequestDataSizesMaxWaitSec),
.veloxConfig = velox::core::QueryConfig::kRequestDataSizesMaxWaitSec},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
*/
#include <gtest/gtest.h>

#include <string>

#include "presto_cpp/main/PrestoToVeloxQueryConfig.h"
#include "presto_cpp/main/SessionProperties.h"
#include "presto_cpp/main/common/Configs.h"
Expand Down Expand Up @@ -141,6 +143,18 @@ TEST_F(PrestoToVeloxQueryConfigTest, sessionPropertiesOverrideSystemConfigs) {
expectedValue == "true", config.aggregationSpillEnabled());
}},

{.veloxConfigKey = core::QueryConfig::kMaxSpillBytes,
.sessionPropertyKey =
std::make_optional<std::string>(SessionProperties::kMaxSpillBytes),
.systemConfigKey = std::string(SystemConfig::kMaxSpillBytes),
.sessionValue = "214748364800",
.differentSessionValue = "107374182400",
.validator =
[](const core::QueryConfig& config,
const std::string& expectedValue) noexcept {
EXPECT_EQ(std::stoull(expectedValue), config.maxSpillBytes());
}},

{.veloxConfigKey = core::QueryConfig::kRequestDataSizesMaxWaitSec,
.sessionPropertyKey = std::make_optional<std::string>(
SessionProperties::kRequestDataSizesMaxWaitSec),
Expand Down Expand Up @@ -280,7 +294,7 @@ TEST_F(PrestoToVeloxQueryConfigTest, sessionPropertiesOverrideSystemConfigs) {
// CRITICAL: This count MUST match the exact number of entries in
// veloxToPrestoConfigMapping If this assertion fails, it means a new
// mapping was added and this test needs to be updated
const size_t kExpectedMappingCount = 14;
const size_t kExpectedMappingCount = 15;
EXPECT_EQ(kExpectedMappingCount, testCases.size());

// Test each mapping to ensure session properties override system configs
Expand Down Expand Up @@ -659,6 +673,8 @@ TEST_F(PrestoToVeloxQueryConfigTest, systemConfigsWithoutSessionOverride) {
.systemConfigKey = std::string(SystemConfig::kOrderBySpillEnabled)},
{.veloxConfigKey = core::QueryConfig::kAggregationSpillEnabled,
.systemConfigKey = std::string(SystemConfig::kAggregationSpillEnabled)},
{.veloxConfigKey = core::QueryConfig::kMaxSpillBytes,
.systemConfigKey = std::string(SystemConfig::kMaxSpillBytes)},
{.veloxConfigKey = core::QueryConfig::kRequestDataSizesMaxWaitSec,
.systemConfigKey =
std::string(SystemConfig::kRequestDataSizesMaxWaitSec)},
Expand Down Expand Up @@ -700,7 +716,7 @@ TEST_F(PrestoToVeloxQueryConfigTest, systemConfigsWithoutSessionOverride) {
std::string(SystemConfig::kExchangeLazyFetchingEnabled)},
};

const size_t kExpectedSystemConfigMappingCount = 20;
const size_t kExpectedSystemConfigMappingCount = 21;
EXPECT_EQ(kExpectedSystemConfigMappingCount, expectedMappings.size())
<< "Update expectedMappings to match veloxToPrestoConfigMapping";

Expand Down
Loading