Commit Graph

16 Commits

Author SHA1 Message Date
ltrk2
52e6cf36b2 Fix style issue 2023-08-09 06:43:27 -07:00
ltrk2
06631f6a86 Make hasTokenOrNull return null on empty needle 2023-08-04 09:44:02 -07:00
Alexey Milovidov
ac408d0b63 Add a check for hasToken 2023-07-17 00:10:42 +02:00
Alexey Milovidov
7e6d606b1c Remove bad code and fix a bug 2023-06-28 10:41:39 +02:00
Robert Schulze
45c263cbb5
Replace try/catch logic in hasTokenOrNull() by sth more lightweight 2023-06-26 15:06:58 +00:00
ltrk2
9710b8643c Refine the solution 2023-01-23 14:27:48 -08:00
ltrk2
810c9ba50c Produce a null map of the correct size 2023-01-20 10:24:42 -05:00
ltrk2
65b9c69c90 Introduce non-throwing variants of hasToken 2023-01-20 10:24:42 -05:00
Robert Schulze
e25ca139cd
Implement SQL functions (NOT) (I)LIKE() + MATCH() with non-const needles
With this commit, SQL functions LIKE and MATCH and their variants can
work with non-const needle arguments. E.g.

  create table tab
    (id UInt32, haystack String, needle String)
    engine = MergeTree()
    order by id;

  insert into tab values
  (1, 'Hello', '%ell%')
  (2, 'World', '%orl%')

  select id, haystack, needle, like(haystack, needle)
  from tab;

For that, methods vectorVector() and vectorFixedVector() were added to
MatchImpl. The existing code for const needles has an optimization where
the compiled regexp is cached. The new code expects a different needle
per row and consequently does not cache the regexp.
2022-05-23 09:41:28 +02:00
Robert Schulze
4829ae8380
Replace overly clever const argument logic by something simpler
The previous logic was smart but too inflexible to support the next
commits. Replace by a simple pushdown logic where string search
implementations return their const arguments instead of having the
common class figure these out based on properties/traits.
2022-05-22 17:50:38 +02:00
Robert Schulze
0299cc87e4
Improve naming consistency of string search code
Just renamings, nothing major ...
2022-05-22 17:50:38 +02:00
Vasily Nemkov
2c6b9aa174 Better exception messages for some String-related functions 2021-09-26 08:18:37 +03:00
vdimir
7260009978 Fix argument handling in string search functions 2020-08-04 10:10:50 +03:00
vdimir
368314b930 Fix style in PositionImpl and FunctionsStringSearch 2020-08-02 14:24:39 +00:00
vdimir
9ed7df64cd Support 'start_pos' argument in 'position' function 2020-08-02 12:56:18 +00:00
Ivan Lezhankin
06446b4f08 dbms/ → src/ 2020-04-03 18:14:31 +03:00