提交 f591936a 编写于 作者: M Michael Kolupaev

clickhouse: fixed extract function [#CONV-6788].

上级 ea816297
......@@ -313,7 +313,7 @@ struct MatchImpl
/** Применяет регексп и достаёт:
* - первый subpattern, если в regexp-е *есть subpattern;
* - первый subpattern, если в regexp-е есть subpattern;
* - нулевой subpattern (сматчившуюся часть, иначе);
* - если не сматчилось - пустую строку.
*/
......@@ -328,7 +328,7 @@ struct ExtractImpl
const OptimizedRegularExpression & regexp = Regexps::get(pattern);
int capture = regexp.getRE2()->NumberOfCapturingGroups() > 0 ? 1 : 0;
int capture = regexp.getNumberOfSubpatterns() > 0 ? 1 : 0;
OptimizedRegularExpression::MatchVec matches;
matches.reserve(capture + 1);
size_t prev_offset = 0;
......@@ -487,7 +487,7 @@ public:
}
else if (const ColumnConstString * col = dynamic_cast<const ColumnConstString *>(&*column))
{
std::string res = 0;
std::string res;
Impl::constant(col->getData(), col_needle->getData(), res);
ColumnConstString * col_res = new ColumnConstString(col->size(), res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册