Commit Graph

1762 Commits

Author SHA1 Message Date
Maksim Kita
1c5b377b3a Fixed code review issues 2024-01-30 19:36:40 +03:00
Maksim Kita
948f3f1f62 Fixed style check 2024-01-30 17:15:29 +03:00
Maksim Kita
86a542b5c4 Updated implementation 2024-01-30 17:15:29 +03:00
Maksim Kita
20c1f0c18f Revert "Revert "Add new aggregation function groupArraySorted()"" 2024-01-30 17:15:29 +03:00
Alexey Milovidov
798f655276 Rename quantileDDSketch to quantileDD 2024-01-30 11:49:56 +01:00
UnamedRus
94770f8d8a
Merge branch 'master' into topk-statistics-count-errors 2024-01-28 20:50:45 +03:00
Nikolai Kochetov
75edbdd39c
Merge pull request #59147 from ClickHouse/vdimir/fix_agg_nothing_2
Fix AggregateFunctionNothing result type issues introducing it with different names
2024-01-26 14:33:38 +01:00
Raúl Marín
f9d218ec52 Fix a bug 2024-01-24 21:03:46 +01:00
vdimir
bcfe691954
Use different names for nothing function with different result types 2024-01-24 09:55:09 +00:00
Raúl Marín
96eb5f2fbb Fix old JIT bug and improve code 2024-01-23 17:02:37 +01:00
Nikita Taranov
c7be7363cf fix 2024-01-23 14:46:33 +01:00
Raúl Marín
eb3cfcc300 Tidy 2024-01-23 10:43:00 +01:00
Raúl Marín
e1bd77fa31 Introduce one template level to argMin to recover some perf 2024-01-22 17:31:34 +01:00
Raúl Marín
1e00dec997 Merge remote-tracking branch 'blessed/master' into argmin_optimization 2024-01-22 14:56:55 +01:00
Raúl Marín
a2d23ab78e Micro opt 2024-01-22 14:56:17 +01:00
Raúl Marín
a38ca3bca2 Optimize SingleValueDataNumeric getIndexNotNullIf 2024-01-22 14:55:52 +01:00
Dmitry Novik
a18a8d8ea3
Merge pull request #59009 from nickitat/uniq_optimisation_for_distributed
`uniqExact` state parallel merging for distributed queries
2024-01-22 14:05:02 +01:00
Nikita Taranov
60a910e94f better 2024-01-19 18:47:21 +01:00
Nikita Taranov
f1efb29a66 better 2024-01-19 18:13:03 +01:00
Nikita Taranov
a47d15ab62 impl 2024-01-19 16:59:01 +01:00
Raúl Marín
8d30feec98 Initialize to false 2024-01-18 15:04:08 +01:00
Raúl Marín
bcc67735b9 Tidy 2024-01-18 13:16:08 +01:00
Raúl Marín
6aa5ac4cc6 Merge remote-tracking branch 'blessed/master' into argmin_optimization 2024-01-18 12:04:19 +01:00
Raúl Marín
1105be0e73 Recover lost JIT performance 2024-01-18 12:01:52 +01:00
Srikanth Chekuri
c23c7e0b6f
feat: add DDSketch quantile (#56342)
* feat: add DDSketch quantile

* Fix StyleCheck

* Move quantileddsketch.md under right dir

* Update stateless test number and add stateful test

* Throw exception when relative accuracy is too low

* Update test number

* Fix undefined behaviour for empty store

* Fix quantileGK test

* Update test numbers

* Update src/AggregateFunctions/

* Throw exception on out of range values

* Update relative accuracy docs and add encoding details

* Address review comments and suggestions

* Remove unused function

* Address alexey review comments

* Remove unused function isFloat64FieldType

* Throw error on invalid relative accuracy

* Simplify mapping

* Address remaining review comments

* Add effective memory usage suggestions

* Fix Stylecheck

* Fix fast test

* Incorporate bins capacity suggestion

* Fix fuzzer

* Remove inheritance in Mapping, Store and DDSketch

* Add checks for bin resizing

* Add note about the binary compatible implementation
2024-01-17 19:51:32 -08:00
Raúl Marín
849ac1fe99 Implement findExtremeMinIndex / findExtremeMaxIndex 2024-01-17 16:22:40 +01:00
Raúl Marín
6daaf3dc72 Self review to improve style and bug in ArgMax combinator 2024-01-17 14:21:25 +01:00
Raúl Marín
9cffb9bfeb Do not use a stack variable 2024-01-16 13:20:39 +01:00
Raúl Marín
428f69c57d Tidy 2024-01-16 10:17:05 +01:00
Raúl Marín
56a8368db7 Make sure compileCreate initializes the vtable pointer 2024-01-16 00:47:58 +01:00
Raúl Marín
7b62ad2156 Tidy 2024-01-16 00:46:03 +01:00
Raúl Marín
4acda2222e Better readability 2024-01-16 00:46:03 +01:00
UnamedRus
6910cdbac4 Added test, bumped to master 2024-01-14 01:33:17 +03:00
Raúl Marín
5dfa6799a5 Style 2024-01-13 13:30:53 +01:00
Raúl Marín
6e5965b4cc Reintroduce JIT in any, anyLast, min and max 2024-01-12 19:42:57 +01:00
Raúl Marín
c1d52b9771 Proper check order 2024-01-12 14:13:34 +01:00
Raúl Marín
99f3ac5a0c Implement missing destructors 2024-01-12 13:49:25 +01:00
Raúl Marín
13c2b6ab60 Clang tidy is just unhappy and making me unhappy too 2024-01-12 12:33:31 +01:00
Raúl Marín
50bc69aae8 Try to make clang-tidy happy 2024-01-12 11:13:25 +01:00
Raúl Marín
75b394bd0e Full revert of changes to IAggregateFunction.h 2024-01-12 10:07:15 +01:00
Raúl Marín
ebd6fee431 Some fixes 2024-01-11 19:44:19 +01:00
Raúl Marín
7a84418493 Revert incorrect change
Constructor should be called by init. Let's verify
2024-01-11 18:25:43 +01:00
Raúl Marín
260c2f7e97 Clang tidy 2024-01-11 17:06:26 +01:00
Raúl Marín
54093f9496 Fix some bugs in ArgMin/ArgMax combinator 2024-01-11 16:58:53 +01:00
Raúl Marín
5791ebb74c Fix some problems 2024-01-11 12:18:52 +01:00
Raúl Marín
58891e15b5 Bug and sanity 2024-01-10 18:57:06 +01:00
Raúl Marín
4321abec5b Reimplement ArgMin and ArgMax combinators 2024-01-10 17:18:07 +01:00
Raúl Marín
05247f5e41 Smaller vs greater 2024-01-10 14:32:46 +01:00
Raúl Marín
7ab7f10ed6 Remove more templates 2024-01-10 14:29:07 +01:00
Raúl Marín
19dd7bb14a Unify min/max and argMin/argMax 2024-01-10 14:07:39 +01:00
Raúl Marín
2d71543f9e Unify AggregateFunctionArgMinMaxData memory 2024-01-10 12:53:29 +01:00
Raúl Marín
5966249f4f Fix one bug 2024-01-10 11:49:14 +01:00
Raúl Marín
66f3a5e50a
Update SingleValueData.cpp 2024-01-09 22:16:13 +01:00
Raúl Marín
be5eaf53aa Cleanup 2024-01-09 21:23:26 +01:00
Raúl Marín
d3cbbb319e Implement argMin 2024-01-09 20:58:05 +01:00
Raúl Marín
d5b6f82f3e Optimize (not fully) argMax with numbers 2024-01-09 20:32:34 +01:00
Raúl Marín
5009280475 Initial implementation of (unoptimized) argMax with fast compilation 2024-01-09 19:29:56 +01:00
Raúl Marín
227baac06a Reimplement any and anyLast 2024-01-09 14:55:38 +01:00
Raúl Marín
067aea6eb2 Reimplement anyHeavy 2024-01-09 13:13:57 +01:00
Raúl Marín
ff98e7637c AggregateFunctionSingleValueOrNull: Prefer composition to inheritance 2024-01-09 13:11:58 +01:00
Raúl Marín
ada73c61f2 Move any_respect_nulls/anyLast_respect_nulls to their own file! 2024-01-09 12:15:58 +01:00
Raúl Marín
49d089d157 Reimplement singleValueOrNull 2024-01-09 11:38:18 +01:00
Raúl Marín
b3cd4069b7 Reimplement AggregateFunctionMin 2024-01-09 11:38:18 +01:00
Raúl Marín
0522d859c2
Merge pull request #58334 from Algunenano/minmax_non_numeric
Speedup MIN/MAX for non numeric types
2024-01-04 19:48:18 +01:00
Raúl Marín
5bfddfebb6 Fix instantiation detection 2024-01-04 14:08:58 +00:00
Raúl Marín
1c40700ea1 Merge remote-tracking branch 'blessed/master' into minmax_non_numeric 2024-01-03 14:09:28 +01:00
Raúl Marín
5fb7f9f861 Ignore other numeric types for now 2023-12-29 18:09:20 +01:00
Raúl Marín
22ef5443bb Move findNumeric to .cpp 2023-12-29 17:22:06 +01:00
Raúl Marín
4b7fcfbc75 Use iota in more places 2023-12-29 17:20:18 +01:00
Raúl Marín
bda6104f84 Replace std::iota with DB::iota where possible 2023-12-29 14:38:22 +01:00
凌涛
4630398d23 optimize 2023-12-29 10:38:13 +08:00
凌涛
7bd8488db5 Funciont sparkBar alias sparkbar 2023-12-29 10:08:17 +08:00
Raúl Marín
8a90f12dc9 Speedup MIN/MAX for non numeric types 2023-12-28 23:28:26 +01:00
robot-ch-test-poll2
04178a9028
Merge pull request #58231 from Algunenano/new_minmax
Speedup MIN and MAX for native types
2023-12-28 01:22:38 +01:00
Azat Khuzhin
b9233f6d4f Move Allocator code into module part
This should reduce amount of code that should be recompiled on
Exception.h changes (and everything else that had been included there).

This will actually not help a lot, because it is also included into
PODArray.h and ThreadPool.h at least... Sigh.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-27 15:42:08 +01:00
Raúl Marín
68787cedd6 Linter warnings 2023-12-27 08:51:17 +00:00
Raúl Marín
76abd32196 Speedup MIN and MAX for native types 2023-12-26 20:23:55 +01:00
Azat Khuzhin
3be3b0a280 Fix incorrect Exceptions
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-24 21:26:32 +01:00
Anton Popov
e4e97471a6 fix totals in aggregation functions with Map combinator 2023-12-12 17:31:56 +00:00
Azat Khuzhin
7af1c0885d Do not call add*() from addBatchSparseSinglePlace() if there are no rows
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-09 22:47:25 +01:00
Azat Khuzhin
472a31e581 Fix SIGSEGV for aggregation of sparse columns with any() RESPECT NULL
Add proper check into any() RESPECT NULL

Fixes: https://github.com/ClickHouse/ClickHouse/issues/57709
Fixes: https://github.com/ClickHouse/ClickHouse/pull/57189 (cc @Algunenano)
CI: https://s3.amazonaws.com/clickhouse-test-reports/52717/7ec9c6a7f7490b5075407410dc193a2534216e15/fuzzer_astfuzzerdebug/report.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-12-09 22:47:15 +01:00
FFish
add243593d
fix: split lttb bucket strategy, first bucket and last bucket should only contain single point (#57003)
* fix: split lttb bucket policy, first bucket and last bucket should only
contain single point

* add comments and modify the corresponding query test

* style: update code format

* style: remove useless comments

* feat: add lttb bucket size test

* fix: typo, duplicate sql
2023-12-07 12:29:37 +01:00
Alexey Milovidov
2988f6f92a
Revert "Add new aggregation function groupArraySorted()" 2023-12-05 15:31:17 +03:00
Raúl Marín
46acd8736c
Merge pull request #57189 from Algunenano/fix_respect_nulls
Fix RESPECT NULLS
2023-11-30 20:21:42 +01:00
Nikolai Kochetov
024f41888e
Merge pull request #53562 from yariks5s/group_sorted_array_function
Add new aggregation function groupArraySorted()
2023-11-29 17:52:01 +01:00
Han Fei
4c0efb0262
Merge pull request #53240 from hanfei1991/hanfei/statistic
use statistic to order prewhere conditions better
2023-11-29 12:26:44 +01:00
vdimir
001b67863a
Merge pull request #57265 from ClickHouse/vdimir/analyzer_aggregate_nothing_type
Analyzer: fix result type of aggregate function with NULL
2023-11-29 11:27:54 +01:00
Raúl Marín
b102145a4f
Merge pull request #57301 from Algunenano/fix_reports
Fix code reports
2023-11-29 11:11:33 +01:00
Yarik Briukhovetskyi
1f672b8654
possibly fix fuzzer 2023-11-28 19:37:00 +01:00
Han Fei
6733438adc Merge branch 'master' into hanfei/statistic 2023-11-28 16:35:00 +01:00
Yarik Briukhovetskyi
460134c8f6
Update AggregateFunctionGroupArraySorted.h 2023-11-28 15:25:11 +01:00
vdimir
20ce32f69a
Use original function name instead of nothing in FunctionNode::toAST 2023-11-28 14:16:01 +00:00
Raúl Marín
4e6ff36abf Fix issue found by AST fuzzer 2023-11-28 13:22:02 +01:00
Raúl Marín
48fff248e5 Merge remote-tracking branch 'blessed/master' into fix_respect_nulls 2023-11-28 12:28:36 +01:00
vdimir
1f474a870a
Add extra argument to function 'nothing' only in QueryAnalysisPass 2023-11-28 10:11:38 +00:00
vdimir
04baafccba
Analyzer: fix result type of aggregate function with NULL 2023-11-28 10:11:34 +00:00
Raúl Marín
148ba93903 Add comment for AggregateFunctionCombinatorNull::transformAggregateFunction 2023-11-28 10:02:52 +00:00
Han Fei
7bd2ea3add Merge branch 'master' into hanfei/statistic 2023-11-27 23:31:23 +01:00
Raúl Marín
a3ceafbbed Fix embarrasing bug number 2 2023-11-27 23:12:17 +01:00
Raúl Marín
0754ee4901 Fix embarrasing bug number 1 2023-11-27 23:12:17 +01:00
Raúl Marín
80cc1b3a17 Remove addBatchSinglePlaceFromInterval 2023-11-27 23:12:17 +01:00
Raúl Marín
3395c7c745 Provide a custom implementation for respect_null aggregations 2023-11-27 19:29:20 +01:00
Raúl Marín
0d0d813a31 PR review suggestions 2023-11-27 17:39:11 +01:00
yariks5s
a9ed876615 added size assert (possible fix of fuzzer) 2023-11-27 15:49:37 +00:00
yariks5s
b8590f8f36 style check 2023-11-27 11:44:51 +00:00
Raúl Marín
829c2b2355 Clang-tidy detected problems 2023-11-27 11:00:27 +01:00
Raúl Marín
56b15a7294 Fix style 2023-11-27 11:00:27 +01:00
Raúl Marín
4250c6626c Move handling of RESPECT NULLS outside of the parser 2023-11-27 11:00:27 +01:00
Raúl Marín
d8ac46e064 Make RESPECT NULLS case insensitive and compatible with combinators 2023-11-27 11:00:27 +01:00
Raúl Marín
f0e832a6b9 Move respect nulls constructors to implementation file 2023-11-27 11:00:27 +01:00
Raúl Marín
a3e342a477 Separate first_value and first_value_respect_nulls states 2023-11-27 11:00:27 +01:00
yariks5s
cc8ac432dd rewrite function to be independent of groupArray, add test 2023-11-24 18:55:15 +00:00
Yarik Briukhovetskyi
69205769d0
Merge branch 'ClickHouse:master' into group_sorted_array_function 2023-11-23 20:23:47 +01:00
yariks5s
cb6898b52f fix due to review 2023-11-23 18:17:47 +00:00
Alexey Milovidov
c4de4045f1 Fix error 2023-11-13 06:29:45 +01:00
Alexey Milovidov
e6149cb1f0 Fix idiotic behavior of sumMap aggregate function 2023-11-12 06:45:05 +01:00
Alexey Milovidov
345f3935ff Something 2023-11-12 06:39:16 +01:00
Alexey Milovidov
faee91a820 Fix style 2023-11-12 04:36:50 +01:00
Alexey Milovidov
84bd67dd30 Parallelize compilation for RISC-V 2023-11-12 04:23:05 +01:00
Alexey Milovidov
0de9f83192 Fix tidy 2023-11-12 00:23:09 +01:00
Alexey Milovidov
7138174401 Maybe fix tidy 2023-11-11 08:58:06 +01:00
Alexey Milovidov
c94f4266fa Merge branch 'remove-cpp-templates-2' into system-symbols 2023-11-11 04:12:44 +01:00
Alexey Milovidov
4de5ee8acc Something 2023-11-11 01:01:43 +01:00
Alexey Milovidov
45146d14d3 sumMap: simplification (one lookup instead of two) 2023-11-10 02:24:18 +01:00
Alexey Milovidov
0e9b418341 Simplify uniqCombined 2023-11-10 02:05:35 +01:00
Alexey Milovidov
3f5b94b8ca Remove useless using 2023-11-09 23:37:39 +01:00
Alexey Milovidov
02035d9b90 Remove useless using 2023-11-09 23:37:00 +01:00
Alexey Milovidov
30bec95d11 Remove support of Decimal inside avgWeighted #56435 2023-11-08 03:52:23 +01:00
Alexey Milovidov
52bd128f2d Fix style 2023-11-08 03:33:41 +01:00
Alexey Milovidov
a22bef3540 The code was mistakenly written in C instead of C++ 2023-11-07 23:25:39 +01:00
Alexey Milovidov
be106b5c77 Someone thinks too high about their code 2023-11-07 23:20:01 +01:00
Alexey Milovidov
8cd1caab07 Remove C++ templates 2023-11-07 22:54:21 +01:00
Alexey Milovidov
6efb1d1759 Merge with master 2023-11-07 19:44:18 +01:00
Alexey Milovidov
ca83da14f2 Merge branch 'master' of github.com:ClickHouse/ClickHouse into system-symbols 2023-11-07 19:43:19 +01:00
Alexey Milovidov
d7d68b23d9 Address review comments 2023-11-07 18:40:34 +01:00
Alexey Milovidov
35335d9e00 Fix a bug in groupArraySample 2023-11-07 00:24:52 +01:00
Alexey Milovidov
22630c6211 Fix tidy 2023-11-07 00:09:41 +01:00
Alexey Milovidov
04b81ef6a8 Fix unusual shit 2023-11-07 00:09:22 +01:00
Alexey Milovidov
99522df3c1 Fix tidy 2023-11-06 23:50:39 +01:00
Alexey Milovidov
11302688bd Fix tidy 2023-11-06 23:48:23 +01:00
Alexey Milovidov
e3ad367e04 Fix a bug 2023-11-06 23:47:43 +01:00
Alexey Milovidov
21049b23d2 Fix tidy 2023-11-06 23:45:30 +01:00
Alexey Milovidov
571649e2bb Fix a bug 2023-11-06 23:45:07 +01:00
Alexey Milovidov
a16b5c1119 Fix whitespace 2023-11-06 23:40:53 +01:00
Alexey Milovidov
e767df53fd Fix tidy 2023-11-06 23:40:35 +01:00
Alexey Milovidov
145c37f342 Fix tidy 2023-11-06 16:28:05 +01:00
Robert Schulze
8896134531
Cleanup IDataType convenience functions 2023-11-06 13:25:32 +00:00
Alexey Milovidov
23eca8220b Fix test 2023-11-06 05:53:16 +01:00
Alexey Milovidov
4a10b3eff8 Remove trash (C++ templates) 2023-11-06 05:19:40 +01:00
Alexey Milovidov
19f178f0a8 Fix style 2023-11-06 04:56:51 +01:00