mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
28a2cc0a82
* Family of functions to convert DateTime64 to Int64 and back, usefull for imporintg/exporting raw timestamp values of certain precision. * Docs * Tests * Fixed ya.make
21 lines
470 B
C++
21 lines
470 B
C++
#include <Functions/FunctionUnixTimestamp64.h>
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
struct TransformToMilli
|
|
{
|
|
static constexpr auto name = "toUnixTimestamp64Milli";
|
|
static constexpr auto target_scale = 3;
|
|
using SourceDataType = DataTypeDateTime64;
|
|
using ResultDataType = DataTypeInt64;
|
|
};
|
|
|
|
void registerToUnixTimestamp64Milli(FunctionFactory & factory)
|
|
{
|
|
factory.registerFunction<FunctionUnixTimestamp64<TransformToMilli>>();
|
|
}
|
|
|
|
}
|