Commit Graph

3787 Commits

Author SHA1 Message Date
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
Roman Vasin
e40b8f471d Add compatibility parameter enable_date32_results 2022-08-23 12:43:08 +00:00
Roman Vasin
d73a80a54c Delete not needed code from getReturnTypeImpl of FunctionDateOrDateTimeToDateOrDate32 2022-08-22 16:24:45 +00:00
Roman Vasin
19cb6d87c8 Add FunctionDateOrDateTimeToDateOrDate32 and make toLastDayOfMonth working 2022-08-17 16:38:06 +00:00
Roman Vasin
be3151937c Set return type to Date32 for toLastDayOfMonth function 2022-08-17 08:51:14 +00:00
Igor Nikonov
e7baf920a9
Merge pull request #39600 from zvonand/zvonand-decimal-overflow
Check Decimal division overflow based on operands scale
2022-08-15 15:03:06 +02:00
Alexey Milovidov
ad936ae32a
Merge pull request #40211 from canhld94/ch_canh_fix_datetime
Fix unexpected result arrayDifference of Array(UInt32)
2022-08-15 04:52:58 +03:00
Igor Nikonov
6f00643bc1
Merge branch 'master' into zvonand-decimal-overflow 2022-08-15 02:38:45 +02:00
Igor Nikonov
2cb78c7220 Detailed comment about overflow check 2022-08-15 00:37:18 +00:00
Duc Canh Le
272447c5dc remove junk log 2022-08-14 16:19:09 +08:00
Duc Canh Le
71dd2a19fc fix arrayDiff 2022-08-14 16:14:13 +08:00
Alexey Milovidov
10022ee974 Fix insufficient argument check for encryption functions 2022-08-14 04:28:30 +02:00
Alexey Milovidov
31dbb68185 Fix array signed const positive subscript operator 2022-08-13 08:04:24 +02:00
Kseniia Sumarokova
a6cfc7bc3b
Merge pull request #34651 from alexX512/master
New caching strategies
2022-08-12 17:23:37 +02:00
Igor Nikonov
394a71dcfd More correct fix + tests 2022-08-11 06:24:40 +00:00
Alexey Milovidov
8374f31306
Merge pull request #39425 from arenadata/ADQM-485
Add support of dates from year 1900 to 2299 for Date32 and DateTime64
2022-08-11 05:01:53 +03:00
Nikolay Degterinsky
547662f88b
Merge pull request #40002 from Algunenano/fix_hashid
Fix hashId crash and salt parameter not being used
2022-08-11 02:25:10 +02:00
Alexey Milovidov
53097b3d65
Merge pull request #40015 from tbragin/master
Add parseDateTime64BestEffortUS* functions
2022-08-10 20:00:50 +03:00
Roman Vasin
537ba613dc Remove clamping from AddDaysImpl and AddWeeksImpl; fix 01921_datatype_date32 test 2022-08-10 08:14:16 +00:00
Kruglov Pavel
4bbe5186c2
Merge pull request #39999 from HeenaBansal2009/Support_H_syntax_in_Hour_Interval_Kind
Added H literal for Hour IntervalKind
2022-08-09 11:24:41 +02:00
Roman Vasin
96598e3574 Replace normalizeDayNum() by std::clamp() 2022-08-09 08:52:02 +00:00
Tanya Bragin
eb61db3b67 initial changes to close #37492 2022-08-08 19:45:00 -07:00
HeenaBansal2009
d2bdf6fc3e Added tests 2022-08-08 11:51:05 -07:00
Raúl Marín
c8f8ceea8d Fix hashId crash and salt not applying 2022-08-08 18:25:34 +02:00
alexX512
6bf29cb610 Change class LRUCache to class CachBase. Check running CacheBase with default pcahce policy SLRU 2022-08-07 19:59:30 +00:00
Nikolai Kochetov
658a269d56
Merge branch 'master' into use-dag-in-key-condition 2022-08-04 16:18:40 +02:00
Kruglov Pavel
b84e65bb3b
Merge pull request #39716 from arthurpassos/fix_scalar_cte_with_lc_result
Unwrap LC column in IExecutablefunction::executeWithoutSparseColumns
2022-08-03 18:53:37 +02:00
Arthur Passos
e9b124b4bc Don't use default implementation for LC columns in Scalar functions 2022-08-02 09:17:53 -03:00
Anton Popov
f94d4d4877
Merge branch 'master' into hash-functions-map 2022-08-02 13:26:54 +02:00
Robert Schulze
bf574b9154
Merge pull request #39760 from ClickHouse/bit-fiddling
Use std::popcount, ::countl_zero, ::countr_zero functions
2022-08-01 17:04:51 +02:00
Kruglov Pavel
dfdfabec94
Merge pull request #39218 from evillique/file_default_value
Add default argument to the function `file`
2022-08-01 13:04:19 +02:00
Nikolai Kochetov
22fbfe19a4 Merge branch 'master' into use-dag-in-key-condition 2022-07-31 21:54:12 +02:00
Robert Schulze
a7734672b9
Use std::popcount, ::countl_zero, ::countr_zero functions
- Introduced with the C++20 <bit> header

