Commit Graph

128 Commits

Author SHA1 Message Date
taiyang-li
4bc2c61406 change as request 2023-01-09 20:37:16 +08:00
taiyang-li
20c7c0b1ef change as request 2023-01-09 18:21:31 +08:00
Robert Schulze
3f03b0b53d
Revert "Revert "Add function 'age'""
This reverts commit 4549b14027.
2022-12-20 10:18:43 +00:00
Alexey Milovidov
4549b14027
Revert "Add function 'age'" 2022-12-13 23:28:09 +03:00
Roman Vasin
298a7055fa Replace time_t with DateLUTImpl::Time 2022-12-02 16:40:36 +00:00
Roman Vasin
96d7cf319b
Merge branch 'master' into ADQM-623 2022-11-30 19:25:53 +03:00
Igor Nikonov
f40f3949bd Use DateLUTImpl::Time instead of Int64 2022-11-28 13:42:22 +01:00
zzsmdfj
21f2cffa4d fix date_diff wrong result build by darwin 2022-11-22 18:58:37 +08:00
Roman Vasin
8f3a7b5024 Change algorithm into more accurate 2022-11-10 10:27:18 +00:00
Azat Khuzhin
4eeb7337ed Merge remote-tracking branch 'upstream/master' into build/shorten-64-to-32
Conflicts:
- src/Common/intExp.h
- src/Functions/DateTimeTransforms.h
- src/Functions/FunctionsConversion.h
2022-10-21 22:51:56 +02:00
Alexey Milovidov
592fbb3eaf
Merge pull request #42367 from ClickHouse/revert-40217
Revert #40217
2022-10-21 21:56:15 +02:00
Azat Khuzhin
4e76629aaf Fixes for -Wshorten-64-to-32
- lots of static_cast
- add safe_cast
- types adjustments
  - config
  - IStorage::read/watch
  - ...
- some TODO's (to convert types in future)

P.S. That was quite a journey...

