Commit Graph

97 Commits

Author SHA1 Message Date
Robert Schulze
4c236b34f0
Another small cleanup 2023-11-27 11:09:07 +00:00
Robert Schulze
a8671049e1
Various smaller fixups 2023-11-27 08:49:54 +00:00
Azat Khuzhin
315906b380 Add ability to parse hours/months without leading zeros
Recently I was looking into one dataset, that has such format.

So I've changed the meaning of the following formatters for
formatDateTime()/parseDateTime(), like in other implementations [1]:

- %l/%k - to handle hours without leading zeros
- %c - handle months without leading zeros

  [1]: https://www.php.net/strftime

And since this is kind of behaviour change (even though it is unlikely
will break something), there is a new setting to control this new
behaviour:
- parsedatetime_enable_format_without_leading_zeros=1 (default ON)
- formatdatetime_enable_format_without_leading_zeros=0 (default OFF, since this could change users output)

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-11-26 19:10:17 +01:00
Alexey Milovidov
8c253b9e3e Remove C++ templates 2023-11-10 05:25:02 +01:00
Robert Schulze
0149e4226f
Cosmetics 2023-09-25 17:09:22 +00:00
yariks5s
767cac44da minor requests 2023-09-05 08:13:12 +00:00
yariks5s
4af150db5f fixed suggestions 2023-09-04 14:22:03 +00:00
yariks5s
033970716e fixed tests 2023-09-04 13:30:24 +00:00
yariks5s
0c9653dac5 implemented for formatDateTime and toString 2023-09-01 14:01:06 +00:00
Dmitry Kardymon
8ad1d4b94f Add comment 2023-06-27 06:31:30 +00:00
Dmitry Kardymon
2d11ce43f1 Build fix 2023-06-23 05:17:01 +00:00
Dmitry Kardymon
65e5d40cae Fix formatDateTime() with fractional negative datetime64 2023-06-22 19:38:41 +00:00
Robert Schulze
1fc5d92ae2
Merge pull request #48627 from ClickHouse/rs/formatdatetime-refactoring
Minor refactoring of formatDateTime()
2023-04-11 15:29:47 +02:00
Robert Schulze
4b61685c64
Minor refactoring of formatDateTime()
Don't explicitly specify literal length when the called functions can
compute it.
2023-04-11 07:43:24 +00:00
Robert Schulze
5eb31bba87
MySQL compat: Align behavior of %f in formatDateTime() with parseDateTime() 2023-04-06 08:13:04 +00:00
Robert Schulze
ce2692ba79
Merge pull request #47246 from ClickHouse/rs/m
Change the behavior of formatter %M in function formatDateTime() from minutes to month name
2023-04-06 09:19:50 +02:00
Robert Schulze
65609340cc
Yet another fix 2023-04-05 20:23:41 +00:00
Robert Schulze
3e84be5f3a
Fix stuff 2023-04-05 20:10:27 +00:00
Robert Schulze
809a7fbb7a
Incorporate more review feedback 2023-04-05 19:43:30 +00:00
Robert Schulze
73ffdbe2f4
Minor fixups 2023-04-04 09:11:59 +00:00
Robert Schulze
d7ee316380
Minor: Suggest ClickHouse-native function name over MySQL-compatibility alias 2023-04-03 07:28:31 +00:00
Robert Schulze
eafae6fdba
Cosmetics 2023-03-27 14:01:26 +00:00
Robert Schulze
3db38dbb5a
Replace mySQL date formatter M behavior from minutes to month name 2023-03-27 14:00:51 +00:00
Robert Schulze
22da93e239
Cosmetics 2023-03-27 14:00:44 +00:00
Robert Schulze
bd02627869
Update docs for parseDateTime() (follow-up to #46815) 2023-03-23 21:28:03 +00:00
taiyang-li
3ca789b4a2 changes as requested 2023-03-20 23:58:37 +08:00
taiyang-li
89a2329e62 change as requested 2023-03-06 17:08:55 +08:00
taiyang-li
d7cb43a20b change as requested 2023-03-05 16:24:05 +08:00
Jake Bamrah
4ea814a843 add DATE_FORMAT alias and remaining mySQL date formatters 2023-02-16 09:52:19 +00:00
kigerzhang
a6d7e37815 fix test reference 2023-02-08 15:41:17 +08:00
kigerzhang
46161bc4e9 fix style 2023-02-07 10:03:03 +08:00
zk_kiger
b13eaf5e68
Merge branch 'master' into improve_format_datetime_joda 2023-02-06 19:16:10 +08:00
kigerzhang
e1c9b8c155 Add new functionality to the function FormatDataTime 2023-01-31 10:20:59 +08:00
Robert Schulze
e88aa18a8c
Fix typo 2023-01-29 20:01:30 +00:00
Alexey Milovidov
5b257ab806
Merge pull request #45233 from ClickHouse/improve_week_day
Revert "Revert "Improve week day""
2023-01-27 02:44:17 +03:00
Alexander Tokmakov
70d1adfe4b
Better formatting for exception messages (#45449)
* save format string for NetException

* format exceptions

* format exceptions 2

* format exceptions 3

* format exceptions 4

* format exceptions 5

* format exceptions 6

* fix

* format exceptions 7

* format exceptions 8

* Update MergeTreeIndexGin.cpp

* Update AggregateFunctionMap.cpp

* Update AggregateFunctionMap.cpp

* fix
2023-01-24 00:13:58 +03:00
Robert Schulze
4ea836b87e
Revert "Revert "update function DAYOFWEEK and add new function WEEKDAY for mysql/spark compatiability""
This reverts commit e37f572c34.
2023-01-13 14:00:16 +00:00
Alexander Tokmakov
e37f572c34
Revert "update function DAYOFWEEK and add new function WEEKDAY for mysql/spark compatiability" 2023-01-12 15:01:36 +03:00
taiyang-li
4bc2c61406 change as request 2023-01-09 20:37:16 +08:00
taiyang-li
5ae280611b merge master and solve conflict 2022-12-28 14:44:10 +08:00
Alexander Gololobov
92c609eb2c Fix case with DateTime64 with precision=0; do not split decimal again in every instruction 2022-12-21 21:00:39 +01:00
taiyang-li
091cebf861 fix clang-tidy warning 2022-12-21 12:20:08 +08:00
taiyang-li
58cbd8162f Add new functions to format datetime in joda datetime style 2022-12-14 14:28:43 +08:00
ltrk2
5e7558b1a5 Correct an instance of overindexing 2022-12-12 11:53:29 -08:00
ltrk2
cae7a1d24a Implement formatDateTime fractional second formatter 2022-12-08 14:53:16 -08:00
Roman Vasin
5755728b33 Add Date32 and DateTime64 into exception messages 2022-10-28 13:11:09 +00:00
Roman Vasin
15f3f56812 Change 1 argument of function to first argument of function etc 2022-10-28 12:44:47 +00:00
Roman Vasin
09fe9c3ed1 Use {} in exceptions 2022-10-26 16:07:56 +00:00
Roman Vasin
3eca9ada3b Add Date32 to formatDateTIme 2022-10-26 08:00:12 +00: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