mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
23 lines
531 B
C++
23 lines
531 B
C++
#include <AggregateFunctions/QuantileTDigest.h>
|
|
#include <IO/WriteBufferFromString.h>
|
|
#include <IO/ReadBufferFromString.h>
|
|
|
|
int main(int, char **)
|
|
{
|
|
using namespace DB;
|
|
|
|
QuantileTDigest<float> tdigest;
|
|
tdigest.add(1);
|
|
tdigest.add(2);
|
|
tdigest.add(3);
|
|
std::cout << tdigest.get(0.5) << "\n";
|
|
WriteBufferFromOwnString wb;
|
|
tdigest.serialize(wb);
|
|
QuantileTDigest<float> other;
|
|
ReadBufferFromString rb{wb.str()};
|
|
other.deserialize(rb);
|
|
std::cout << other.get(0.5) << "\n";
|
|
|
|
return 0;
|
|
}
|