- The problem with __builtin_c(l|t)z() is that 0 as input has an
  undefined result (*) and the code did not always check. The std::
  versions do not have this issue.

- In some cases, we continue to use buildin_c(l|t)z(), (e.g. in
  src/Common/BitHelpers.h) because the std:: versions only accept
  unsigned inputs (and they also check that) and the casting would be
  ugly.

(*) https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
2022-07-31 15:16:51 +00:00
Robert Schulze
4d7627e45e
Fix include 2022-07-31 07:36:40 +00:00
Robert Schulze
8ca236de08
Enable SQL function getOSKernelVersion() on all platforms
Follow up to PR #38615
2022-07-30 22:36:47 +00:00
Robert Schulze
85773e0926
Merge pull request #38615 from liyinsg/simplified_function_registration_interface
Simplified function registration interface
2022-07-31 00:18:37 +02:00
Robert Schulze
b52843d5fd
Merge pull request #37951 from zvonand/dt64_timeslots
Fix timeSlots for DateTime64
2022-07-30 20:49:05 +02:00
Alexey Milovidov
8f348edbbd
Merge pull request #39000 from ClickHouse/avx-enablement
Avx enablement
2022-07-30 04:51:07 +03:00
Arthur Passos
f0f19874da fix style 2022-07-29 13:56:01 -03:00
Arthur Passos
59fbd21024 Unwrap LC column in IExecutablefunction::executeWithoutSparseColumns 2022-07-29 12:03:09 -03:00
Nikolai Kochetov
59a11b32ad
Merge branch 'master' into use-dag-in-key-condition 2022-07-29 17:01:33 +02:00
zvonand
b390bcfe7c fix wrong data type cast 2022-07-29 13:25:40 +03:00
Li Yin
4088c0a7f3 Automated function registration
Automated register all functions with below naming convention by
iterating through the symbols:
void DB::registerXXX(DB::FunctionFactory &)
2022-07-29 15:39:50 +08:00
Anton Popov
45da56d802 support hash functions with Map type 2022-07-28 19:15:19 +00:00
Alexander Gololobov
9525bd19bf
Merge pull request #39592 from ClickHouse/fix-wrong-regexp-replace
Fix wrong regexp replace
2022-07-27 09:54:28 +02:00
Antonio Andelic
904a05ac21
Merge pull request #39496 from azat/custom-tld-exclamation-asterisk
Add support of !/* (exclamation/asterisk) in custom TLDs
2022-07-27 08:55:49 +02:00
Vladimir C
d9e8e9b948
Merge pull request #39552 from filimonov/maxsplit-bug
Fix bug with maxsplit in the splitByChar
2022-07-26 11:14:27 +02:00
Alexey Milovidov
833b24b486 Fix the wrong REGEXP_REPLACE alias 2022-07-26 08:01:49 +02:00
Azat Khuzhin
1d4a7c7290 Add support of !/* (exclamation/asterisk) in custom TLDs
Public suffix list may contain special characters (you may find format
here - [1]):
- asterisk (*)
- exclamation mark (!)

  [1]: https://github.com/publicsuffix/list/wiki/Format

It is easier to describe how it should be interpreted with an examples.

Consider the following part of the list:

    *.sch.uk
    *.kawasaki.jp
    !city.kawasaki.jp

And here are the results for `cutToFirstSignificantSubdomainCustom()`:

If you have only asterisk (*):

    foo.something.sheffield.sch.uk -> something.sheffield.sch.uk
    sheffield.sch.uk               -> sheffield.sch.uk

If you have exclamation mark (!) too:

    foo.kawasaki.jp                -> foo.kawasaki.jp
    foo.foo.kawasaki.jp            -> foo.foo.kawasaki.jp
    city.kawasaki.jp               -> city.kawasaki.jp
    some.city.kawasaki.jp          -> city.kawasaki.jp

TLDs had been verified wit the following script [2], to match with
python publicsuffix2 module.

  [2]: https://gist.github.com/azat/c1a7a9f1e3519793134ef4b1df5461a6

v2: fix StringHashTable padding requirements
Fixes: #39468
Follow-up for: #17748
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-07-26 08:34:30 +03:00