diff --git a/src/Dictionaries/ClickHouseDictionarySource.cpp b/src/Dictionaries/ClickHouseDictionarySource.cpp index 180750d143a..edffe273ed0 100644 --- a/src/Dictionaries/ClickHouseDictionarySource.cpp +++ b/src/Dictionaries/ClickHouseDictionarySource.cpp @@ -74,7 +74,10 @@ ClickHouseDictionarySource::ClickHouseDictionarySource( , load_all_query{query_builder.composeLoadAllQuery()} { /// We should set user info even for the case when the dictionary is loaded in-process (without TCP communication). - context.setUser(user, password, Poco::Net::SocketAddress("127.0.0.1", 0)); + if (is_local) + { + context.setUser(user, password, Poco::Net::SocketAddress("127.0.0.1", 0)); + } context = copyContextAndApplySettings(path_to_settings, context, config); /// Query context is needed because some code in executeQuery function may assume it exists.