Skip to content

Commit

Permalink
cache.no_retention should also be false when hive.node_selection_stra…
Browse files Browse the repository at this point in the history
…tegy=HARD_AFFINITY
  • Loading branch information
minhancao authored and yingsu00 committed Dec 3, 2024
1 parent 0213802 commit 1327a3e
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,23 @@ void updateVeloxConnectorConfigs(
// is
// not set retain cache
// SOFT_AFFINITY retain cache
// HARD_AFFINITY retain cache
// NO_PREFERENCE do not retain cache
// If queryDataCacheEnabledDefault is false, when `node_selection_strategy`
// is
// not set do not retain cache
// SOFT_AFFINITY retain cache
// HARD_AFFINITY retain cache
// NO_PREFERENCE do not retain cache
connectorConfig.emplace(
connector::hive::HiveConfig::kCacheNoRetentionSession,
systemConfig->queryDataCacheEnabledDefault() ? "false" : "true");
auto it = connectorConfig.find("node_selection_strategy");
if (it != connectorConfig.end()) {
connectorConfig[connector::hive::HiveConfig::kCacheNoRetentionSession] =
it->second == "SOFT_AFFINITY" ? "false" : "true";
(it->second != "SOFT_AFFINITY" && it->second != "HARD_AFFINITY")
? "true"
: "false";
}
}
}
Expand Down

0 comments on commit 1327a3e

Please sign in to comment.