Drop toFractionalSecond

This commit is contained in:
ltrk2 2022-12-09 07:52:27 -08:00
parent d28631354f
commit 4cbda15acf
4 changed files with 2 additions and 20 deletions

View File

@ -233,11 +233,6 @@ Leap seconds are not accounted for.
Alias: `SECOND`.
## toFractionalSecond
Converts a date with time to an Int64 number containing the fractional part of the second.
Leap seconds are not accounted for.
## toUnixTimestamp
For DateTime argument: converts value to the number with type UInt32 -- Unix Timestamp (https://en.wikipedia.org/wiki/Unix_time).

View File

@ -1,13 +0,0 @@
#include <Functions/FunctionFactory.h>
#include <Functions/DateTimeTransforms.h>
#include <Functions/FunctionDateOrDateTimeToSomething.h>
namespace DB
{
using FunctionToFractionalSecond = FunctionDateOrDateTimeToSomething<DataTypeInt64, ToFractionalSecondImpl>;
REGISTER_FUNCTION(ToFractionalSecond)
{
factory.registerFunction<FunctionToFractionalSecond>();
}
}

View File

@ -1,5 +1,5 @@
UTC 1
Europe/Minsk 1
2019-09-16 19:20:11.000
2019-05-03 11:25:25.123 2019-05-03 2019-05-03 00:00:00 2019-04-01 1970-01-02 11:25:25 2019-05-03 11:25:00 123
2019-05-03 11:25:25.123 2019-05-03 2019-05-03 00:00:00 2019-04-01 1970-01-02 11:25:25 2019-05-03 11:25:00
2019-09-16 19:20:11.234

View File

@ -24,7 +24,7 @@ SELECT toDateTime64('2019-09-16 19:20:11', 3, 'UTC'); -- this now works OK and p
CREATE TABLE A(t DateTime64(3, 'UTC')) ENGINE = MergeTree() ORDER BY t;
INSERT INTO A(t) VALUES ('2019-05-03 11:25:25.123456789');
SELECT toString(t, 'UTC'), toDate(t), toStartOfDay(t), toStartOfQuarter(t), toTime(t), toStartOfMinute(t), toFractionalSecond(t) FROM A ORDER BY t;
SELECT toString(t, 'UTC'), toDate(t), toStartOfDay(t), toStartOfQuarter(t), toTime(t), toStartOfMinute(t) FROM A ORDER BY t;
SELECT toDateTime64('2019-09-16 19:20:11.234', 3, 'Europe/Minsk');