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 @@ -103,7 +103,6 @@ class CHTransformerApi extends TransformerApi with Logging {
override def postProcessNativeConfig(
nativeConfMap: util.Map[String, String],
backendPrefix: String): Unit = {
// IMPLEMENT POST PROCESS FOR CLICKHOUSE BACKEND
val settingPrefix = backendPrefix + ".runtime_settings."
if (nativeConfMap.getOrDefault("spark.memory.offHeap.enabled", "false").toBoolean) {
val offHeapSize =
Expand All @@ -120,5 +119,19 @@ class CHTransformerApi extends TransformerApi with Logging {
maxBytesBeforeExternalGroupBy.toLong.toString)
}
}

val injectConfig: (String, String) => Unit = (srcKey, dstKey) => {
if (nativeConfMap.containsKey(srcKey)) {
nativeConfMap.put(dstKey, nativeConfMap.get(srcKey))
}
}

val hdfsConfigPrefix = backendPrefix + ".runtime_config.hdfs."
injectConfig("spark.hadoop.input.connect.timeout", hdfsConfigPrefix + "input_connect_timeout")
injectConfig("spark.hadoop.input.read.timeout", hdfsConfigPrefix + "input_read_timeout")
injectConfig("spark.hadoop.input.write.timeout", hdfsConfigPrefix + "input_write_timeout")
injectConfig(
"spark.hadoop.dfs.client.log.severity",
hdfsConfigPrefix + "dfs_client_log_severity")
}
}
4 changes: 4 additions & 0 deletions cpp-ch/local-engine/Common/CHUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ void BackendInitializerUtil::initConfig(std::string * plan)
{
const auto & key = kv.first;
const auto & value = kv.second;
// std::cout << "set config key:" << key << ", value:" << value << std::endl;

if (key.starts_with(CH_RUNTIME_CONFIG_PREFIX) && key != CH_RUNTIME_CONFIG_FILE)
config->setString(key.substr(CH_RUNTIME_CONFIG_PREFIX.size()), value);
Expand Down Expand Up @@ -514,6 +515,9 @@ void BackendInitializerUtil::initEnvs()
std::string libhdfs3_conf = config->getString(LIBHDFS3_CONF_KEY, "");
setenv("LIBHDFS3_CONF", libhdfs3_conf.c_str(), true); /// NOLINT
}

/// Enable logging in libhdfs3, logs will be written to stderr
setenv("HDFS_ENABLE_LOGGING", "true", true); /// NOLINT
}

void BackendInitializerUtil::initSettings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,11 @@ object GlutenConfig {
COLUMNAR_VELOX_CONNECTOR_IO_THREADS.defaultValueString),
(
COLUMNAR_VELOX_SPLIT_PRELOAD_PER_DRIVER.key,
COLUMNAR_VELOX_SPLIT_PRELOAD_PER_DRIVER.defaultValueString)
COLUMNAR_VELOX_SPLIT_PRELOAD_PER_DRIVER.defaultValueString),
("spark.hadoop.input.connect.timeout", "180000"),
("spark.hadoop.input.read.timeout", "180000"),
("spark.hadoop.input.write.timeout", "180000"),
("spark.hadoop.dfs.client.log.severity", "INFO")
)
keyWithDefault.forEach(e => nativeConfMap.put(e._1, conf.getOrElse(e._1, e._2)))
// velox cache and HiveConnector config
Expand Down