20200317

@ShiKaiWi

Plan

60min: issues of ClickHouse

Notes

First Issue

今天打算从 ClickHouse 的 issue 开始做起,发现一个这个简单的 issue 可以解决:https://github.com/ClickHouse/ClickHouse/issues/9584。 目前发现主要的改动来自于:FunctionsConversion.h,目前发现现有的行为是正确的,已经询问了 member,看看对方的意见,如果有了对方的回复,明天可以按照断点进行调试:

breakpoint set --file src/Functions/FunctionsConversion.h --line 1134

Template

今天算是见识到了 template 的使用方法了:

using FunctionToDateTimeOrNull = FunctionConvertFromString<DataTypeDateTime, NameToDateTimeOrNull, ConvertFromStringExceptionMode::Null>;

template <typename ToDataType, typename Name,
    ConvertFromStringExceptionMode exception_mode,
    ConvertFromStringParsingMode parsing_mode = ConvertFromStringParsingMode::Normal>
class FunctionConvertFromString : public IFunction {}

然后实际上 FunctionCovertFromString 的实现会比较丑,因为涉及到类型 ToDataType 不确定的原因,这个似乎是没有办法的事情。

std::string::npos

std::string s("abc");
if s.find("d") != std::string::npos {
    std::cout << "d is not a substring of s" << std::endl;
}

More