v2: fixes after rebase
v3: fix conflicts after #42308 merged
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-10-21 13:25:19 +02:00
Roman Vasin
885f71d5f5 Replace is_extended_result by ResultPrecision 2022-10-20 08:18:22 +00:00
Roman Vasin
c0f18f29bb Remove toExtendedReplated; Add template argument is_extended_result 2022-10-19 13:23:21 +00:00
Alexey Milovidov
d1f0c80ffe Revert "Merge pull request #40217 from zvonand/zvonand-minmax"
This reverts commit df934d8762, reversing
changes made to d3a7945b1b.
2022-10-17 04:57:15 +02:00
Robert Schulze
d726ca3212
Refactoring: Un-inline some error handling methods 2022-10-02 19:52:40 +00:00
Roman Vasin
f716fc2fe5 Put list of functions in correct order in docs; Use new formatting in exception messages. 2022-09-30 07:54:35 +00:00
Roman Vasin
c6fda60f32 Cleanup code 2022-09-29 15:45:49 +00:00
Roman Vasin
02e08fa301 Use another approach for timeSlot() 2022-09-29 15:44:56 +00:00
Roman Vasin
22ccce6946 Remove WithContext; Rename execute_extended_result to executeExtendedResult 2022-09-29 09:29:07 +00:00
Roman Vasin
36274baba9 Code cleanup 2022-09-26 15:36:32 +03:00
Roman Vasin
2a92c2aae9 Fix timeSlot() for DateTime64 argument 2022-09-26 15:26:07 +03:00
Roman Vasin
348f28a3e7 Fix toStartOfFiveMinutes, toStartOfTenMinutes, toStartOfFifteenMinutes 2022-09-22 13:30:40 +00:00
Roman Vasin
cdd20241bf Finish toStartOfDay; fix toStartOfMinute 2022-09-22 13:16:46 +00:00
Roman Vasin
4ddd6f3c60 Fix timeSlot(); partial fix StartOfDay 2022-09-22 09:19:22 +00:00
Roman Vasin
49b0da0273 Add date32IsNotSupported() 2022-09-22 07:15:03 +00:00
Roman Vasin
f6ebd94ce1 Add execute_extended_result for Date32 argument 2022-09-22 07:07:04 +00:00
Roman Vasin
30c4719f7b Add FunctionDateOrDateTimeToDateTimeOrDateTime64; function toStartOfHour works 2022-09-21 12:58:57 +00:00
Roman Vasin
d82cd7b007 Add many cosmetic changes to C++ code and MD docs 2022-09-16 09:37:30 +00:00
Roman Vasin
7e733887b9 Add narrowing for toStartOfISOYear; improve 02403_enable_extended_results_for_datetime_functions 2022-09-16 08:40:15 +00:00
Roman Vasin
563449779c Replace enable_date32_results by enable_extended_results_for_datetime_functions 2022-09-15 12:48:09 +00:00
Roman Vasin
b03a0a724f Enable Date32 results for toStartOfYear, toStartOfISOYear, toStartOfQuarter, toStartOfMonth, toMonday, toLastDayOfMonth 2022-09-09 13:25:52 +00:00
Roman Vasin
e1833d3cd6 Merge branch 'master' into ADQM-528-B 2022-09-02 10:40:44 +00:00
zvonand
24dfa0c64a tryfix darwin 2022-08-25 12:28:15 +03:00
zvonand
e257f9d0cd update docs, tests + small fixes 2022-08-24 01:09:14 +03:00
Roman Vasin
423a4f22cc Fix toStartOfYear, toStartOfISOYear, toStartOfQuarter and toStartOfMonth to return Date32 2022-08-23 16:55:53 +00:00
Roman Vasin
505a8ad0e0 Fix toMonday() function to return Date32 2022-08-23 15:39:21 +00:00
zvonand
d789dabc9d Fixed , updated docs 2022-08-22 17:36:56 +03:00
zvonand
e5b4fb4191 fix some issues 2022-08-22 17:36:56 +03:00
zvonand
a7a1269e60 updated tests + improve logic 2022-08-22 17:36:55 +03:00
zvonand
537fb8c4ee fix 1 2022-08-22 17:36:55 +03:00
Roman Vasin
be3151937c Set return type to Date32 for toLastDayOfMonth function 2022-08-17 08:51:14 +00:00
Memo
956d525840 fix conflict 2022-04-22 11:22:50 +08:00
Memo
39aadf0975 replaced toStartOfFiveMinute to toStartOfFiveMinutes 2022-04-22 10:49:59 +08:00
Alexey Milovidov
cbeeb7ec4f Remove Arcadia 2022-04-16 00:20:47 +02:00
Alexey Milovidov
d9e5ca2119
Merge pull request #34394 from holadepo/last_day
Add toLastDayOfMonth function
2022-04-04 07:02:08 +03:00
zvonand
f60a944483 fixed toStartOfInterval 2022-02-16 02:43:08 +03:00
zvonand
2454f1dd13 Decimal components attempt 2022-02-14 00:04:09 +03:00
zvonand
dcc0f53f8e updated Interval definitions 2022-02-13 17:54:03 +03:00
Habibullah Oladepo
57ff05b6e6 Add new function toLastDayOfMonth 2022-02-08 23:48:44 +01:00
Amos Bird
0b7a94c2be Saturate date/datetime to zero 2022-01-03 02:07:08 +03:00
Alexey Milovidov
29d28c531f Move code around to avoid dlsym on Musl 2021-12-24 12:25:27 +03:00
Alexey Milovidov
fe6b7c77c7 Rename "common" to "base" 2021-10-02 10:13:14 +03:00
kssenii
9cb10aae3c Some fixes 2021-07-18 03:43:08 +00:00
kssenii
3ba2d114d5 Revert "Merge pull request #26352 from ClickHouse/revert-25774-datatype-date32"
This reverts commit 94a210650f, reversing
changes made to 0893b9ff8e.
2021-07-15 11:41:52 +00:00
alexey-milovidov
9ba4064c86
Revert "Datatype Date32, support range 1925 to 2283" 2021-07-15 10:53:35 +03:00
NengLiu
8b88988618 Merge branch 'master' into datatype-date32
# Conflicts:
#	src/DataStreams/PostgreSQLBlockInputStream.cpp
2021-07-05 10:18:38 +08:00
Maksim Kita
764380f701 Updated tests 2021-06-28 19:56:15 +03:00
Maksim Kita
61b116332d Fixed tests 2021-06-27 20:53:02 +03:00
Maksim Kita
e6adc405d8 DateTime timezone fix 2021-06-27 20:53:02 +03:00
neng.liu
45e9e9f8bb fix some compile problem 2021-06-17 08:08:29 -07:00
Neng Liu
b6eab5fd2f add datetype32 function support 2021-06-17 16:05:30 +08:00
Maksim Kita
d923d9e6ef Function move file 2021-05-17 10:30:42 +03:00
Maksim Kita
947f28d430 IFunction refactoring 2021-05-15 20:33:15 +03:00
Alexey Milovidov
fee0314057 Fix error 2021-05-07 02:17:39 +03:00
Vasily Nemkov
2d03d330bc Extended range of DateTime64 to years 1925 - 2238
The Year 1925 is a starting point because most of the timezones
switched to saner (mostly 15-minutes based) offsets somewhere
during 1924 or before. And that significantly simplifies implementation.

