Commit Graph

735 Commits

Author SHA1 Message Date
Amos Bird
3707da4fbf
Better addBatchArray aggregator 2019-11-11 16:56:11 +08:00
alexey-milovidov
1d910c5071
Merge pull request #7608 from amosbird/batchreduce
Optimize arrayReduce, -Array and -State combinators
2019-11-10 22:10:03 +03:00
Amos Bird
544af39d23
Vectorize arrayReduce and -Array combinator
Also devirtualize -State combinator.
2019-11-07 11:53:47 +08:00
Alexander Kuzmenkov
233212ac68
Merge pull request #7531 from amosbird/getkeymapped
Unify hash tables interface (separated for review)
2019-11-06 13:49:39 +03:00
Amos Bird
fbfbe161ec
Unify hash tables interface. 2019-11-06 00:08:04 +08:00
alexey-milovidov
c081c8aacb
Update AggregateFunctionGroupBitmapData.h 2019-11-05 01:59:02 +03:00
Zhichang Yu
da2d05802c added bitmapTransform 2019-11-04 14:55:31 +08:00
alexey-milovidov
fa0274e223
Merge pull request #7380 from hczhcz/patch-1018
Add function arrayFill and arrayReverseFill
2019-11-03 01:06:41 +03:00
Nikolai Kochetov
a80338e066 Merged with master 2019-10-31 14:41:29 +03:00
Alexey Milovidov
fe73354320 Improvements after #7510 2019-10-30 22:15:55 +03:00
hcz
3767cb76de Improve style 2019-10-25 11:25:02 +08:00
Artem Zuikov
bb1c1d0ed9
Merge pull request #7431 from arenadata/master
fix aggregation (avg and quantiles) over empty decimal columns.
2019-10-23 20:28:35 +03:00
akonyaev
7426542b8b up precision for avg result to max of type 2019-10-23 11:22:51 +03:00
akonyaev
71dd3a303e fix result type for avg aggregation 2019-10-22 18:31:56 +03:00
Nikolai Kochetov
640da3f512 Try to fix AggregateFunctionGroupBitmap. 2019-10-22 16:59:13 +03:00
akonyaev
6655eb6358 fix 2019-10-22 15:34:36 +03:00
akonyaev
f6bb52637d return for empty avg result over decimal 0 in ResultT type 2019-10-21 16:05:32 +03:00
akonyaev
28710b7e42 unexpected behaviour for avg and quantile functions over empty decimal column without group by 2019-10-21 15:46:47 +03:00
hcz
502672c973 Add aggregate function combinators: -OrNull & -OrDefault (#7331) 2019-10-18 12:25:39 +03:00
akonyaev
22429a699e unexpected behaviour for avg over empty decimal column without group by 2019-10-17 16:08:04 +03:00
alexey-milovidov
323a756115
Merge pull request #7298 from Vdimir/feature/count-arity-validation-7095
Add missing arity validation for count/counIf
2019-10-14 08:52:58 +03:00
VDimir
7adad4251f Remove AggregateFunctionCountNotNullVariadic 2019-10-13 18:42:39 +00:00
VDimir
99f531c58f Fix spelling require -> requires 2019-10-13 18:37:01 +00:00
VDimir
853322503f Allow count function arity at most one 2019-10-12 15:15:16 +00:00
Nikolai Kochetov
6f758babf6
Merge pull request #7289 from infinivision/fix_pull_7109
Fixed #7109 groupBitmapOr(31) segfault
2019-10-12 16:42:11 +03:00
Zhichang Yu
679db35ed3 Fixed #7109 groupBitmapOr(31) segfault 2019-10-12 10:36:52 +08:00
Alexander Kuzmenkov
57b5592236 Work around garbage in roaring.h to fix Mac OS build. 2019-10-11 14:28:16 +03:00
alexey-milovidov
689411abe0
Merge pull request #7222 from azat/uniqCombined64
[RFC] Introduce uniqCombined64() to get sane results for cardinality > UINT_MAX
2019-10-09 20:29:56 +03:00
alexey-milovidov
6cd3e9a458
Update AggregateFunctionUniqCombined.h 2019-10-09 20:26:01 +03:00
alexey-milovidov
81a9c81ba7
Merge pull request #7236 from azat/uniqCombined-memory-usage
Do not use more then 98K of memory for uniqCombined*
2019-10-09 20:19:30 +03:00
Azat Khuzhin
e373862c83 Do not use more then 98K of memory for uniqCombined*
uniqCombined() uses hashtable for medium cardinality, and since
HashTable resize by the power of 2 (well actually HashTableGrower grows
double by the power of 2, hence HashTableGrower::increaseSize() should
be overwritten to change this), with 1<<13 (default for uniqCombined)
and UInt64 HashValueType, the HashTable will takes:

  getBufferSizeInBytes() == 131072

While it should be not greater then sizeof(HLL) ~= 98K, so reduce the
maximum cardinality for hashtable to 1<<12 with UInt64 HashValueType and
to 1<13 with UInt32, overwrite HashTableGrower::increaseSize() and cover
this using max_memory_usage.

Refs: https://github.com/ClickHouse/ClickHouse/pull/7221#issuecomment-539672742

v2: cover uniqCombined() with non-default K
2019-10-09 02:39:23 +03:00
alexey-milovidov
4c1f0177b6
Merge pull request #7109 from infinivision/aggBitmapAnd
added groupBitmapAnd, groupBitmapOr, groupBitmapXor
2019-10-08 22:51:46 +03:00
Azat Khuzhin
f46c5a47c0 Introduce uniqCombined64() to get sane results for cardinality > UINT_MAX
By default uniqCombined() uses 32-bit hash for all types except String,
so this means that you cannot use uniqCombined() with i.e UInt64 and
cardinality > UINT_MAX, although you can use uniqCombined(toString())
and this will lead to 64-bit hash, but will not have good performance.

So uniqCombined64() had been introduced to fix this.

Requires: #7213
2019-10-08 21:59:35 +03:00
Alexander Kuzmenkov
2b30f2696c Include Field.h in less files. 2019-10-08 16:23:24 +03:00
Alexander Kuzmenkov
8e245d4e8c
Merge pull request #7135 from ClickHouse/aku/msan-field
Fix some MemorySanitizer warnings for Fields.
2019-10-03 10:33:44 +03:00
chertus
5df8f870c4 try remove some PVS errors 2019-09-30 18:45:53 +03:00
Alexander Kuzmenkov
ec2d9a083c Remove excessive includes. 2019-09-30 15:31:14 +03:00
Zhichang Yu
8945714c27 added groupBitmapAnd, groupBitmapOr, groupBitmapXor 2019-09-27 10:21:07 +08:00
Alexander Kuzmenkov
f3bde19b74 Do not use iterators in find() and emplace() methods of hash tables.
Instead, these methods return a pointer to the required data as they are
stored inside the hash table. The caller uses overloaded functions to
get the key and "mapped" values from this pointer. Such an interface
avoids the need for constructing iterator-like wrapper objects, which is
especially important for compound hash tables such as the future
StringHashMap.
2019-09-24 17:44:35 +03:00
alexey-milovidov
6020ba187e
Update AggregateFunctionGroupBitmapData.h 2019-09-22 04:58:21 +03:00
Zhichang Yu
0dc3866c36 added bitmapSubsetLimit 2019-09-19 10:15:36 +08:00
alexey-milovidov
1327e71d80
Changed C-style cast to constructor-style cast. 2019-09-19 02:01:06 +03:00
Zhichang Yu
460ccb04a2 added bitmapMin and bitmapMax 2019-09-18 16:56:12 +08:00
Nikolai Kochetov
1319168a3a Merge branch 'master' into processors-2 2019-09-12 16:28:51 +03:00
alexey-milovidov
a14b3c7fcb
Merge pull request #6908 from infinivision/fix_6880
use croaring serialization functions
2019-09-12 03:21:05 +03:00
Nikolai Kochetov
d913e415b8 Fix Adam::merge if right state wasn't initialized. 2019-09-11 20:48:42 +03:00
Zhichang Yu
6c5019ca39 use croaring serialization functions 2019-09-11 12:35:43 +00:00
Amos Bird
a1310ffbe6 Split libdbms.so using object library
Now the linking time of incremental builds are around 1-2 seconds
2019-09-11 01:56:01 +08:00
Alexander Kuzmenkov
cacf6d3282 Key memory management for compound hash tables.
Some aggregation methods initially emplace a temporary StringRef key
into a hash table. Then, if the key was not seen before, they make a
persistent copy of the key and update the hash table with it. This
approach is not suitable for compound hash tables, because the logic of
when the persistent key is needed is more complex, and is contained
within the hash table itself.

In this commit, we switch to managing key memory with callbacks passed
to the hash table, that allow it to request a persistent copy of the key
if it is needed. This should be more appropriate for compound hash
tables.

This commit prepares for StringHashMap PR #5417.
2019-09-06 18:05:28 +03:00
Alexander Kuzmenkov
24a8755b82 Formatting changes for StringHashMap PR #5417. 2019-08-28 13:52:14 +03:00