ClickHouse/dbms/AggregateFunctions/tests/quantile-t-digest.cpp
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

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;
}