2020-05-08 14:59:58 +00:00
|
|
|
#include <Functions/FunctionUnixTimestamp64.h>
|
|
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-09-07 18:00:37 +00:00
|
|
|
namespace
|
|
|
|
{
|
2020-05-08 14:59:58 +00:00
|
|
|
|
|
|
|
struct TransformToMilli
|
|
|
|
{
|
|
|
|
static constexpr auto name = "toUnixTimestamp64Milli";
|
|
|
|
static constexpr auto target_scale = 3;
|
|
|
|
using SourceDataType = DataTypeDateTime64;
|
|
|
|
using ResultDataType = DataTypeInt64;
|
|
|
|
};
|
|
|
|
|
2020-09-07 18:00:37 +00:00
|
|
|
}
|
|
|
|
|
2020-05-08 14:59:58 +00:00
|
|
|
void registerToUnixTimestamp64Milli(FunctionFactory & factory)
|
|
|
|
{
|
|
|
|
factory.registerFunction<FunctionUnixTimestamp64<TransformToMilli>>();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|