未验证 提交 db494450 编写于 作者: A alexey-milovidov 提交者: GitHub

Merge pull request #2100 from tobad357/bugfix/fix-subscribe-multiple-topics

#2095 Make sure to split the topics args list on ','
......@@ -4,6 +4,8 @@
#include <thread>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <Common/Exception.h>
#include <Common/setThreadName.h>
#include <Common/typeid_cast.h>
......@@ -574,9 +576,14 @@ void registerStorageKafka(StorageFactory & factory)
throw Exception("Number of consumers must be a positive integer", ErrorCodes::BAD_ARGUMENTS);
}
// Parse topic list and consumer group
// Parse topic list
Names topics;
topics.push_back(static_cast<const ASTLiteral &>(*engine_args[1]).value.safeGet<String>());
String topic_arg = static_cast<const ASTLiteral &>(*engine_args[1]).value.safeGet<String>();
boost::split(topics, topic_arg , [](char c){ return c == ','; });
for(String & topic : topics)
boost::trim(topic);
// Parse consumer group
String group = static_cast<const ASTLiteral &>(*engine_args[2]).value.safeGet<String>();
// Parse format from string
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册