| 297 | QueryProcessingStage::Enum query_processing_stage; |
| 298 | |
| 299 | void initialize(Poco::Util::Application & self) override |
| 300 | { |
| 301 | Poco::Util::Application::initialize(self); |
| 302 | |
| 303 | const char * home_path_cstr = getenv("HOME"); |
| 304 | if (home_path_cstr) |
| 305 | home_path = home_path_cstr; |
| 306 | |
| 307 | configReadClient(config(), home_path); |
| 308 | |
| 309 | context->setApplicationType(Context::ApplicationType::CLIENT); |
| 310 | context->setQueryParameters(query_parameters); |
| 311 | |
| 312 | /// settings and limits could be specified in config file, but passed settings has higher priority |
| 313 | SettingsChanges config_settings; |
| 314 | for (const auto & setting : context->getSettingsRef().allUnchanged()) |
| 315 | { |
| 316 | const auto & name = setting.getName(); |
| 317 | if (config().has(name)) |
| 318 | config_settings.emplace_back(name, Settings::stringToValueUtil(name, config().getString(name))); |
| 319 | } |
| 320 | context->applySettingsChanges(config_settings); |
| 321 | |
| 322 | /// Set path for format schema files |
| 323 | if (config().has("format_schema_path")) |
| 324 | context->setFormatSchemaPath(fs::weakly_canonical(config().getString("format_schema_path"))); |
| 325 | |
| 326 | /// Initialize query_id_formats if any |
| 327 | if (config().has("query_id_formats")) |
| 328 | { |
| 329 | Poco::Util::AbstractConfiguration::Keys keys; |
| 330 | config().keys("query_id_formats", keys); |
| 331 | for (const auto & name : keys) |
| 332 | query_id_formats.emplace_back(name + ":", config().getString("query_id_formats." + name)); |
| 333 | } |
| 334 | if (query_id_formats.empty()) |
| 335 | query_id_formats.emplace_back("Query id:", " {query_id}\n"); |
| 336 | #if USE_HDFS |
| 337 | /// Init HDFS3 client config path |
| 338 | std::string hdfs_config = context->getCnchConfigRef().getString("hdfs3_config", ""); |
| 339 | if (!hdfs_config.empty()) |
| 340 | { |
| 341 | setenv("LIBHDFS3_CONF", hdfs_config.c_str(), 1); |
| 342 | } |
| 343 | |
| 344 | HDFSConnectionParams hdfs_params = HDFSConnectionParams::parseHdfsFromConfig(context->getCnchConfigRef()); |
| 345 | context->setHdfsConnectionParams(hdfs_params); |
| 346 | #endif |
| 347 | auto vetos_params = VETosConnectionParams::parseVeTosFromConfig(config()); |
| 348 | context->setVETosConnectParams(vetos_params); |
| 349 | auto oss_params = OSSConnectionParams::parseOSSFromConfig(config()); |
| 350 | context->setOSSConnectParams(oss_params); |
| 351 | } |
| 352 | |
| 353 | |
| 354 | int main(const std::vector<std::string> & /*args*/) override |
nothing calls this directly
no test coverage detected