diff --git a/cpp/velox/utils/ConfigExtractor.cc b/cpp/velox/utils/ConfigExtractor.cc index 7c0e180a542e..d5c9ac6552f7 100644 --- a/cpp/velox/utils/ConfigExtractor.cc +++ b/cpp/velox/utils/ConfigExtractor.cc @@ -166,10 +166,8 @@ std::shared_ptr getHiveConfig( auto gsAuthServiceAccountJsonKeyfile = conf->get("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(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";