Skip to content

Commit

Permalink
[GLUTEN-7420][VL] Fix kGCSCredentialsPath configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
majetideepak committed Oct 7, 2024
1 parent 3ca5f77 commit 940ab8a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cpp/velox/utils/ConfigExtractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,8 @@ std::shared_ptr<facebook::velox::config::ConfigBase> getHiveConfig(
auto gsAuthServiceAccountJsonKeyfile =
conf->get<std::string>("spark.hadoop.fs.gs.auth.service.account.json.keyfile");
if (gsAuthServiceAccountJsonKeyfile.hasValue()) {
auto stream = std::ifstream(gsAuthServiceAccountJsonKeyfile.value());
stream.exceptions(std::ios::badbit);
std::string gsAuthServiceAccountJson = std::string(std::istreambuf_iterator<char>(stream.rdbuf()), {});
hiveConfMap[facebook::velox::connector::hive::HiveConfig::kGCSCredentialsPath] = gsAuthServiceAccountJson;
hiveConfMap[facebook::velox::connector::hive::HiveConfig::kGCSCredentialsPath] =
gsAuthServiceAccountJsonKeyfile.value();
} else {
LOG(WARNING) << "STARTUP: conf spark.hadoop.fs.gs.auth.type is set to SERVICE_ACCOUNT_JSON_KEYFILE, "
"however conf spark.hadoop.fs.gs.auth.service.account.json.keyfile is not set";
Expand Down

0 comments on commit 940ab8a

Please sign in to comment.