2238 is to simplify arithmetics for sanitizing LUT index access;
there are less than 0x1ffff days from 1925.

* Extended DateLUTImpl internal LUT to 0x1ffff items, some of which
  represent negative (pre-1970) time values.
  As a collateral benefit, Date now correctly supports dates up to 2149
  (instead of 2106).
* Added a new strong typedef ExtendedDayNum, which represents dates
  pre-1970 and post 2149.
* Functions that used to return DayNum now return ExtendedDayNum.
* Refactored DateLUTImpl to untie DayNum from the dual role of being
  a value and an index (due to negative time). Index is now a different
  type LUTIndex with explicit conversion functions from DatNum, time_t,
  and ExtendedDayNum.
* Updated DateLUTImpl to properly support values close to epoch start
  (1970-01-01 00:00), including negative ones.
* Reduced resolution of DateLUTImpl::Values::time_at_offset_change
  to multiple of 15-minutes to allow storing 64-bits of time_t in
  DateLUTImpl::Value while keeping same size.
* Minor performance updates to DateLUTImpl when building month LUT
  by skipping non-start-of-month days.
* Fixed extractTimeZoneFromFunctionArguments to work correctly
  with DateTime64.
* New unit-tests and stateless integration tests for both DateTime
  and DateTime64.
2021-02-24 17:08:35 +02:00
Azat Khuzhin
f4c2048bf2 Fix toDateTime64(toDate()/toDateTime()) for DateTime64
Maybe this is even does not worth it, but at least there was code that
assume that this should work - ToDateTime64Transform in
FunctionsConversion.h.
2021-02-06 13:04:53 +03:00
keenwolf
9beb7689cc add comments and update test cases. 2021-02-02 23:35:45 +08:00
keenwolf
d251807ea4 add function timezoneOffset 2021-02-02 11:01:20 +08:00
Ivan Lezhankin
f897f7c93f Refactor IFunction to execute with const arguments 2020-11-17 16:24:45 +03:00
Nikolai Kochetov
139487a1a0 Part 1. 2020-10-17 17:23:37 +03:00
Nikolai Kochetov
959424f28a Rename block to columns. 2020-10-14 17:04:50 +03:00
Nikolai Kochetov
3a17c2a7ac Rename FunctionArguments to ColumnsWithTypeAndName 2020-10-11 22:20:20 +03:00
Nikolai Kochetov
d28325a353 Replace getByPosition to [] 2020-10-10 21:24:57 +03:00
Nikolai Kochetov
a7fb2e38a5 Use ColumnWithTypeAndName as function argument instead of Block. 2020-10-09 10:41:28 +03:00
Artem Zuikov
51ba12c2c3
Try speedup build (#14809) 2020-09-15 12:55:57 +03:00
Vasily Nemkov
2c2005817f New function toStartOfSecond(DateTime64) -> DateTime64
This funtion nullifies sub-second part of DateTime64 value.
2020-05-11 12:06:06 +03:00
Ivan Lezhankin
06446b4f08 dbms/ → src/ 2020-04-03 18:14:31 +03:00