This function is strange. Looks like the implementation is of low quality.

```
bool isDeterministic() const override { return false; }
bool isDeterministicInScopeOfQuery() const override { return false; }
```
Why it is not deterministic? Missing a comment.

```
String convertToJson(const PODArray<String> & variant_names, const Variants & variants)
{
    FormatSettings settings;

    WriteBufferFromOwnString buf;

    writeCString("{\"data\":[", buf);
    for (size_t i = 0; i < variants.size(); ++i)
    {
        writeCString("{\"variant_name\":", buf);
        writeJSONString(variant_names[i], buf, settings);
        writeCString(",\"x\":", buf);
        writeText(variants[i].x, buf);
        writeCString(",\"y\":", buf);
        writeText(variants[i].y, buf);
        writeCString(",\"beats_control\":", buf);
        writeText(variants[i].beats_control, buf);
        writeCString(",\"to_be_best\":", buf);
        writeText(variants[i].best, buf);
        writeCString("}", buf);
        if (i != variant_names.size() -1)
            writeCString(",", buf);
    }
    writeCString("]}", buf);

    return buf.str();
}
```
It returns unstructured data? :scream: 

As first step we can remove documentation for this function.
CC @nikitamikhaylov 
#include <Functions/abtesting.h>
#if !defined(ARCADIA_BUILD) && USE_STATS
#    include <gtest/gtest.h>
using namespace DB;
Variants test_bayesab(std::string dist, PODArray<Float64> xs, PODArray<Float64> ys, size_t & max, size_t & min)
{
    Variants variants;
    
    if (dist == "beta")
    {
/*        std::cout << dist << "\nclicks: ";
        for (auto x : xs)
            std::cout << x << " ";
        std::cout <<"\tconversions: ";
        for (auto y : ys)
            std::cout << y << " ";
        std::cout << "\n";*/
        variants = bayesian_ab_test<true>(dist, xs, ys);
    }
    else if (dist == "gamma")
    {
/*        std::cout << dist << "\nclicks: ";
        for (auto x : xs)