Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnavBalyan committed Aug 13, 2024
1 parent 2bad963 commit e938ff7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 12 additions & 9 deletions cpp/core/config/GlutenConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,21 @@
#include "config.pb.h"
#include "jni/JniError.h"

namespace {

const std::string REGEX_REDACT_KEY = "spark.gluten.redaction.regex";
std::optional<std::regex> getRedactionRegex(const std::unordered_map<std::string, std::string>& conf) {
auto it = conf.find(REGEX_REDACT_KEY);
if (it != conf.end()) {
return std::regex(it->second);
}
return std::nullopt;
}
} // namespace anonymous

namespace gluten {

const std::string REDACTED_VALUE = "*********(redacted)";
const std::string REGEX_REDACT_KEY = "spark.gluten.redaction.regex";

std::unordered_map<std::string, std::string>
parseConfMap(JNIEnv* env, const uint8_t* planData, const int32_t planDataLength) {
Expand All @@ -39,14 +50,6 @@ parseConfMap(JNIEnv* env, const uint8_t* planData, const int32_t planDataLength)
return sparkConfs;
}

std::optional<std::regex> getRedactionRegex(const std::unordered_map<std::string, std::string>& conf) {
auto it = conf.find(REGEX_REDACT_KEY);
if (it != conf.end()) {
return std::regex(it->second);
}
return std::nullopt;
}

std::string printConfig(const std::unordered_map<std::string, std::string>& conf) {
std::ostringstream oss;
oss << std::endl;
Expand Down
2 changes: 0 additions & 2 deletions cpp/core/config/GlutenConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ const std::string kShuffleCompressionCodecBackend = "spark.gluten.sql.columnar.s
const std::string kQatBackendName = "qat";
const std::string kIaaBackendName = "iaa";

const std::string kRedactionRegex = "spark.gluten.redaction.regex";

std::unordered_map<std::string, std::string>
parseConfMap(JNIEnv* env, const uint8_t* planData, const int32_t planDataLength);

Expand Down

0 comments on commit e938ff7

Please sign in to comment.