From 61bb3b8ade824472846847bf52a28bc8931fe9f7 Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Wed, 23 Jan 2019 00:07:05 +0300 Subject: [PATCH 001/194] simple linear regression --- .../AggregateFunctionMLMethod.cpp | 40 ++++ .../AggregateFunctionMLMethod.h | 180 ++++++++++++++++++ .../registerAggregateFunctions.cpp | 2 + dbms/src/Columns/ColumnAggregateFunction.cpp | 30 +++ dbms/src/Columns/ColumnAggregateFunction.h | 3 + dbms/src/Functions/evalMLMethod.cpp | 95 +++++++++ .../registerFunctionsMiscellaneous.cpp | 2 + .../0_stateless/00900_mytest.reference | 1 + .../queries/0_stateless/00900_mytest.sql | 48 +++++ 9 files changed, 401 insertions(+) create mode 100644 dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp create mode 100644 dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h create mode 100644 dbms/src/Functions/evalMLMethod.cpp create mode 100644 dbms/tests/queries/0_stateless/00900_mytest.reference create mode 100644 dbms/tests/queries/0_stateless/00900_mytest.sql diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp new file mode 100644 index 00000000000..43b342fb7ac --- /dev/null +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -0,0 +1,40 @@ +#include +#include +#include +#include + + +namespace DB +{ + + namespace + { + + using FuncLinearRegression = AggregateFunctionMLMethod; + + template + AggregateFunctionPtr createAggregateFunctionMLMethod( + const std::string & name, const DataTypes & arguments, const Array & parameters) + { + if (parameters.size() > 1) + throw Exception("Aggregate function " + name + " requires at most one parameter", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + + Float64 lr; + if (parameters.empty()) + lr = Float64(0.01); + else + lr = static_cast(parameters[0].template get()); + + if (arguments.size() < 2) + throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + + return std::make_shared(arguments.size() - 1, lr); + } + + } + + void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory) { + factory.registerFunction("LinearRegression", createAggregateFunctionMLMethod); + } + +} \ No newline at end of file diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h new file mode 100644 index 00000000000..1e45303b454 --- /dev/null +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -0,0 +1,180 @@ +#pragma once + +#include + +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + + +namespace DB { + +struct LinearRegressionData { + Float64 bias{0.0}; + std::vector w1; + Float64 learning_rate{0.01}; + UInt32 iter_num = 0; + UInt32 param_num = 0; + + + void add(Float64 target, std::vector& feature, Float64 learning_rate_, UInt32 param_num_) { + if (w1.empty()) { + learning_rate = learning_rate_; + param_num = param_num_; + w1.resize(param_num); + } + + Float64 derivative = (target - bias); + for (size_t i = 0; i < param_num; ++i) + { + derivative -= w1[i] * feature[i]; + } + derivative *= (2 * learning_rate); + + bias += derivative; + for (size_t i = 0; i < param_num; ++i) + { + w1[i] += derivative * feature[i]; + } + + ++iter_num; + } + + void merge(const LinearRegressionData & rhs) { + if (iter_num == 0 && rhs.iter_num == 0) + throw std::runtime_error("Strange..."); + + if (param_num == 0) { + param_num = rhs.param_num; + w1.resize(param_num); + } + + Float64 frac = static_cast(iter_num) / (iter_num + rhs.iter_num); + Float64 rhs_frac = static_cast(rhs.iter_num) / (iter_num + rhs.iter_num); + + for (size_t i = 0; i < param_num; ++i) + { + w1[i] = w1[i] * frac + rhs.w1[i] * rhs_frac; + } + + bias = bias * frac + rhs.bias * rhs_frac; + iter_num += rhs.iter_num; + } + + void write(WriteBuffer & buf) const { + writeBinary(bias, buf); + writeBinary(w1, buf); + writeBinary(iter_num, buf); + } + + void read(ReadBuffer & buf) { + readBinary(bias, buf); + readBinary(w1, buf); + readBinary(iter_num, buf); + } + Float64 predict(std::vector& predict_feature) const { + Float64 res{0.0}; + for (size_t i = 0; i < static_cast(param_num); ++i) + { + res += predict_feature[i] * w1[i]; + } + res += bias; + + return res; + } +}; + +template < + /// Implemented Machine Learning method + typename Data, + /// Name of the method + typename Name +> +class AggregateFunctionMLMethod final : public IAggregateFunctionDataHelper> +{ +public: + String getName() const override { return Name::name; } + + explicit AggregateFunctionMLMethod(UInt32 param_num, Float64 learning_rate) + : param_num(param_num), learning_rate(learning_rate) + { + } + + DataTypePtr getReturnType() const override + { + return std::make_shared>(); + } + + void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override + { + const auto & target = static_cast &>(*columns[0]); + + std::vector x(param_num); + for (size_t i = 0; i < param_num; ++i) + { + x[i] = static_cast &>(*columns[i + 1]).getData()[row_num]; + } + + this->data(place).add(target.getData()[row_num], x, learning_rate, param_num); + + } + + void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override + { + this->data(place).merge(this->data(rhs)); + } + + void serialize(ConstAggregateDataPtr place, WriteBuffer & buf) const override + { + this->data(place).write(buf); + } + + void deserialize(AggregateDataPtr place, ReadBuffer & buf, Arena *) const override + { + this->data(place).read(buf); + } + + void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, size_t row_num, const ColumnNumbers & arguments) const + { + auto &column = dynamic_cast &>(to); + + std::vector predict_features(arguments.size() - 1); +// for (size_t row_num = 0, rows = block.rows(); row_num < rows; ++row_num) { + for (size_t i = 1; i < arguments.size(); ++i) { +// predict_features[i] = array_elements[i].get(); + predict_features[i - 1] = applyVisitor(FieldVisitorConvertToNumber(), (*block.getByPosition(arguments[i]).column)[row_num]); + } +// column.getData().push_back(this->data(place).predict(predict_features)); + column.getData().push_back(this->data(place).predict(predict_features)); +// } + } + + void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override { + auto &column = dynamic_cast &>(to); + std::ignore = column; + std::ignore = place; + } + + const char * getHeaderFilePath() const override { return __FILE__; } + +private: + UInt32 param_num; + Float64 learning_rate; +}; + +struct NameLinearRegression { static constexpr auto name = "LinearRegression"; }; + +} \ No newline at end of file diff --git a/dbms/src/AggregateFunctions/registerAggregateFunctions.cpp b/dbms/src/AggregateFunctions/registerAggregateFunctions.cpp index f5e15b6a887..fefcee3301b 100644 --- a/dbms/src/AggregateFunctions/registerAggregateFunctions.cpp +++ b/dbms/src/AggregateFunctions/registerAggregateFunctions.cpp @@ -27,6 +27,7 @@ void registerAggregateFunctionUniqUpTo(AggregateFunctionFactory &); void registerAggregateFunctionTopK(AggregateFunctionFactory &); void registerAggregateFunctionsBitwise(AggregateFunctionFactory &); void registerAggregateFunctionsMaxIntersections(AggregateFunctionFactory &); +void registerAggregateFunctionMLMethod(AggregateFunctionFactory &); void registerAggregateFunctionCombinatorIf(AggregateFunctionCombinatorFactory &); void registerAggregateFunctionCombinatorArray(AggregateFunctionCombinatorFactory &); @@ -65,6 +66,7 @@ void registerAggregateFunctions() registerAggregateFunctionsMaxIntersections(factory); registerAggregateFunctionHistogram(factory); registerAggregateFunctionRetention(factory); + registerAggregateFunctionMLMethod(factory); } { diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 7d3e001998a..a2e03401824 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace DB { @@ -80,6 +81,35 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const return res; } +//MutableColumnPtr ColumnAggregateFunction::predictValues(std::vector predict_feature) const +MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const ColumnNumbers & arguments) const +{ + if (const AggregateFunctionState * function_state = typeid_cast(func.get())) + { + auto res = createView(); + res->set(function_state->getNestedFunction()); + res->data.assign(data.begin(), data.end()); + return res; + } + + MutableColumnPtr res = func->getReturnType()->createColumn(); + res->reserve(data.size()); + +// const AggregateFunctionMLMethod * ML_function = typeid_cast(func.get()); + auto ML_function = typeid_cast *>(func.get()); + if (ML_function) + { + size_t row_num = 0; + for (auto val : data) { + ML_function->predictResultInto(val, *res, block, row_num, arguments); + ++row_num; + } + } else { + + } + + return res; +} void ColumnAggregateFunction::ensureOwnership() { diff --git a/dbms/src/Columns/ColumnAggregateFunction.h b/dbms/src/Columns/ColumnAggregateFunction.h index cd352007095..b4cb611dccb 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.h +++ b/dbms/src/Columns/ColumnAggregateFunction.h @@ -10,6 +10,7 @@ #include #include +#include namespace DB { @@ -115,6 +116,8 @@ public: std::string getName() const override { return "AggregateFunction(" + func->getName() + ")"; } const char * getFamilyName() const override { return "AggregateFunction"; } + MutableColumnPtr predictValues(Block & block, const ColumnNumbers & arguments) const; + size_t size() const override { return getData().size(); diff --git a/dbms/src/Functions/evalMLMethod.cpp b/dbms/src/Functions/evalMLMethod.cpp new file mode 100644 index 00000000000..c31c9227782 --- /dev/null +++ b/dbms/src/Functions/evalMLMethod.cpp @@ -0,0 +1,95 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +namespace DB +{ + + namespace ErrorCodes + { + extern const int ILLEGAL_COLUMN; + extern const int ILLEGAL_TYPE_OF_ARGUMENT; + } + + +/** finalizeAggregation(agg_state) - get the result from the aggregation state. +* Takes state of aggregate function. Returns result of aggregation (finalized state). +*/ + class FunctionEvalMLMethod : public IFunction + { + public: + static constexpr auto name = "evalMLMethod"; + static FunctionPtr create(const Context &) + { + return std::make_shared(); + } + + String getName() const override + { + return name; + } + + bool isVariadic() const override { + return true; + } + size_t getNumberOfArguments() const override + { + return 0; + } + + DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override + { + const DataTypeAggregateFunction * type = checkAndGetDataType(arguments[0].get()); + if (!type) + throw Exception("Argument for function " + getName() + " must have type AggregateFunction - state of aggregate function.", + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + + return type->getReturnType(); + } + + void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override + { + const ColumnAggregateFunction * column_with_states + = typeid_cast(&*block.getByPosition(arguments.at(0)).column); + if (!column_with_states) + throw Exception("Illegal column " + block.getByPosition(arguments.at(0)).column->getName() + + " of first argument of function " + + getName(), + ErrorCodes::ILLEGAL_COLUMN); + +// const ColumnArray * col_array = checkAndGetColumnConstData(block.getByPosition(arguments[1]).column.get()); +// if (!col_array) +// throw std::runtime_error("wtf"); + +// const IColumn & array_elements = col_array->getData(); + +/* + std::vector predict_features(arguments.size()); + for (size_t i = 1; i < arguments.size(); ++i) + { +// predict_features[i] = array_elements[i].get(); + predict_features[i - 1] = typeid_cast(block.getByPosition(arguments[i]).column.get())->getValue(); + } + block.getByPosition(result).column = column_with_states->predictValues(predict_features); +*/ + block.getByPosition(result).column = column_with_states->predictValues(block, arguments); + } + + }; + + void registerFunctionEvalMLMethod(FunctionFactory & factory) + { + factory.registerFunction(); + } + +} \ No newline at end of file diff --git a/dbms/src/Functions/registerFunctionsMiscellaneous.cpp b/dbms/src/Functions/registerFunctionsMiscellaneous.cpp index d985fb6bf97..718a4b5d459 100644 --- a/dbms/src/Functions/registerFunctionsMiscellaneous.cpp +++ b/dbms/src/Functions/registerFunctionsMiscellaneous.cpp @@ -42,6 +42,7 @@ void registerFunctionLowCardinalityKeys(FunctionFactory &); void registerFunctionsIn(FunctionFactory &); void registerFunctionJoinGet(FunctionFactory &); void registerFunctionFilesystem(FunctionFactory &); +void registerFunctionEvalMLMethod(FunctionFactory &); void registerFunctionsMiscellaneous(FunctionFactory & factory) { @@ -84,6 +85,7 @@ void registerFunctionsMiscellaneous(FunctionFactory & factory) registerFunctionsIn(factory); registerFunctionJoinGet(factory); registerFunctionFilesystem(factory); + registerFunctionEvalMLMethod(factory); } } diff --git a/dbms/tests/queries/0_stateless/00900_mytest.reference b/dbms/tests/queries/0_stateless/00900_mytest.reference new file mode 100644 index 00000000000..8a3290dd346 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00900_mytest.reference @@ -0,0 +1 @@ +66.80107268499746 \ No newline at end of file diff --git a/dbms/tests/queries/0_stateless/00900_mytest.sql b/dbms/tests/queries/0_stateless/00900_mytest.sql new file mode 100644 index 00000000000..b920a4b3b0b --- /dev/null +++ b/dbms/tests/queries/0_stateless/00900_mytest.sql @@ -0,0 +1,48 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults +( + param1 Float64, + param2 Float64, + target Float64, + predict1 Float64, + predict2 Float64 +) ENGINE = Memory; +-- -- insert into test.defaults values (2.533, 0.543, 3.181), (1.999, 1.765, 0.470), (0.631, 2.580, -1.845), (-1.164, 0.889, 0.640), (2.110, 0.768, 2.519), (1.251, 0.483, 2.659), (-3.958, 1.299, -1.576), (-2.152, -1.316, 4.556), (3.269, 1.441, 1.753), (4.206, -1.635, 8.373), (-3.479, -0.544, 2.349), (4.006, 0.167, 4.670), (-4.478, 2.400, -4.039), (1.856, 0.256, 3.417), (1.470, 1.685, 0.366), (-4.052, 2.326, -3.678), (-0.971, -0.969, 4.453), (0.881, -1.848, 7.137), (-1.551, -1.766, 5.756), (-0.988, -0.945, 4.395), (-4.636, 1.074, -1.466), (-4.074, -1.486, 3.934), (0.754, 2.627, -1.877), (1.035, 0.889, 1.738), (3.707, -1.281, 7.415), (-2.215, 1.110, -0.327), (-2.965, -1.316, 4.150), (-3.581, 1.063, -0.917), (0.548, 0.343, 2.588), (3.023, -0.870, 6.251), (4.053, -1.441, 7.909), (-0.750, 0.639, 1.348), (-4.411, 1.636, -2.477), (1.786, 0.398, 3.096), (-2.514, 0.033, 1.676), (4.935, -0.840, 7.148), (1.075, -0.921, 5.380), (-3.418, 2.177, -3.063), (3.122, 1.883, 0.795), (-2.254, -1.389, 4.650), (-4.603, 2.909, -5.119), (-1.886, -1.220, 4.497), (-0.509, -1.498, 5.741), (2.192, 1.882, 0.332), (4.056, -1.108, 7.244), (-1.918, 0.230, 1.581), (4.867, 1.516, 2.401), (-0.993, -0.011, 2.526), (-0.757, -1.192, 5.006), (-4.161, 2.059, -3.198), (2.258, 1.157, 1.814), (-3.878, -0.052, 1.165), (1.915, 2.998, -2.038), (-2.164, 2.379, -2.841), (-0.114, -1.914, 6.772), (3.812, 2.138, 0.630), (-1.863, 1.508, -0.947), (-2.964, 0.398, 0.722), (-2.046, -0.193, 2.363), (-1.525, -0.836, 3.910), (-4.557, -0.582, 1.886), (1.031, -0.461, 4.437), (-0.802, 0.699, 1.201), (3.982, 2.084, 0.824), (-2.243, 2.726, -3.573), (-3.989, -0.803, 2.611), (4.900, 0.253, 4.944), (-1.208, -1.587, 5.571), (0.370, 2.579, -1.972), (2.824, 0.964, 2.484), (-1.290, -0.128, 2.611), (0.190, 2.058, -1.021), (4.058, 2.122, 0.784), (4.879, 0.945, 3.549), (1.119, 1.992, -0.424), (4.050, 2.005, 1.015), (-0.064, 1.485, -0.002), (-2.496, 0.456, 0.840), (-1.835, 1.586, -1.090), (0.603, 1.856, -0.411), (-3.062, -0.966, 3.401), (-3.351, 0.430, 0.465), (-2.724, -1.331, 4.299), (3.291, -1.027, 6.699), (-4.263, 0.785, -0.701), (-3.289, -0.886, 3.128), (4.627, 1.331, 2.651), (-0.618, 0.602, 1.486), (0.056, 1.778, -0.528), (4.823, 1.154, 3.103), (-3.983, 0.509, -0.010), (-4.474, -1.400, 3.563), (-3.782, 2.996, -4.883), (4.515, -0.656, 6.569), (1.269, 2.592, -1.549), (-1.710, -0.241, 2.627), (2.171, 1.453, 1.180), (-1.931, -1.845, 5.726), (1.767, -1.798, 7.480), (4.352, 2.369, 0.438), (-4.498, 2.611, -4.472), (0.067, 0.517, 2.000), (4.151, 0.624, 3.827), (0.409, -0.969, 5.142), (0.193, -1.713, 6.522), (-2.487, 2.827, -3.898), (-4.363, 2.011, -3.203), (-2.383, 2.554, -3.299), (-4.457, -0.958, 2.687), (3.342, -0.360, 5.392), (0.902, 2.978, -2.505), (4.073, -1.524, 8.084), (3.036, 1.672, 1.173), (2.169, -0.564, 5.213), (-4.780, 0.962, -1.313), (-1.815, 2.096, -2.100), (-1.445, 0.458, 1.362), (1.891, -1.437, 6.820), (1.942, -1.761, 7.493), (-4.613, -1.551, 3.795), (-3.472, -1.110, 3.485), (-2.026, 1.961, -1.935), (0.091, -0.961, 4.967), (3.902, -1.336, 7.622), (-3.483, -0.769, 2.796), (-0.066, -1.233, 5.433), (2.597, 2.789, -1.280), (-1.657, -1.842, 5.856), (0.232, -1.420, 5.957), (-3.321, 1.609, -1.879), (2.673, 2.781, -1.226), (0.869, 0.072, 3.291), (1.444, -1.271, 6.264), (1.190, 1.460, 0.675), (3.497, 0.870, 3.008), (-2.884, -1.303, 4.163), (3.620, 0.381, 4.047), (2.594, 0.247, 3.803), (-3.902, -1.315, 3.678), (-4.753, -1.005, 2.634), (0.881, 0.675, 2.091), (0.414, 2.071, -0.935), (3.458, -0.920, 6.568), (-2.986, -0.411, 2.329), (3.076, -1.960, 8.458), (2.951, 2.988, -1.501), (2.408, 1.301, 1.603), (4.725, 0.366, 4.631), (4.924, -1.762, 8.985), (3.719, 0.970, 2.920), (-0.295, 0.257, 2.340), (-4.607, 2.548, -4.400), (0.288, 1.953, -0.761), (-3.311, 0.844, -0.344), (3.679, -0.642, 6.123), (-2.310, -0.838, 3.522), (-4.397, -0.226, 1.254), (-4.366, -0.024, 0.864), (2.405, 1.458, 1.286), (-4.296, -1.071, 2.994), (0.452, -1.901, 7.028), (-0.214, -0.467, 3.827), (2.559, 1.547, 1.185), (0.990, 1.539, 0.417), (0.478, -0.089, 3.417), (-2.734, -1.007, 3.646), (3.483, 0.247, 4.247), (3.507, 2.727, -0.701), (-4.399, 2.437, -4.073), (3.785, 0.036, 4.820), (-0.824, 2.417, -2.245), (-2.588, 0.369, 0.968), (-3.037, -1.639, 4.759), (4.531, -0.499, 6.264), (4.742, -1.161, 7.693), (-0.063, -0.595, 4.159), (0.697, 2.281, -1.212), (0.413, 0.607, 1.992), (-4.081, 0.383, 0.194), (0.712, 2.638, -1.920), (-1.620, 1.092, 0.006), (-3.425, -0.911, 3.109), (-0.124, 1.711, -0.484), (4.347, 1.387, 2.399), (-3.237, -0.900, 3.182), (-3.961, 0.358, 0.304), (4.326, -0.068, 5.298), (3.846, 1.725, 1.473), (-2.089, 0.953, 0.049), (-1.025, -1.470, 5.428), (2.061, -0.156, 4.343), (1.547, -1.827, 7.427), (2.786, 0.460, 3.473), (0.076, 0.659, 1.720), (3.597, 1.966, 0.866), (-0.933, -1.180, 4.894), (4.647, 1.190, 2.943), (-0.032, 0.544, 1.896), (4.461, -1.806, 8.843), (-0.586, 1.821, -0.934), (3.725, 1.715, 1.432), (-2.091, 2.714, -3.474), (4.494, -1.494, 8.236), (3.766, -0.209, 5.301), (-1.991, 1.776, -1.548), (-4.992, -0.742, 1.989), (-2.400, 1.828, -1.855), (-1.329, 0.143, 2.050), (1.954, 1.759, 0.459), (-4.422, 1.507, -2.224), (-2.243, -1.126, 4.131), (4.417, -1.080, 7.368), (1.737, -1.144, 6.157), (2.661, -1.084, 6.498), (-3.198, 0.443, 0.515), (4.191, -1.250, 7.596), (-2.419, -0.163, 2.116), (1.910, -1.173, 6.301), (-0.241, 1.902, -0.925), (-4.415, 2.479, -4.165), (3.307, -0.465, 5.583), (-2.382, 1.364, -0.920), (-3.154, 2.953, -4.483), (-2.562, 2.803, -3.888), (3.076, 0.195, 4.149), (-0.101, 0.896, 1.157), (-2.067, 1.120, -0.273), (-4.680, 2.756, -4.851), (-4.283, -0.607, 2.072), (4.013, -1.072, 7.150), (-4.401, -0.896, 2.591), (4.544, 2.498, 0.276), (4.075, -1.204, 7.445), (-3.463, 1.242, -1.216), (3.992, 2.782, -0.568), (-4.503, 0.239, 0.270), (-3.095, 1.161, -0.870), (0.768, -0.904, 5.192), (1.255, 2.870, -2.112), (-1.537, -0.049, 2.330), (2.851, -1.182, 6.789), (1.974, -0.922, 5.832), (4.447, 2.719, -0.214), (-3.413, 0.555, 0.184), (4.943, 2.120, 1.231), (3.645, -0.413, 5.648), (-4.776, 0.079, 0.453), (1.991, 1.565, 0.866), (2.413, 1.793, 0.620), (4.245, 2.663, -0.205), (-2.022, -1.180, 4.350), (-2.285, -1.246, 4.350), (2.276, 0.488, 3.162), (2.582, -0.037, 4.365), (-4.875, 1.468, -2.374), (-2.492, 2.730, -3.706), (2.696, -1.833, 8.013), (4.618, -1.127, 7.563), (-4.156, 0.987, -1.053), (1.873, -1.566, 7.068), (1.699, 0.794, 2.262), (-3.181, 1.640, -1.871), (-3.225, 1.526, -1.664), (-2.679, -1.811, 5.281), (3.717, 1.532, 1.794), (1.288, -0.999, 5.642), (-1.057, 0.044, 2.384), (-0.147, 1.108, 0.711), (-3.827, -1.139, 3.365), (0.872, -1.482, 6.399), (1.982, 0.286, 3.418), (-1.381, 2.374, -2.439), (-1.091, 2.010, -1.565), (-1.192, 2.751, -3.097), (1.468, -0.992, 5.718), (2.249, 0.949, 2.228), (3.064, 0.911, 2.711), (-1.576, -1.584, 5.380), (2.130, -1.489, 7.043), (4.386, -1.284, 7.761), (1.662, -1.645, 7.121), (-3.395, 1.784, -2.265), (4.618, 1.951, 1.406), (-0.299, 0.378, 2.095), (-2.911, 2.131, -2.717), (0.876, 2.869, -2.301), (-1.785, 0.961, 0.186), (-4.188, 2.442, -3.977), (-1.128, 0.127, 2.181), (1.755, -1.215, 6.307), (-2.276, 0.596, 0.669), (-4.630, 1.978, -3.272), (-0.454, 0.275, 2.224), (-1.950, -1.385, 4.794), (-0.889, 2.696, -2.837), (-4.832, -0.038, 0.661), (3.738, 0.604, 3.662), (-0.224, -0.465, 3.819); +insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +-- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +-- +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LinearRegressionState(0.01)(target, param1, param2) as state from test.defaults; +-- -- select toTypeName(state) from test.model; +-- -- +-- -- DROP TABLE IF EXISTS test.tests; +-- -- CREATE TABLE IF NOT EXISTS test.tests +-- -- ( +-- -- predict1 Float64, +-- -- predict2 Float64, +-- -- state1 AggregateFunction(LinReg(0.01), Float64, Float64, Float64) +-- -- ) ENGINE = Memory; +-- -- insert into test.tests select 20.0, 40.0, LinRegState(0.01)(target, param1, param2) from test.defaults; +-- -- select evalLinReg(state1, predict1, predict2) from test.tests; +-- +-- +-- +-- -- DROP TABLE IF EXISTS test.prediction; +-- -- CREATE TABLE IF NOT EXISTS test.prediction +-- -- ( +-- -- predict1 Float64, +-- -- predict2 Float64 +-- -- ) ENGINE = Memory; +-- +-- +-- -- insert into test.prediction values (20.0, 40.0); +-- +-- -- select multiply(param1, param2) from test.defaults; +-- +-- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; +select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; +-- -- select evalLinReg(state, predict1, predict2) from test.model inner join (select * from test.tests) using state; +-- -- select evalLinReg(state1, predict1, predict2) from test.tests; +-- +-- -- select negate(target) from test.defaults; \ No newline at end of file From 19ca2f3af848956cd2e486bfa94c68b60b8c4464 Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Wed, 23 Jan 2019 01:18:07 +0300 Subject: [PATCH 002/194] linear regression --- dbms/src/Columns/ColumnAggregateFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index a2e03401824..5a0d079efd6 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include namespace DB { From fd8f9c4fba2c76fc9365cffca50782a580e3f45a Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Wed, 23 Jan 2019 04:29:53 +0300 Subject: [PATCH 003/194] changes after review --- .../AggregateFunctionMLMethod.cpp | 61 +++++----- .../AggregateFunctionMLMethod.h | 104 ++++++++++-------- .../AggregateFunctions/IAggregateFunction.h | 2 +- dbms/src/Columns/ColumnAggregateFunction.cpp | 61 +++++++--- dbms/src/Columns/ColumnAggregateFunction.h | 1 + dbms/src/Functions/evalMLMethod.cpp | 1 + 6 files changed, 141 insertions(+), 89 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 43b342fb7ac..7503a300a47 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -7,34 +7,45 @@ namespace DB { - namespace +namespace +{ + +using FuncLinearRegression = AggregateFunctionMLMethod; + +template +AggregateFunctionPtr createAggregateFunctionMLMethod( + const std::string & name, const DataTypes & argument_types, const Array & parameters) +{ + if (parameters.size() > 1) + throw Exception("Aggregate function " + name + " requires at most one parameter", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + + for (size_t i = 0; i < argument_types.size(); ++i) { - - using FuncLinearRegression = AggregateFunctionMLMethod; - - template - AggregateFunctionPtr createAggregateFunctionMLMethod( - const std::string & name, const DataTypes & arguments, const Array & parameters) - { - if (parameters.size() > 1) - throw Exception("Aggregate function " + name + " requires at most one parameter", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); - - Float64 lr; - if (parameters.empty()) - lr = Float64(0.01); - else - lr = static_cast(parameters[0].template get()); - - if (arguments.size() < 2) - throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); - - return std::make_shared(arguments.size() - 1, lr); - } - + if (!WhichDataType(argument_types[i]).isFloat64()) + throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " + + std::to_string(i) + "for aggregate function " + name, + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } - void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory) { - factory.registerFunction("LinearRegression", createAggregateFunctionMLMethod); + Float64 learning_rate; + if (parameters.empty()) + { + learning_rate = Float64(0.01); + } else + { + learning_rate = applyVisitor(FieldVisitorConvertToNumber(), parameters[0]); } + if (argument_types.size() < 2) + throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + + return std::make_shared(argument_types.size() - 1, learning_rate); +} + +} + +void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory) { + factory.registerFunction("LinearRegression", createAggregateFunctionMLMethod); +} + } \ No newline at end of file diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 1e45303b454..cdb3c88261c 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -22,74 +22,82 @@ namespace DB { -struct LinearRegressionData { +namespace ErrorCodes +{ + extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; + extern const int BAD_ARGUMENTS; +} + + +struct LinearRegressionData +{ + LinearRegressionData() + {} + LinearRegressionData(Float64 learning_rate_, UInt32 param_num_) + : learning_rate(learning_rate_) { + weights.resize(param_num_); + } + Float64 bias{0.0}; - std::vector w1; - Float64 learning_rate{0.01}; + std::vector weights; + Float64 learning_rate; UInt32 iter_num = 0; - UInt32 param_num = 0; - - - void add(Float64 target, std::vector& feature, Float64 learning_rate_, UInt32 param_num_) { - if (w1.empty()) { - learning_rate = learning_rate_; - param_num = param_num_; - w1.resize(param_num); - } + void add(Float64 target, const IColumn ** columns, size_t row_num) + { Float64 derivative = (target - bias); - for (size_t i = 0; i < param_num; ++i) + for (size_t i = 0; i < weights.size(); ++i) { - derivative -= w1[i] * feature[i]; + derivative -= weights[i] * static_cast &>(*columns[i + 1]).getData()[row_num]; + } derivative *= (2 * learning_rate); bias += derivative; - for (size_t i = 0; i < param_num; ++i) + for (size_t i = 0; i < weights.size(); ++i) { - w1[i] += derivative * feature[i]; + weights[i] += derivative * static_cast &>(*columns[i + 1]).getData()[row_num];; } ++iter_num; } - void merge(const LinearRegressionData & rhs) { + void merge(const LinearRegressionData & rhs) + { if (iter_num == 0 && rhs.iter_num == 0) - throw std::runtime_error("Strange..."); - - if (param_num == 0) { - param_num = rhs.param_num; - w1.resize(param_num); - } + return; Float64 frac = static_cast(iter_num) / (iter_num + rhs.iter_num); Float64 rhs_frac = static_cast(rhs.iter_num) / (iter_num + rhs.iter_num); - for (size_t i = 0; i < param_num; ++i) + for (size_t i = 0; i < weights.size(); ++i) { - w1[i] = w1[i] * frac + rhs.w1[i] * rhs_frac; + weights[i] = weights[i] * frac + rhs.weights[i] * rhs_frac; } bias = bias * frac + rhs.bias * rhs_frac; iter_num += rhs.iter_num; } - void write(WriteBuffer & buf) const { + void write(WriteBuffer & buf) const + { writeBinary(bias, buf); - writeBinary(w1, buf); + writeBinary(weights, buf); writeBinary(iter_num, buf); } - void read(ReadBuffer & buf) { + void read(ReadBuffer & buf) + { readBinary(bias, buf); - readBinary(w1, buf); + readBinary(weights, buf); readBinary(iter_num, buf); } - Float64 predict(std::vector& predict_feature) const { + Float64 predict(const std::vector& predict_feature) const + { Float64 res{0.0}; - for (size_t i = 0; i < static_cast(param_num); ++i) + for (size_t i = 0; i < predict_feature.size(); ++i) { - res += predict_feature[i] * w1[i]; + res += predict_feature[i] * weights[i]; } res += bias; @@ -118,18 +126,16 @@ public: return std::make_shared>(); } + void create(AggregateDataPtr place) const override + { + new (place) Data(learning_rate, param_num); + } + void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override { const auto & target = static_cast &>(*columns[0]); - std::vector x(param_num); - for (size_t i = 0; i < param_num; ++i) - { - x[i] = static_cast &>(*columns[i + 1]).getData()[row_num]; - } - - this->data(place).add(target.getData()[row_num], x, learning_rate, param_num); - + this->data(place).add(target.getData()[row_num], columns, row_num); } void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override @@ -149,20 +155,26 @@ public: void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, size_t row_num, const ColumnNumbers & arguments) const { + if (arguments.size() != param_num + 1) + throw Exception("Predict got incorrect number of arguments. Got: " + std::to_string(arguments.size()) + ". Required: " + std::to_string(param_num + 1), + ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + auto &column = dynamic_cast &>(to); std::vector predict_features(arguments.size() - 1); -// for (size_t row_num = 0, rows = block.rows(); row_num < rows; ++row_num) { for (size_t i = 1; i < arguments.size(); ++i) { -// predict_features[i] = array_elements[i].get(); - predict_features[i - 1] = applyVisitor(FieldVisitorConvertToNumber(), (*block.getByPosition(arguments[i]).column)[row_num]); + const auto& element = (*block.getByPosition(arguments[i]).column)[row_num]; + if (element.getType() != Field::Types::Float64) + throw Exception("Prediction arguments must be values of type Float", + ErrorCodes::BAD_ARGUMENTS); + + predict_features[i - 1] = element.get(); } -// column.getData().push_back(this->data(place).predict(predict_features)); column.getData().push_back(this->data(place).predict(predict_features)); -// } } - void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override { + void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override + { auto &column = dynamic_cast &>(to); std::ignore = column; std::ignore = place; diff --git a/dbms/src/AggregateFunctions/IAggregateFunction.h b/dbms/src/AggregateFunctions/IAggregateFunction.h index 85de0e0c7ff..281c7cf4ee8 100644 --- a/dbms/src/AggregateFunctions/IAggregateFunction.h +++ b/dbms/src/AggregateFunctions/IAggregateFunction.h @@ -137,7 +137,7 @@ protected: static const Data & data(ConstAggregateDataPtr place) { return *reinterpret_cast(place); } public: - void create(AggregateDataPtr place) const override + virtual void create(AggregateDataPtr place) const override { new (place) Data; } diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 5a0d079efd6..8716da8fffa 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -17,6 +17,7 @@ namespace ErrorCodes { extern const int PARAMETER_OUT_OF_BOUND; extern const int SIZES_OF_COLUMNS_DOESNT_MATCH; + extern const int ILLEGAL_TYPE_OF_ARGUMENT; } @@ -32,6 +33,23 @@ void ColumnAggregateFunction::addArena(ArenaPtr arena_) arenas.push_back(arena_); } +bool ColumnAggregateFunction::convertion(MutableColumnPtr* res_) const +{ + if (const AggregateFunctionState * function_state = typeid_cast(func.get())) + { + auto res = createView(); + res->set(function_state->getNestedFunction()); + res->data.assign(data.begin(), data.end()); + *res_ = std::move(res); + return true; + } + + MutableColumnPtr res = func->getReturnType()->createColumn(); + res->reserve(data.size()); + *res_ = std::move(res); + return false; +} + MutableColumnPtr ColumnAggregateFunction::convertToValues() const { /** If the aggregate function returns an unfinalized/unfinished state, @@ -64,38 +82,46 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const * AggregateFunction(quantileTiming(0.5), UInt64) * into UInt16 - already finished result of `quantileTiming`. */ - if (const AggregateFunctionState * function_state = typeid_cast(func.get())) +// if (const AggregateFunctionState * function_state = typeid_cast(func.get())) +// { +// auto res = createView(); +// res->set(function_state->getNestedFunction()); +// res->data.assign(data.begin(), data.end()); +// return res; +// } +// +// MutableColumnPtr res = func->getReturnType()->createColumn(); +// res->reserve(data.size()); + MutableColumnPtr res; + if (convertion(&res)) { - auto res = createView(); - res->set(function_state->getNestedFunction()); - res->data.assign(data.begin(), data.end()); return res; } - MutableColumnPtr res = func->getReturnType()->createColumn(); - res->reserve(data.size()); - for (auto val : data) func->insertResultInto(val, *res); return res; } -//MutableColumnPtr ColumnAggregateFunction::predictValues(std::vector predict_feature) const MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const ColumnNumbers & arguments) const { - if (const AggregateFunctionState * function_state = typeid_cast(func.get())) +// if (const AggregateFunctionState * function_state = typeid_cast(func.get())) +// { +// auto res = createView(); +// res->set(function_state->getNestedFunction()); +// res->data.assign(data.begin(), data.end()); +// return res; +// } +// +// MutableColumnPtr res = func->getReturnType()->createColumn(); +// res->reserve(data.size()); + MutableColumnPtr res; + if (convertion(&res)) { - auto res = createView(); - res->set(function_state->getNestedFunction()); - res->data.assign(data.begin(), data.end()); return res; } - MutableColumnPtr res = func->getReturnType()->createColumn(); - res->reserve(data.size()); - -// const AggregateFunctionMLMethod * ML_function = typeid_cast(func.get()); auto ML_function = typeid_cast *>(func.get()); if (ML_function) { @@ -105,7 +131,8 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col ++row_num; } } else { - + throw Exception("Illegal aggregate function is passed", + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } return res; diff --git a/dbms/src/Columns/ColumnAggregateFunction.h b/dbms/src/Columns/ColumnAggregateFunction.h index b4cb611dccb..42a147c831e 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.h +++ b/dbms/src/Columns/ColumnAggregateFunction.h @@ -116,6 +116,7 @@ public: std::string getName() const override { return "AggregateFunction(" + func->getName() + ")"; } const char * getFamilyName() const override { return "AggregateFunction"; } + bool convertion(MutableColumnPtr* res_) const; MutableColumnPtr predictValues(Block & block, const ColumnNumbers & arguments) const; size_t size() const override diff --git a/dbms/src/Functions/evalMLMethod.cpp b/dbms/src/Functions/evalMLMethod.cpp index c31c9227782..e299206dbd2 100644 --- a/dbms/src/Functions/evalMLMethod.cpp +++ b/dbms/src/Functions/evalMLMethod.cpp @@ -59,6 +59,7 @@ namespace DB void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override { + // завести МЛ_аггр_функции как отдельный класс, чтобы тут сразу это проверять, а не делать это внутри predictValues() const ColumnAggregateFunction * column_with_states = typeid_cast(&*block.getByPosition(arguments.at(0)).column); if (!column_with_states) From 03deb677b964cb5bc7bc92fcb5881e92b7ef8e64 Mon Sep 17 00:00:00 2001 From: Maxim Kuznetsov Date: Wed, 23 Jan 2019 14:58:05 +0300 Subject: [PATCH 004/194] Code style --- .../AggregateFunctionMLMethod.h | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 1e45303b454..252cf6e579c 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -20,9 +20,11 @@ #include -namespace DB { +namespace DB +{ -struct LinearRegressionData { +struct LinearRegressionData +{ Float64 bias{0.0}; std::vector w1; Float64 learning_rate{0.01}; @@ -30,8 +32,10 @@ struct LinearRegressionData { UInt32 param_num = 0; - void add(Float64 target, std::vector& feature, Float64 learning_rate_, UInt32 param_num_) { - if (w1.empty()) { + void add(Float64 target, std::vector& feature, Float64 learning_rate_, UInt32 param_num_) + { + if (w1.empty()) + { learning_rate = learning_rate_; param_num = param_num_; w1.resize(param_num); @@ -53,11 +57,13 @@ struct LinearRegressionData { ++iter_num; } - void merge(const LinearRegressionData & rhs) { + void merge(const LinearRegressionData & rhs) + { if (iter_num == 0 && rhs.iter_num == 0) throw std::runtime_error("Strange..."); - if (param_num == 0) { + if (param_num == 0) + { param_num = rhs.param_num; w1.resize(param_num); } @@ -74,18 +80,22 @@ struct LinearRegressionData { iter_num += rhs.iter_num; } - void write(WriteBuffer & buf) const { + void write(WriteBuffer & buf) const + { writeBinary(bias, buf); writeBinary(w1, buf); writeBinary(iter_num, buf); } - void read(ReadBuffer & buf) { + void read(ReadBuffer & buf) + { readBinary(bias, buf); readBinary(w1, buf); readBinary(iter_num, buf); } - Float64 predict(std::vector& predict_feature) const { + + Float64 predict(std::vector& predict_feature) const + { Float64 res{0.0}; for (size_t i = 0; i < static_cast(param_num); ++i) { @@ -152,8 +162,9 @@ public: auto &column = dynamic_cast &>(to); std::vector predict_features(arguments.size() - 1); -// for (size_t row_num = 0, rows = block.rows(); row_num < rows; ++row_num) { - for (size_t i = 1; i < arguments.size(); ++i) { +// for (size_t row_num = 0, rows = block.rows(); row_num < rows; ++row_num) + for (size_t i = 1; i < arguments.size(); ++i) + { // predict_features[i] = array_elements[i].get(); predict_features[i - 1] = applyVisitor(FieldVisitorConvertToNumber(), (*block.getByPosition(arguments[i]).column)[row_num]); } @@ -162,7 +173,8 @@ public: // } } - void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override { + void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override + { auto &column = dynamic_cast &>(to); std::ignore = column; std::ignore = place; @@ -177,4 +189,4 @@ private: struct NameLinearRegression { static constexpr auto name = "LinearRegression"; }; -} \ No newline at end of file +} From b9972f8e67a0972a7e47cd0ee7fe69c01758bd6e Mon Sep 17 00:00:00 2001 From: Masha Date: Wed, 23 Jan 2019 14:53:50 +0000 Subject: [PATCH 005/194] code style AggregateFunctionMLMethod.cpp --- .../AggregateFunctionMLMethod.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 7503a300a47..f1781c92bc9 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -22,11 +22,10 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( for (size_t i = 0; i < argument_types.size(); ++i) { if (!WhichDataType(argument_types[i]).isFloat64()) - throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " + - std::to_string(i) + "for aggregate function " + name, - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " + + std::to_string(i) + "for aggregate function " + name, + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } - Float64 learning_rate; if (parameters.empty()) { @@ -35,7 +34,6 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( { learning_rate = applyVisitor(FieldVisitorConvertToNumber(), parameters[0]); } - if (argument_types.size() < 2) throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); @@ -44,8 +42,9 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } -void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory) { +void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory) +{ factory.registerFunction("LinearRegression", createAggregateFunctionMLMethod); } -} \ No newline at end of file +} From b229498203c32e478f5df503a746b2b180dc2ffa Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Wed, 23 Jan 2019 21:03:26 +0300 Subject: [PATCH 006/194] mini-batches --- .../AggregateFunctionMLMethod.cpp | 19 +- .../AggregateFunctionMLMethod.h | 68 +++- dbms/src/Columns/ColumnAggregateFunction.cpp | 2 +- .../0_stateless/00900_mytest.reference | 301 +++++++++++++++++- .../queries/0_stateless/00900_mytest.sql | 2 +- 5 files changed, 371 insertions(+), 21 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 7503a300a47..b225757d273 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -16,8 +16,8 @@ template AggregateFunctionPtr createAggregateFunctionMLMethod( const std::string & name, const DataTypes & argument_types, const Array & parameters) { - if (parameters.size() > 1) - throw Exception("Aggregate function " + name + " requires at most one parameter", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + if (parameters.size() > 2) + throw Exception("Aggregate function " + name + " requires at most two parameters", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); for (size_t i = 0; i < argument_types.size(); ++i) { @@ -27,19 +27,22 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } - Float64 learning_rate; - if (parameters.empty()) - { - learning_rate = Float64(0.01); - } else + Float64 learning_rate = Float64(0.01); + UInt32 batch_size = 1; + if (!parameters.empty()) { learning_rate = applyVisitor(FieldVisitorConvertToNumber(), parameters[0]); } + if (parameters.size() > 1) + { + batch_size = applyVisitor(FieldVisitorConvertToNumber(), parameters[1]); + + } if (argument_types.size() < 2) throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); - return std::make_shared(argument_types.size() - 1, learning_rate); + return std::make_shared(argument_types.size() - 1, learning_rate, batch_size); } } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index cdb3c88261c..bcf27983bc3 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -33,33 +33,63 @@ struct LinearRegressionData { LinearRegressionData() {} - LinearRegressionData(Float64 learning_rate_, UInt32 param_num_) - : learning_rate(learning_rate_) { - weights.resize(param_num_); + LinearRegressionData(Float64 learning_rate_, UInt32 param_num_, UInt32 batch_size_) + : learning_rate(learning_rate_), batch_size(batch_size_) { + weights.resize(param_num_, Float64{0.0}); + batch_gradient.resize(param_num_ + 1, Float64{0.0}); + cur_batch = 0; } Float64 bias{0.0}; std::vector weights; Float64 learning_rate; UInt32 iter_num = 0; + std::vector batch_gradient; + UInt32 cur_batch; + UInt32 batch_size; - void add(Float64 target, const IColumn ** columns, size_t row_num) + void update_gradient(Float64 target, const IColumn ** columns, size_t row_num) { Float64 derivative = (target - bias); for (size_t i = 0; i < weights.size(); ++i) { derivative -= weights[i] * static_cast &>(*columns[i + 1]).getData()[row_num]; - } derivative *= (2 * learning_rate); - bias += derivative; +// bias += derivative; + batch_gradient[weights.size()] += derivative; for (size_t i = 0; i < weights.size(); ++i) { - weights[i] += derivative * static_cast &>(*columns[i + 1]).getData()[row_num];; + batch_gradient[i] += derivative * static_cast &>(*columns[i + 1]).getData()[row_num];; } + } + + void update_weights() + { + if (!cur_batch) + return; + + for (size_t i = 0; i < weights.size(); ++i) + { + weights[i] += batch_gradient[i] / cur_batch; + } + bias += batch_gradient[weights.size()] / cur_batch; + + batch_gradient.assign(batch_gradient.size(), Float64{0.0}); ++iter_num; + cur_batch = 0; + } + + void add(Float64 target, const IColumn ** columns, size_t row_num) + { + update_gradient(target, columns, row_num); + ++cur_batch; + if (cur_batch == batch_size) + { + update_weights(); + } } void merge(const LinearRegressionData & rhs) @@ -67,6 +97,10 @@ struct LinearRegressionData if (iter_num == 0 && rhs.iter_num == 0) return; + update_weights(); + /// нельзя обновить из-за константости +// rhs.update_weights(); + Float64 frac = static_cast(iter_num) / (iter_num + rhs.iter_num); Float64 rhs_frac = static_cast(rhs.iter_num) / (iter_num + rhs.iter_num); @@ -84,6 +118,8 @@ struct LinearRegressionData writeBinary(bias, buf); writeBinary(weights, buf); writeBinary(iter_num, buf); + writeBinary(batch_gradient, buf); + writeBinary(cur_batch, buf); } void read(ReadBuffer & buf) @@ -91,9 +127,19 @@ struct LinearRegressionData readBinary(bias, buf); readBinary(weights, buf); readBinary(iter_num, buf); + readBinary(batch_gradient, buf); + readBinary(cur_batch, buf); } + Float64 predict(const std::vector& predict_feature) const { + /// не обновляем веса при предикте, т.к. это может замедлить предсказание + /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче +// if (cur_batch) +// { +// update_weights(); +// } + Float64 res{0.0}; for (size_t i = 0; i < predict_feature.size(); ++i) { @@ -116,8 +162,8 @@ class AggregateFunctionMLMethod final : public IAggregateFunctionDataHelperdata(place).add(target.getData()[row_num], columns, row_num); } + /// хочется не константный rhs void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override { this->data(place).merge(this->data(rhs)); @@ -185,6 +232,7 @@ public: private: UInt32 param_num; Float64 learning_rate; + UInt32 batch_size; }; struct NameLinearRegression { static constexpr auto name = "LinearRegression"; }; diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 8716da8fffa..1dca1780974 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -122,7 +122,7 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col return res; } - auto ML_function = typeid_cast *>(func.get()); + auto ML_function = typeid_cast *>(func.get()); if (ML_function) { size_t row_num = 0; diff --git a/dbms/tests/queries/0_stateless/00900_mytest.reference b/dbms/tests/queries/0_stateless/00900_mytest.reference index 8a3290dd346..8a9f3c31da5 100644 --- a/dbms/tests/queries/0_stateless/00900_mytest.reference +++ b/dbms/tests/queries/0_stateless/00900_mytest.reference @@ -1 +1,300 @@ -66.80107268499746 \ No newline at end of file +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 +-66.99407003753556 diff --git a/dbms/tests/queries/0_stateless/00900_mytest.sql b/dbms/tests/queries/0_stateless/00900_mytest.sql index b920a4b3b0b..8fa676b2668 100644 --- a/dbms/tests/queries/0_stateless/00900_mytest.sql +++ b/dbms/tests/queries/0_stateless/00900_mytest.sql @@ -13,7 +13,7 @@ insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0 -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); -- DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.01)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5)(target, param1, param2) as state from test.defaults; -- -- select toTypeName(state) from test.model; -- -- -- -- DROP TABLE IF EXISTS test.tests; From 73d83d0ab615c6dd0dc6a357289be578e8445f1c Mon Sep 17 00:00:00 2001 From: Maxim Kuznetsov Date: Thu, 24 Jan 2019 17:22:35 +0300 Subject: [PATCH 007/194] Added LinearModelData --- .../AggregateFunctionMLMethod.h | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 650665fc673..0c443a859f8 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -29,6 +29,104 @@ namespace ErrorCodes extern const int BAD_ARGUMENTS; } +class IGradientComputer +{ +public: + virtual ~IGradientComputer() + {} + + void add(/* weights, */Float64 target, const IColumn ** columns, size_t row_num) final + { + ++cur_batch; + std::vector cur_grad = compute_gradient(/*...*/); + for (size_t i = 0; i != batch_gradient.size(); ++i) { + batch_gradient[i] += cur_grad[i]; + } + } + + std::vector get() final + { + std::vector result(batch_gradient.size()); + for (size_t i = 0; i != batch_gradient.size(); ++i) { + result[i] = batch_gradient[i] / cur_batch; + batch_gradient[i] = 0.0; + } + cur_batch = 0; + return result; + } + +protected: + virtual std::vector compute_gradient(/* weights, */Float64 target, const IColumn ** columns, size_t row_num) = 0; + +private: + UInt32 cur_batch = 0; + std::vector batch_gradient; // gradient for bias lies in batch_gradient[batch_gradient.size() - 1] +}; + +class LinearRegression : public IGradientComputer +{ +public: + virtual ~LinearRegression() + {} + +protected: + virtual std::vector compute_gradient(/* weights, */Float64 target, const IColumn ** columns, size_t row_num) + { + // TODO + } +}; + +class IWeightsUpdater +{ +public: + virtual ~IWeightsUpdater() + {} + + virtual void update(/* weights, gradient */) = 0; +}; + +class GradientDescent : public IWeightsUpdater +{ +public: + virtual ~GradientDescent() + {} + + virtual void update(/* weights, gradient */) = 0 { + // TODO + } +}; + +struct LinearModelData +{ + LinearModelData() + {} + + LinearModelData(Float64 learning_rate_, UInt32 param_num_, UInt32 batch_size_) + : learning_rate(learning_rate_), batch_size(batch_size_) { + weights.resize(param_num_, Float64{0.0}); + batch_gradient.resize(param_num_ + 1, Float64{0.0}); + cur_batch = 0; + } + + std::vector weights; + Float64 bias{0.0}; + std::shared_ptr gradient_computer; + std::shared_ptr weights_updater; + + void add(Float64 target, const IColumn ** columns, size_t row_num) + { + gradient_cumputer->add(target, columns, row_num); + if (cur_batch == batch_size) + { + cur_batch = 0; + weights_updater->update(/* weights */, gradient_computer->get()); + } + } + + void merge(const LinearModelData & rhs) + { + } +}; struct LinearRegressionData { From 57cd47a1943c4902919021af6d27b1a972704386 Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Sat, 26 Jan 2019 15:38:42 +0300 Subject: [PATCH 008/194] LinearModelData completed --- .../AggregateFunctionMLMethod.cpp | 33 ++- .../AggregateFunctionMLMethod.h | 220 ++++++++---------- dbms/src/Columns/ColumnAggregateFunction.cpp | 3 +- .../queries/0_stateless/00900_mytest.sql | 2 +- 4 files changed, 132 insertions(+), 126 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index f419bb9592c..ae0ede33096 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -10,14 +10,14 @@ namespace DB namespace { -using FuncLinearRegression = AggregateFunctionMLMethod; +using FuncLinearRegression = AggregateFunctionMLMethod; template AggregateFunctionPtr createAggregateFunctionMLMethod( const std::string & name, const DataTypes & argument_types, const Array & parameters) { - if (parameters.size() > 2) - throw Exception("Aggregate function " + name + " requires at most two parameters", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + if (parameters.size() > 4) + throw Exception("Aggregate function " + name + " requires at most four parameters", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); for (size_t i = 0; i < argument_types.size(); ++i) { @@ -29,6 +29,9 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( Float64 learning_rate = Float64(0.01); UInt32 batch_size = 1; + + std::shared_ptr gc; + std::shared_ptr wu; if (!parameters.empty()) { learning_rate = applyVisitor(FieldVisitorConvertToNumber(), parameters[0]); @@ -39,10 +42,32 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } + /// Gradient_Computer for LinearRegression has LinearRegression gradient computer + if (std::is_same::value) + { + gc = std::make_shared(argument_types.size()); + } else + { + throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + } + if (parameters.size() > 2) + { + if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{1.0}) + { + wu = std::make_shared(); + } else + { + throw Exception("Such weights updater is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + } + } else + { + wu = std::make_unique(); + } + if (argument_types.size() < 2) throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); - return std::make_shared(argument_types.size() - 1, learning_rate, batch_size); + return std::make_shared(argument_types.size() - 1, gc, wu, learning_rate, batch_size); } } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 0c443a859f8..0aca5485203 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -32,122 +32,47 @@ namespace ErrorCodes class IGradientComputer { public: - virtual ~IGradientComputer() + IGradientComputer(UInt32 sz) + : batch_gradient(sz, 0) {} + virtual ~IGradientComputer() = default; - void add(/* weights, */Float64 target, const IColumn ** columns, size_t row_num) final + virtual void compute(const std::vector & weights, Float64 bias, Float64 learning_rate, + Float64 target, const IColumn ** columns, size_t row_num) = 0; + + void reset() { - ++cur_batch; - std::vector cur_grad = compute_gradient(/*...*/); - for (size_t i = 0; i != batch_gradient.size(); ++i) { - batch_gradient[i] += cur_grad[i]; - } + batch_gradient.assign(batch_gradient.size(), 0); } - std::vector get() final + void write(WriteBuffer & buf) const { - std::vector result(batch_gradient.size()); - for (size_t i = 0; i != batch_gradient.size(); ++i) { - result[i] = batch_gradient[i] / cur_batch; - batch_gradient[i] = 0.0; - } - cur_batch = 0; - return result; + writeBinary(batch_gradient, buf); + } + + void read(ReadBuffer & buf) + { + readBinary(batch_gradient, buf); + } + + const std::vector & get() const + { + return batch_gradient; } protected: - virtual std::vector compute_gradient(/* weights, */Float64 target, const IColumn ** columns, size_t row_num) = 0; - -private: - UInt32 cur_batch = 0; std::vector batch_gradient; // gradient for bias lies in batch_gradient[batch_gradient.size() - 1] }; class LinearRegression : public IGradientComputer { public: - virtual ~LinearRegression() + LinearRegression(UInt32 sz) + : IGradientComputer(sz) {} -protected: - virtual std::vector compute_gradient(/* weights, */Float64 target, const IColumn ** columns, size_t row_num) - { - // TODO - } -}; - -class IWeightsUpdater -{ -public: - virtual ~IWeightsUpdater() - {} - - virtual void update(/* weights, gradient */) = 0; -}; - -class GradientDescent : public IWeightsUpdater -{ -public: - virtual ~GradientDescent() - {} - - virtual void update(/* weights, gradient */) = 0 { - // TODO - } -}; - -struct LinearModelData -{ - LinearModelData() - {} - - LinearModelData(Float64 learning_rate_, UInt32 param_num_, UInt32 batch_size_) - : learning_rate(learning_rate_), batch_size(batch_size_) { - weights.resize(param_num_, Float64{0.0}); - batch_gradient.resize(param_num_ + 1, Float64{0.0}); - cur_batch = 0; - } - - std::vector weights; - Float64 bias{0.0}; - std::shared_ptr gradient_computer; - std::shared_ptr weights_updater; - - void add(Float64 target, const IColumn ** columns, size_t row_num) - { - gradient_cumputer->add(target, columns, row_num); - if (cur_batch == batch_size) - { - cur_batch = 0; - weights_updater->update(/* weights */, gradient_computer->get()); - } - } - - void merge(const LinearModelData & rhs) - { - } -}; - -struct LinearRegressionData -{ - LinearRegressionData() - {} - LinearRegressionData(Float64 learning_rate_, UInt32 param_num_, UInt32 batch_size_) - : learning_rate(learning_rate_), batch_size(batch_size_) { - weights.resize(param_num_, Float64{0.0}); - batch_gradient.resize(param_num_ + 1, Float64{0.0}); - cur_batch = 0; - } - - Float64 bias{0.0}; - std::vector weights; - Float64 learning_rate; - UInt32 iter_num = 0; - std::vector batch_gradient; - UInt32 cur_batch; - UInt32 batch_size; - - void update_gradient(Float64 target, const IColumn ** columns, size_t row_num) + void compute(const std::vector & weights, Float64 bias, Float64 learning_rate, + Float64 target, const IColumn ** columns, size_t row_num) override { Float64 derivative = (target - bias); for (size_t i = 0; i < weights.size(); ++i) @@ -156,47 +81,72 @@ struct LinearRegressionData } derivative *= (2 * learning_rate); -// bias += derivative; batch_gradient[weights.size()] += derivative; for (size_t i = 0; i < weights.size(); ++i) { batch_gradient[i] += derivative * static_cast &>(*columns[i + 1]).getData()[row_num];; } } +}; - void update_weights() - { - if (!cur_batch) - return; +class IWeightsUpdater +{ +public: + virtual ~IWeightsUpdater() = default; + virtual void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & gradient) = 0; +}; + +class StochasticGradientDescent : public IWeightsUpdater +{ +public: + void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { for (size_t i = 0; i < weights.size(); ++i) { weights[i] += batch_gradient[i] / cur_batch; } bias += batch_gradient[weights.size()] / cur_batch; + } +}; - batch_gradient.assign(batch_gradient.size(), Float64{0.0}); +class LinearModelData +{ +public: + LinearModelData() + {} - ++iter_num; + LinearModelData(Float64 learning_rate, + UInt32 param_num, + UInt32 batch_size, + std::shared_ptr gc, + std::shared_ptr wu) + : learning_rate(learning_rate), + batch_size(batch_size), + gradient_computer(std::move(gc)), + weights_updater(std::move(wu)) + { + weights.resize(param_num, Float64{0.0}); cur_batch = 0; } + + void add(Float64 target, const IColumn ** columns, size_t row_num) { - update_gradient(target, columns, row_num); + gradient_computer->compute(weights, bias, learning_rate, target, columns, row_num); ++cur_batch; if (cur_batch == batch_size) { - update_weights(); + update_state(); } } - void merge(const LinearRegressionData & rhs) + void merge(const LinearModelData & rhs) { if (iter_num == 0 && rhs.iter_num == 0) return; - update_weights(); + update_state(); /// нельзя обновить из-за константости // rhs.update_weights(); @@ -217,8 +167,8 @@ struct LinearRegressionData writeBinary(bias, buf); writeBinary(weights, buf); writeBinary(iter_num, buf); - writeBinary(batch_gradient, buf); writeBinary(cur_batch, buf); + gradient_computer->write(buf); } void read(ReadBuffer & buf) @@ -226,11 +176,11 @@ struct LinearRegressionData readBinary(bias, buf); readBinary(weights, buf); readBinary(iter_num, buf); - readBinary(batch_gradient, buf); readBinary(cur_batch, buf); + gradient_computer->read(buf); } - Float64 predict(const std::vector& predict_feature) const + Float64 predict(const std::vector & predict_feature) const { /// не обновляем веса при предикте, т.к. это может замедлить предсказание /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче @@ -248,6 +198,27 @@ struct LinearRegressionData return res; } + +private: + std::vector weights; + Float64 learning_rate; + UInt32 batch_size; + Float64 bias{0.0}; + UInt32 iter_num = 0; + UInt32 cur_batch; + std::shared_ptr gradient_computer; + std::shared_ptr weights_updater; + + void update_state() + { + if (cur_batch == 0) + return; + + weights_updater->update(cur_batch, weights, bias, gradient_computer->get()); + cur_batch = 0; + ++iter_num; + gradient_computer->reset(); + } }; template < @@ -261,10 +232,17 @@ class AggregateFunctionMLMethod final : public IAggregateFunctionDataHelper gradient_computer, + std::shared_ptr weights_updater, + Float64 learning_rate, + UInt32 batch_size) + : param_num(param_num), + learning_rate(learning_rate), + batch_size(batch_size), + gc(std::move(gradient_computer)), + wu(std::move(weights_updater)) + {} DataTypePtr getReturnType() const override { @@ -273,7 +251,7 @@ public: void create(AggregateDataPtr place) const override { - new (place) Data(learning_rate, param_num, batch_size); + new (place) Data(learning_rate, param_num, batch_size, gc, wu); } void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override @@ -322,9 +300,9 @@ public: void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override { - auto &column = dynamic_cast &>(to); - std::ignore = column; std::ignore = place; + std::ignore = to; + return; } const char * getHeaderFilePath() const override { return __FILE__; } @@ -333,6 +311,8 @@ private: UInt32 param_num; Float64 learning_rate; UInt32 batch_size; + std::shared_ptr gc; + std::shared_ptr wu; }; struct NameLinearRegression { static constexpr auto name = "LinearRegression"; }; diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 1dca1780974..efa24fc56ba 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -122,7 +122,8 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col return res; } - auto ML_function = typeid_cast *>(func.get()); +// auto ML_function = typeid_cast *>(func.get()); + auto ML_function = typeid_cast *>(func.get()); if (ML_function) { size_t row_num = 0; diff --git a/dbms/tests/queries/0_stateless/00900_mytest.sql b/dbms/tests/queries/0_stateless/00900_mytest.sql index 8fa676b2668..ddb99c77d19 100644 --- a/dbms/tests/queries/0_stateless/00900_mytest.sql +++ b/dbms/tests/queries/0_stateless/00900_mytest.sql @@ -13,7 +13,7 @@ insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0 -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); -- DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; -- -- select toTypeName(state) from test.model; -- -- -- -- DROP TABLE IF EXISTS test.tests; From 286fa25ad928cf750cc5e51cecfa610364c18abf Mon Sep 17 00:00:00 2001 From: Masha Date: Mon, 28 Jan 2019 10:39:57 +0000 Subject: [PATCH 009/194] logreg and momentum --- .../AggregateFunctionMLMethod.cpp | 9 +- .../AggregateFunctionMLMethod.h | 111 ++++++++++++++++-- dbms/src/Columns/ColumnAggregateFunction.cpp | 18 ++- 3 files changed, 123 insertions(+), 15 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index ae0ede33096..6aa983defc4 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -11,7 +11,7 @@ namespace { using FuncLinearRegression = AggregateFunctionMLMethod; - +using FuncLogicRegression = AggregateFunctionMLMethod; template AggregateFunctionPtr createAggregateFunctionMLMethod( const std::string & name, const DataTypes & argument_types, const Array & parameters) @@ -46,6 +46,9 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (std::is_same::value) { gc = std::make_shared(argument_types.size()); + } else if (std::is_same::value) + { + gc = std::make_shared(argument_types.size()); } else { throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); @@ -55,6 +58,9 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{1.0}) { wu = std::make_shared(); + } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{2.0}) + { + wu = std::make_shared(); } else { throw Exception("Such weights updater is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); @@ -75,6 +81,7 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory) { factory.registerFunction("LinearRegression", createAggregateFunctionMLMethod); + factory.registerFunction("LogicRegression", createAggregateFunctionMLMethod); } } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 0aca5485203..598ff23b5d9 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -59,6 +59,7 @@ public: { return batch_gradient; } + virtual Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const = 0; protected: std::vector batch_gradient; // gradient for bias lies in batch_gradient[batch_gradient.size() - 1] @@ -87,6 +88,73 @@ public: batch_gradient[i] += derivative * static_cast &>(*columns[i + 1]).getData()[row_num];; } } + Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const override + { + /// не обновляем веса при предикте, т.к. это может замедлить предсказание + /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче +// if (cur_batch) +// { +// update_weights(); +// } + + Float64 res{0.0}; + for (size_t i = 0; i < predict_feature.size(); ++i) + { + res += predict_feature[i] * weights[i]; + } + res += bias; + + return res; + } +}; +class LogicRegression : public IGradientComputer +{ +public: + LogicRegression(UInt32 sz) + : IGradientComputer(sz) + {} + + void compute(const std::vector & weights, Float64 bias, Float64 learning_rate, + Float64 target, const IColumn ** columns, size_t row_num) override + { + //Float64 derivative = (target - bias); + //for (size_t i = 0; i < weights.size(); ++i) + //{ + // derivative -= weights[i] * static_cast &>(*columns[i + 1]).getData()[row_num]; + //} + //derivative *= (2 * learning_rate); + Float64 derivative = bias; + for (size_t i = 0; i < weights.size(); ++i) + { + derivative += weights[i] * static_cast &>(*columns[i + 1]).getData()[row_num];; + } + derivative *= target; + derivative = learning_rate * exp(derivative); + + batch_gradient[weights.size()] += target / (derivative + 1);; + for (size_t i = 0; i < weights.size(); ++i) + { + batch_gradient[i] += target / (derivative + 1) * static_cast &>(*columns[i + 1]).getData()[row_num]; + } + } + Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const override + { + /// не обновляем веса при предикте, т.к. это может замедлить предсказание + /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче +// if (cur_batch) +// { +// update_weights(); +// } + + Float64 res{0.0}; + for (size_t i = 0; i < predict_feature.size(); ++i) + { + res += predict_feature[i] * weights[i]; + } + res += bias; + res = 1 / (1 + exp(-res)); + return res; + } }; class IWeightsUpdater @@ -95,6 +163,7 @@ public: virtual ~IWeightsUpdater() = default; virtual void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & gradient) = 0; + virtual void merge(const std::shared_ptr, Float64, Float64) {} }; class StochasticGradientDescent : public IWeightsUpdater @@ -108,7 +177,37 @@ public: bias += batch_gradient[weights.size()] / cur_batch; } }; +class Momentum : public IWeightsUpdater +{ +public: + Momentum() {} + Momentum (Float64 alpha) : alpha_(alpha) {} + void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + if (hk_.size() == 0) + { + hk_.resize(batch_gradient.size(), Float64{0.0}); + } + for (size_t i = 0; i < batch_gradient.size(); ++i) + { + hk_[i] = hk_[i] * alpha_ + batch_gradient[i]; + } + for (size_t i = 0; i < weights.size(); ++i) + { + weights[i] += hk_[i] / cur_batch; + } + bias += hk_[weights.size()] / cur_batch; + } + virtual void merge(const std::shared_ptr rhs, Float64 frac, Float64 rhs_frac) override { + auto momentum_rhs = std::dynamic_pointer_cast(rhs); + for (size_t i = 0; i < hk_.size(); ++i) + { + hk_[i] = hk_[i] * frac + momentum_rhs->hk_[i] * rhs_frac; + } + } +Float64 alpha_{0.1}; +std::vector hk_; +}; class LinearModelData { public: @@ -160,6 +259,7 @@ public: bias = bias * frac + rhs.bias * rhs_frac; iter_num += rhs.iter_num; + weights_updater->merge(rhs.weights_updater, frac, rhs_frac); } void write(WriteBuffer & buf) const @@ -189,14 +289,7 @@ public: // update_weights(); // } - Float64 res{0.0}; - for (size_t i = 0; i < predict_feature.size(); ++i) - { - res += predict_feature[i] * weights[i]; - } - res += bias; - - return res; + return gradient_computer->predict(predict_feature, weights, bias); } private: @@ -316,5 +409,5 @@ private: }; struct NameLinearRegression { static constexpr auto name = "LinearRegression"; }; - +struct NameLogicRegression { static constexpr auto name = "LogicRegression"; }; } diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index efa24fc56ba..c60060f1f79 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -123,19 +123,27 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col } // auto ML_function = typeid_cast *>(func.get()); - auto ML_function = typeid_cast *>(func.get()); - if (ML_function) + auto ML_function_Linear = typeid_cast *>(func.get()); + auto ML_function_Logic = typeid_cast *>(func.get()); + if (ML_function_Linear) { size_t row_num = 0; for (auto val : data) { - ML_function->predictResultInto(val, *res, block, row_num, arguments); + ML_function_Linear->predictResultInto(val, *res, block, row_num, arguments); ++row_num; } - } else { + } else if (ML_function_Logic) + { + size_t row_num = 0; + for (auto val : data) { + ML_function_Logic->predictResultInto(val, *res, block, row_num, arguments); + ++row_num; + } + } else + { throw Exception("Illegal aggregate function is passed", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } - return res; } From 243a68d500ad5cb63271eabdedf23b71b7b67ac3 Mon Sep 17 00:00:00 2001 From: Masha Date: Mon, 28 Jan 2019 10:51:33 +0000 Subject: [PATCH 010/194] tests for momentum and logreg --- .../tests/queries/0_stateless/00900_stest.sql | 48 +++++++++++++++++++ .../queries/0_stateless/00901_mytest.sql | 46 ++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00900_stest.sql create mode 100644 dbms/tests/queries/0_stateless/00901_mytest.sql diff --git a/dbms/tests/queries/0_stateless/00900_stest.sql b/dbms/tests/queries/0_stateless/00900_stest.sql new file mode 100644 index 00000000000..0a0acfdee11 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00900_stest.sql @@ -0,0 +1,48 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults +( + param1 Float64, + param2 Float64, + target Float64, + predict1 Float64, + predict2 Float64 +) ENGINE = Memory; +-- -- insert into test.defaults values (2.533, 0.543, 3.181), (1.999, 1.765, 0.470), (0.631, 2.580, -1.845), (-1.164, 0.889, 0.640), (2.110, 0.768, 2.519), (1.251, 0.483, 2.659), (-3.958, 1.299, -1.576), (-2.152, -1.316, 4.556), (3.269, 1.441, 1.753), (4.206, -1.635, 8.373), (-3.479, -0.544, 2.349), (4.006, 0.167, 4.670), (-4.478, 2.400, -4.039), (1.856, 0.256, 3.417), (1.470, 1.685, 0.366), (-4.052, 2.326, -3.678), (-0.971, -0.969, 4.453), (0.881, -1.848, 7.137), (-1.551, -1.766, 5.756), (-0.988, -0.945, 4.395), (-4.636, 1.074, -1.466), (-4.074, -1.486, 3.934), (0.754, 2.627, -1.877), (1.035, 0.889, 1.738), (3.707, -1.281, 7.415), (-2.215, 1.110, -0.327), (-2.965, -1.316, 4.150), (-3.581, 1.063, -0.917), (0.548, 0.343, 2.588), (3.023, -0.870, 6.251), (4.053, -1.441, 7.909), (-0.750, 0.639, 1.348), (-4.411, 1.636, -2.477), (1.786, 0.398, 3.096), (-2.514, 0.033, 1.676), (4.935, -0.840, 7.148), (1.075, -0.921, 5.380), (-3.418, 2.177, -3.063), (3.122, 1.883, 0.795), (-2.254, -1.389, 4.650), (-4.603, 2.909, -5.119), (-1.886, -1.220, 4.497), (-0.509, -1.498, 5.741), (2.192, 1.882, 0.332), (4.056, -1.108, 7.244), (-1.918, 0.230, 1.581), (4.867, 1.516, 2.401), (-0.993, -0.011, 2.526), (-0.757, -1.192, 5.006), (-4.161, 2.059, -3.198), (2.258, 1.157, 1.814), (-3.878, -0.052, 1.165), (1.915, 2.998, -2.038), (-2.164, 2.379, -2.841), (-0.114, -1.914, 6.772), (3.812, 2.138, 0.630), (-1.863, 1.508, -0.947), (-2.964, 0.398, 0.722), (-2.046, -0.193, 2.363), (-1.525, -0.836, 3.910), (-4.557, -0.582, 1.886), (1.031, -0.461, 4.437), (-0.802, 0.699, 1.201), (3.982, 2.084, 0.824), (-2.243, 2.726, -3.573), (-3.989, -0.803, 2.611), (4.900, 0.253, 4.944), (-1.208, -1.587, 5.571), (0.370, 2.579, -1.972), (2.824, 0.964, 2.484), (-1.290, -0.128, 2.611), (0.190, 2.058, -1.021), (4.058, 2.122, 0.784), (4.879, 0.945, 3.549), (1.119, 1.992, -0.424), (4.050, 2.005, 1.015), (-0.064, 1.485, -0.002), (-2.496, 0.456, 0.840), (-1.835, 1.586, -1.090), (0.603, 1.856, -0.411), (-3.062, -0.966, 3.401), (-3.351, 0.430, 0.465), (-2.724, -1.331, 4.299), (3.291, -1.027, 6.699), (-4.263, 0.785, -0.701), (-3.289, -0.886, 3.128), (4.627, 1.331, 2.651), (-0.618, 0.602, 1.486), (0.056, 1.778, -0.528), (4.823, 1.154, 3.103), (-3.983, 0.509, -0.010), (-4.474, -1.400, 3.563), (-3.782, 2.996, -4.883), (4.515, -0.656, 6.569), (1.269, 2.592, -1.549), (-1.710, -0.241, 2.627), (2.171, 1.453, 1.180), (-1.931, -1.845, 5.726), (1.767, -1.798, 7.480), (4.352, 2.369, 0.438), (-4.498, 2.611, -4.472), (0.067, 0.517, 2.000), (4.151, 0.624, 3.827), (0.409, -0.969, 5.142), (0.193, -1.713, 6.522), (-2.487, 2.827, -3.898), (-4.363, 2.011, -3.203), (-2.383, 2.554, -3.299), (-4.457, -0.958, 2.687), (3.342, -0.360, 5.392), (0.902, 2.978, -2.505), (4.073, -1.524, 8.084), (3.036, 1.672, 1.173), (2.169, -0.564, 5.213), (-4.780, 0.962, -1.313), (-1.815, 2.096, -2.100), (-1.445, 0.458, 1.362), (1.891, -1.437, 6.820), (1.942, -1.761, 7.493), (-4.613, -1.551, 3.795), (-3.472, -1.110, 3.485), (-2.026, 1.961, -1.935), (0.091, -0.961, 4.967), (3.902, -1.336, 7.622), (-3.483, -0.769, 2.796), (-0.066, -1.233, 5.433), (2.597, 2.789, -1.280), (-1.657, -1.842, 5.856), (0.232, -1.420, 5.957), (-3.321, 1.609, -1.879), (2.673, 2.781, -1.226), (0.869, 0.072, 3.291), (1.444, -1.271, 6.264), (1.190, 1.460, 0.675), (3.497, 0.870, 3.008), (-2.884, -1.303, 4.163), (3.620, 0.381, 4.047), (2.594, 0.247, 3.803), (-3.902, -1.315, 3.678), (-4.753, -1.005, 2.634), (0.881, 0.675, 2.091), (0.414, 2.071, -0.935), (3.458, -0.920, 6.568), (-2.986, -0.411, 2.329), (3.076, -1.960, 8.458), (2.951, 2.988, -1.501), (2.408, 1.301, 1.603), (4.725, 0.366, 4.631), (4.924, -1.762, 8.985), (3.719, 0.970, 2.920), (-0.295, 0.257, 2.340), (-4.607, 2.548, -4.400), (0.288, 1.953, -0.761), (-3.311, 0.844, -0.344), (3.679, -0.642, 6.123), (-2.310, -0.838, 3.522), (-4.397, -0.226, 1.254), (-4.366, -0.024, 0.864), (2.405, 1.458, 1.286), (-4.296, -1.071, 2.994), (0.452, -1.901, 7.028), (-0.214, -0.467, 3.827), (2.559, 1.547, 1.185), (0.990, 1.539, 0.417), (0.478, -0.089, 3.417), (-2.734, -1.007, 3.646), (3.483, 0.247, 4.247), (3.507, 2.727, -0.701), (-4.399, 2.437, -4.073), (3.785, 0.036, 4.820), (-0.824, 2.417, -2.245), (-2.588, 0.369, 0.968), (-3.037, -1.639, 4.759), (4.531, -0.499, 6.264), (4.742, -1.161, 7.693), (-0.063, -0.595, 4.159), (0.697, 2.281, -1.212), (0.413, 0.607, 1.992), (-4.081, 0.383, 0.194), (0.712, 2.638, -1.920), (-1.620, 1.092, 0.006), (-3.425, -0.911, 3.109), (-0.124, 1.711, -0.484), (4.347, 1.387, 2.399), (-3.237, -0.900, 3.182), (-3.961, 0.358, 0.304), (4.326, -0.068, 5.298), (3.846, 1.725, 1.473), (-2.089, 0.953, 0.049), (-1.025, -1.470, 5.428), (2.061, -0.156, 4.343), (1.547, -1.827, 7.427), (2.786, 0.460, 3.473), (0.076, 0.659, 1.720), (3.597, 1.966, 0.866), (-0.933, -1.180, 4.894), (4.647, 1.190, 2.943), (-0.032, 0.544, 1.896), (4.461, -1.806, 8.843), (-0.586, 1.821, -0.934), (3.725, 1.715, 1.432), (-2.091, 2.714, -3.474), (4.494, -1.494, 8.236), (3.766, -0.209, 5.301), (-1.991, 1.776, -1.548), (-4.992, -0.742, 1.989), (-2.400, 1.828, -1.855), (-1.329, 0.143, 2.050), (1.954, 1.759, 0.459), (-4.422, 1.507, -2.224), (-2.243, -1.126, 4.131), (4.417, -1.080, 7.368), (1.737, -1.144, 6.157), (2.661, -1.084, 6.498), (-3.198, 0.443, 0.515), (4.191, -1.250, 7.596), (-2.419, -0.163, 2.116), (1.910, -1.173, 6.301), (-0.241, 1.902, -0.925), (-4.415, 2.479, -4.165), (3.307, -0.465, 5.583), (-2.382, 1.364, -0.920), (-3.154, 2.953, -4.483), (-2.562, 2.803, -3.888), (3.076, 0.195, 4.149), (-0.101, 0.896, 1.157), (-2.067, 1.120, -0.273), (-4.680, 2.756, -4.851), (-4.283, -0.607, 2.072), (4.013, -1.072, 7.150), (-4.401, -0.896, 2.591), (4.544, 2.498, 0.276), (4.075, -1.204, 7.445), (-3.463, 1.242, -1.216), (3.992, 2.782, -0.568), (-4.503, 0.239, 0.270), (-3.095, 1.161, -0.870), (0.768, -0.904, 5.192), (1.255, 2.870, -2.112), (-1.537, -0.049, 2.330), (2.851, -1.182, 6.789), (1.974, -0.922, 5.832), (4.447, 2.719, -0.214), (-3.413, 0.555, 0.184), (4.943, 2.120, 1.231), (3.645, -0.413, 5.648), (-4.776, 0.079, 0.453), (1.991, 1.565, 0.866), (2.413, 1.793, 0.620), (4.245, 2.663, -0.205), (-2.022, -1.180, 4.350), (-2.285, -1.246, 4.350), (2.276, 0.488, 3.162), (2.582, -0.037, 4.365), (-4.875, 1.468, -2.374), (-2.492, 2.730, -3.706), (2.696, -1.833, 8.013), (4.618, -1.127, 7.563), (-4.156, 0.987, -1.053), (1.873, -1.566, 7.068), (1.699, 0.794, 2.262), (-3.181, 1.640, -1.871), (-3.225, 1.526, -1.664), (-2.679, -1.811, 5.281), (3.717, 1.532, 1.794), (1.288, -0.999, 5.642), (-1.057, 0.044, 2.384), (-0.147, 1.108, 0.711), (-3.827, -1.139, 3.365), (0.872, -1.482, 6.399), (1.982, 0.286, 3.418), (-1.381, 2.374, -2.439), (-1.091, 2.010, -1.565), (-1.192, 2.751, -3.097), (1.468, -0.992, 5.718), (2.249, 0.949, 2.228), (3.064, 0.911, 2.711), (-1.576, -1.584, 5.380), (2.130, -1.489, 7.043), (4.386, -1.284, 7.761), (1.662, -1.645, 7.121), (-3.395, 1.784, -2.265), (4.618, 1.951, 1.406), (-0.299, 0.378, 2.095), (-2.911, 2.131, -2.717), (0.876, 2.869, -2.301), (-1.785, 0.961, 0.186), (-4.188, 2.442, -3.977), (-1.128, 0.127, 2.181), (1.755, -1.215, 6.307), (-2.276, 0.596, 0.669), (-4.630, 1.978, -3.272), (-0.454, 0.275, 2.224), (-1.950, -1.385, 4.794), (-0.889, 2.696, -2.837), (-4.832, -0.038, 0.661), (3.738, 0.604, 3.662), (-0.224, -0.465, 3.819); +insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +-- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +-- +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; +-- -- select toTypeName(state) from test.model; +-- -- +-- -- DROP TABLE IF EXISTS test.tests; +-- -- CREATE TABLE IF NOT EXISTS test.tests +-- -- ( +-- -- predict1 Float64, +-- -- predict2 Float64, +-- -- state1 AggregateFunction(LinReg(0.01), Float64, Float64, Float64) +-- -- ) ENGINE = Memory; +-- -- insert into test.tests select 20.0, 40.0, LinRegState(0.01)(target, param1, param2) from test.defaults; +-- -- select evalLinReg(state1, predict1, predict2) from test.tests; +-- +-- +-- +-- -- DROP TABLE IF EXISTS test.prediction; +-- -- CREATE TABLE IF NOT EXISTS test.prediction +-- -- ( +-- -- predict1 Float64, +-- -- predict2 Float64 +-- -- ) ENGINE = Memory; +-- +-- +-- -- insert into test.prediction values (20.0, 40.0); +-- +-- -- select multiply(param1, param2) from test.defaults; +-- +-- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; +select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; +-- -- select evalLinReg(state, predict1, predict2) from test.model inner join (select * from test.tests) using state; +-- -- select evalLinReg(state1, predict1, predict2) from test.tests; +-- +-- -- select negate(target) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00901_mytest.sql b/dbms/tests/queries/0_stateless/00901_mytest.sql new file mode 100644 index 00000000000..e9278ecb77d --- /dev/null +++ b/dbms/tests/queries/0_stateless/00901_mytest.sql @@ -0,0 +1,46 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults +( + param1 Float64, + param2 Float64, + target Float64, + predict1 Float64, + predict2 Float64 +) ENGINE = Memory; +-- -- insert into test.defaults values (2.533, 0.543, 3.181), (1.999, 1.765, 0.470), (0.631, 2.580, -1.845), (-1.164, 0.889, 0.640), (2.110, 0.768, 2.519), (1.251, 0.483, 2.659), (-3.958, 1.299, -1.576), (-2.152, -1.316, 4.556), (3.269, 1.441, 1.753), (4.206, -1.635, 8.373), (-3.479, -0.544, 2.349), (4.006, 0.167, 4.670), (-4.478, 2.400, -4.039), (1.856, 0.256, 3.417), (1.470, 1.685, 0.366), (-4.052, 2.326, -3.678), (-0.971, -0.969, 4.453), (0.881, -1.848, 7.137), (-1.551, -1.766, 5.756), (-0.988, -0.945, 4.395), (-4.636, 1.074, -1.466), (-4.074, -1.486, 3.934), (0.754, 2.627, -1.877), (1.035, 0.889, 1.738), (3.707, -1.281, 7.415), (-2.215, 1.110, -0.327), (-2.965, -1.316, 4.150), (-3.581, 1.063, -0.917), (0.548, 0.343, 2.588), (3.023, -0.870, 6.251), (4.053, -1.441, 7.909), (-0.750, 0.639, 1.348), (-4.411, 1.636, -2.477), (1.786, 0.398, 3.096), (-2.514, 0.033, 1.676), (4.935, -0.840, 7.148), (1.075, -0.921, 5.380), (-3.418, 2.177, -3.063), (3.122, 1.883, 0.795), (-2.254, -1.389, 4.650), (-4.603, 2.909, -5.119), (-1.886, -1.220, 4.497), (-0.509, -1.498, 5.741), (2.192, 1.882, 0.332), (4.056, -1.108, 7.244), (-1.918, 0.230, 1.581), (4.867, 1.516, 2.401), (-0.993, -0.011, 2.526), (-0.757, -1.192, 5.006), (-4.161, 2.059, -3.198), (2.258, 1.157, 1.814), (-3.878, -0.052, 1.165), (1.915, 2.998, -2.038), (-2.164, 2.379, -2.841), (-0.114, -1.914, 6.772), (3.812, 2.138, 0.630), (-1.863, 1.508, -0.947), (-2.964, 0.398, 0.722), (-2.046, -0.193, 2.363), (-1.525, -0.836, 3.910), (-4.557, -0.582, 1.886), (1.031, -0.461, 4.437), (-0.802, 0.699, 1.201), (3.982, 2.084, 0.824), (-2.243, 2.726, -3.573), (-3.989, -0.803, 2.611), (4.900, 0.253, 4.944), (-1.208, -1.587, 5.571), (0.370, 2.579, -1.972), (2.824, 0.964, 2.484), (-1.290, -0.128, 2.611), (0.190, 2.058, -1.021), (4.058, 2.122, 0.784), (4.879, 0.945, 3.549), (1.119, 1.992, -0.424), (4.050, 2.005, 1.015), (-0.064, 1.485, -0.002), (-2.496, 0.456, 0.840), (-1.835, 1.586, -1.090), (0.603, 1.856, -0.411), (-3.062, -0.966, 3.401), (-3.351, 0.430, 0.465), (-2.724, -1.331, 4.299), (3.291, -1.027, 6.699), (-4.263, 0.785, -0.701), (-3.289, -0.886, 3.128), (4.627, 1.331, 2.651), (-0.618, 0.602, 1.486), (0.056, 1.778, -0.528), (4.823, 1.154, 3.103), (-3.983, 0.509, -0.010), (-4.474, -1.400, 3.563), (-3.782, 2.996, -4.883), (4.515, -0.656, 6.569), (1.269, 2.592, -1.549), (-1.710, -0.241, 2.627), (2.171, 1.453, 1.180), (-1.931, -1.845, 5.726), (1.767, -1.798, 7.480), (4.352, 2.369, 0.438), (-4.498, 2.611, -4.472), (0.067, 0.517, 2.000), (4.151, 0.624, 3.827), (0.409, -0.969, 5.142), (0.193, -1.713, 6.522), (-2.487, 2.827, -3.898), (-4.363, 2.011, -3.203), (-2.383, 2.554, -3.299), (-4.457, -0.958, 2.687), (3.342, -0.360, 5.392), (0.902, 2.978, -2.505), (4.073, -1.524, 8.084), (3.036, 1.672, 1.173), (2.169, -0.564, 5.213), (-4.780, 0.962, -1.313), (-1.815, 2.096, -2.100), (-1.445, 0.458, 1.362), (1.891, -1.437, 6.820), (1.942, -1.761, 7.493), (-4.613, -1.551, 3.795), (-3.472, -1.110, 3.485), (-2.026, 1.961, -1.935), (0.091, -0.961, 4.967), (3.902, -1.336, 7.622), (-3.483, -0.769, 2.796), (-0.066, -1.233, 5.433), (2.597, 2.789, -1.280), (-1.657, -1.842, 5.856), (0.232, -1.420, 5.957), (-3.321, 1.609, -1.879), (2.673, 2.781, -1.226), (0.869, 0.072, 3.291), (1.444, -1.271, 6.264), (1.190, 1.460, 0.675), (3.497, 0.870, 3.008), (-2.884, -1.303, 4.163), (3.620, 0.381, 4.047), (2.594, 0.247, 3.803), (-3.902, -1.315, 3.678), (-4.753, -1.005, 2.634), (0.881, 0.675, 2.091), (0.414, 2.071, -0.935), (3.458, -0.920, 6.568), (-2.986, -0.411, 2.329), (3.076, -1.960, 8.458), (2.951, 2.988, -1.501), (2.408, 1.301, 1.603), (4.725, 0.366, 4.631), (4.924, -1.762, 8.985), (3.719, 0.970, 2.920), (-0.295, 0.257, 2.340), (-4.607, 2.548, -4.400), (0.288, 1.953, -0.761), (-3.311, 0.844, -0.344), (3.679, -0.642, 6.123), (-2.310, -0.838, 3.522), (-4.397, -0.226, 1.254), (-4.366, -0.024, 0.864), (2.405, 1.458, 1.286), (-4.296, -1.071, 2.994), (0.452, -1.901, 7.028), (-0.214, -0.467, 3.827), (2.559, 1.547, 1.185), (0.990, 1.539, 0.417), (0.478, -0.089, 3.417), (-2.734, -1.007, 3.646), (3.483, 0.247, 4.247), (3.507, 2.727, -0.701), (-4.399, 2.437, -4.073), (3.785, 0.036, 4.820), (-0.824, 2.417, -2.245), (-2.588, 0.369, 0.968), (-3.037, -1.639, 4.759), (4.531, -0.499, 6.264), (4.742, -1.161, 7.693), (-0.063, -0.595, 4.159), (0.697, 2.281, -1.212), (0.413, 0.607, 1.992), (-4.081, 0.383, 0.194), (0.712, 2.638, -1.920), (-1.620, 1.092, 0.006), (-3.425, -0.911, 3.109), (-0.124, 1.711, -0.484), (4.347, 1.387, 2.399), (-3.237, -0.900, 3.182), (-3.961, 0.358, 0.304), (4.326, -0.068, 5.298), (3.846, 1.725, 1.473), (-2.089, 0.953, 0.049), (-1.025, -1.470, 5.428), (2.061, -0.156, 4.343), (1.547, -1.827, 7.427), (2.786, 0.460, 3.473), (0.076, 0.659, 1.720), (3.597, 1.966, 0.866), (-0.933, -1.180, 4.894), (4.647, 1.190, 2.943), (-0.032, 0.544, 1.896), (4.461, -1.806, 8.843), (-0.586, 1.821, -0.934), (3.725, 1.715, 1.432), (-2.091, 2.714, -3.474), (4.494, -1.494, 8.236), (3.766, -0.209, 5.301), (-1.991, 1.776, -1.548), (-4.992, -0.742, 1.989), (-2.400, 1.828, -1.855), (-1.329, 0.143, 2.050), (1.954, 1.759, 0.459), (-4.422, 1.507, -2.224), (-2.243, -1.126, 4.131), (4.417, -1.080, 7.368), (1.737, -1.144, 6.157), (2.661, -1.084, 6.498), (-3.198, 0.443, 0.515), (4.191, -1.250, 7.596), (-2.419, -0.163, 2.116), (1.910, -1.173, 6.301), (-0.241, 1.902, -0.925), (-4.415, 2.479, -4.165), (3.307, -0.465, 5.583), (-2.382, 1.364, -0.920), (-3.154, 2.953, -4.483), (-2.562, 2.803, -3.888), (3.076, 0.195, 4.149), (-0.101, 0.896, 1.157), (-2.067, 1.120, -0.273), (-4.680, 2.756, -4.851), (-4.283, -0.607, 2.072), (4.013, -1.072, 7.150), (-4.401, -0.896, 2.591), (4.544, 2.498, 0.276), (4.075, -1.204, 7.445), (-3.463, 1.242, -1.216), (3.992, 2.782, -0.568), (-4.503, 0.239, 0.270), (-3.095, 1.161, -0.870), (0.768, -0.904, 5.192), (1.255, 2.870, -2.112), (-1.537, -0.049, 2.330), (2.851, -1.182, 6.789), (1.974, -0.922, 5.832), (4.447, 2.719, -0.214), (-3.413, 0.555, 0.184), (4.943, 2.120, 1.231), (3.645, -0.413, 5.648), (-4.776, 0.079, 0.453), (1.991, 1.565, 0.866), (2.413, 1.793, 0.620), (4.245, 2.663, -0.205), (-2.022, -1.180, 4.350), (-2.285, -1.246, 4.350), (2.276, 0.488, 3.162), (2.582, -0.037, 4.365), (-4.875, 1.468, -2.374), (-2.492, 2.730, -3.706), (2.696, -1.833, 8.013), (4.618, -1.127, 7.563), (-4.156, 0.987, -1.053), (1.873, -1.566, 7.068), (1.699, 0.794, 2.262), (-3.181, 1.640, -1.871), (-3.225, 1.526, -1.664), (-2.679, -1.811, 5.281), (3.717, 1.532, 1.794), (1.288, -0.999, 5.642), (-1.057, 0.044, 2.384), (-0.147, 1.108, 0.711), (-3.827, -1.139, 3.365), (0.872, -1.482, 6.399), (1.982, 0.286, 3.418), (-1.381, 2.374, -2.439), (-1.091, 2.010, -1.565), (-1.192, 2.751, -3.097), (1.468, -0.992, 5.718), (2.249, 0.949, 2.228), (3.064, 0.911, 2.711), (-1.576, -1.584, 5.380), (2.130, -1.489, 7.043), (4.386, -1.284, 7.761), (1.662, -1.645, 7.121), (-3.395, 1.784, -2.265), (4.618, 1.951, 1.406), (-0.299, 0.378, 2.095), (-2.911, 2.131, -2.717), (0.876, 2.869, -2.301), (-1.785, 0.961, 0.186), (-4.188, 2.442, -3.977), (-1.128, 0.127, 2.181), (1.755, -1.215, 6.307), (-2.276, 0.596, 0.669), (-4.630, 1.978, -3.272), (-0.454, 0.275, 2.224), (-1.950, -1.385, 4.794), (-0.889, 2.696, -2.837), (-4.832, -0.038, 0.661), (3.738, 0.604, 3.662), (-0.224, -0.465, 3.819); +-- -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +-- -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1) +insert into test.defaults values (1,2,1,1,2), (1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2) +-- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +-- +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LogicRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; +-- -- select toTypeName(state) from test.model; +-- -- +-- -- DROP TABLE IF EXISTS test.tests; +-- -- CREATE TABLE IF NOT EXISTS test.tests +-- -- ( +-- -- predict1 Float64, +-- -- predict2 Float64, +-- -- state1 AggregateFunction(LinReg(0.01), Float64, Float64, Float64) +-- -- ) ENGINE = Memory; +-- -- insert into test.tests select 20.0, 40.0, LinRegState(0.01)(target, param1, param2) from test.defaults; +-- -- select evalLinReg(state1, predict1, predict2) from test.tests; +-- +-- +-- +-- -- DROP TABLE IF EXISTS test.prediction; +-- -- CREATE TABLE IF NOT EXISTS test.prediction +-- -- ( +-- -- predict1 Float64, +-- -- predict2 Float64 +-- -- ) ENGINE = Memory; +-- +-- +-- -- insert into test.prediction values (20.0, 40.0); +-- +-- -- select multiply(param1, param2) from test.defaults; +-- +-- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; +select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; From 39f1d9756e9ff980d0dd487ec66e78d041896f13 Mon Sep 17 00:00:00 2001 From: Masha Date: Mon, 28 Jan 2019 11:54:55 +0000 Subject: [PATCH 011/194] fixed name Logistic --- .../AggregateFunctions/AggregateFunctionMLMethod.cpp | 8 ++++---- .../AggregateFunctions/AggregateFunctionMLMethod.h | 12 +++--------- dbms/src/Columns/ColumnAggregateFunction.cpp | 6 +++--- dbms/tests/queries/0_stateless/00901_mytest.sql | 2 +- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 6aa983defc4..116a62b8408 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -11,7 +11,7 @@ namespace { using FuncLinearRegression = AggregateFunctionMLMethod; -using FuncLogicRegression = AggregateFunctionMLMethod; +using FuncLogisticRegression = AggregateFunctionMLMethod; template AggregateFunctionPtr createAggregateFunctionMLMethod( const std::string & name, const DataTypes & argument_types, const Array & parameters) @@ -46,9 +46,9 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (std::is_same::value) { gc = std::make_shared(argument_types.size()); - } else if (std::is_same::value) + } else if (std::is_same::value) { - gc = std::make_shared(argument_types.size()); + gc = std::make_shared(argument_types.size()); } else { throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); @@ -81,7 +81,7 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory) { factory.registerFunction("LinearRegression", createAggregateFunctionMLMethod); - factory.registerFunction("LogicRegression", createAggregateFunctionMLMethod); + factory.registerFunction("LogisticRegression", createAggregateFunctionMLMethod); } } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 598ff23b5d9..4c85d5cff76 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -107,22 +107,16 @@ public: return res; } }; -class LogicRegression : public IGradientComputer +class LogisticRegression : public IGradientComputer { public: - LogicRegression(UInt32 sz) + LogisticRegression(UInt32 sz) : IGradientComputer(sz) {} void compute(const std::vector & weights, Float64 bias, Float64 learning_rate, Float64 target, const IColumn ** columns, size_t row_num) override { - //Float64 derivative = (target - bias); - //for (size_t i = 0; i < weights.size(); ++i) - //{ - // derivative -= weights[i] * static_cast &>(*columns[i + 1]).getData()[row_num]; - //} - //derivative *= (2 * learning_rate); Float64 derivative = bias; for (size_t i = 0; i < weights.size(); ++i) { @@ -409,5 +403,5 @@ private: }; struct NameLinearRegression { static constexpr auto name = "LinearRegression"; }; -struct NameLogicRegression { static constexpr auto name = "LogicRegression"; }; +struct NameLogisticRegression { static constexpr auto name = "LogisticRegression"; }; } diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index c60060f1f79..b9fa94f1956 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -124,7 +124,7 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col // auto ML_function = typeid_cast *>(func.get()); auto ML_function_Linear = typeid_cast *>(func.get()); - auto ML_function_Logic = typeid_cast *>(func.get()); + auto ML_function_Logistic = typeid_cast *>(func.get()); if (ML_function_Linear) { size_t row_num = 0; @@ -132,11 +132,11 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col ML_function_Linear->predictResultInto(val, *res, block, row_num, arguments); ++row_num; } - } else if (ML_function_Logic) + } else if (ML_function_Logistic) { size_t row_num = 0; for (auto val : data) { - ML_function_Logic->predictResultInto(val, *res, block, row_num, arguments); + ML_function_Logistic->predictResultInto(val, *res, block, row_num, arguments); ++row_num; } } else diff --git a/dbms/tests/queries/0_stateless/00901_mytest.sql b/dbms/tests/queries/0_stateless/00901_mytest.sql index e9278ecb77d..f6bf6a5978f 100644 --- a/dbms/tests/queries/0_stateless/00901_mytest.sql +++ b/dbms/tests/queries/0_stateless/00901_mytest.sql @@ -15,7 +15,7 @@ insert into test.defaults values (1,2,1,1,2), (1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2 -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); -- DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LogicRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LogisticRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; -- -- select toTypeName(state) from test.model; -- -- -- -- DROP TABLE IF EXISTS test.tests; From bfccafef49cf3a15de54f5a69e9817f99fc2c91b Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Mon, 11 Feb 2019 00:16:16 +0300 Subject: [PATCH 012/194] small test code --- .../AggregateFunctionMLMethod.h | 79 +++++++++++++++---- dbms/src/Columns/ColumnAggregateFunction.cpp | 13 ++- dbms/src/Functions/evalMLMethod.cpp | 11 +++ .../tests/queries/0_stateless/00900_stest.sql | 12 ++- ...{00900_mytest.sql => 10900_mytest_old.sql} | 14 +++- 5 files changed, 110 insertions(+), 19 deletions(-) rename dbms/tests/queries/0_stateless/{00900_mytest.sql => 10900_mytest_old.sql} (63%) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 4c85d5cff76..2cffb9cbaae 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -60,6 +60,7 @@ public: return batch_gradient; } virtual Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const = 0; + virtual void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const = 0; protected: std::vector batch_gradient; // gradient for bias lies in batch_gradient[batch_gradient.size() - 1] @@ -85,7 +86,7 @@ public: batch_gradient[weights.size()] += derivative; for (size_t i = 0; i < weights.size(); ++i) { - batch_gradient[i] += derivative * static_cast &>(*columns[i + 1]).getData()[row_num];; + batch_gradient[i] += derivative * static_cast &>(*columns[i + 1]).getData()[row_num]; } } Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const override @@ -106,6 +107,36 @@ public: return res; } + void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override + { + size_t rows_num = block.rows(); + std::cout << "\n\nROWS NUM: " << rows_num << "\n\n"; + std::vector results(rows_num, bias); + + + for (size_t i = 1; i < arguments.size(); ++i) + { + ColumnPtr cur_col = block.getByPosition(arguments[i]).column; + for (size_t row_num = 0; row_num != rows_num; ++row_num) + { + const auto &element = (*cur_col)[row_num]; + if (element.getType() != Field::Types::Float64) + throw Exception("Prediction arguments must be values of type Float", + ErrorCodes::BAD_ARGUMENTS); + + results[row_num] += weights[row_num] * element.get(); + // predict_features[i - 1] = element.get(); + } + } + + for (size_t row_num = 0; row_num != rows_num; ++row_num) + { + container.emplace_back(results[row_num]); + } +// column.getData().push_back(this->data(place).predict(predict_features)); +// column.getData().push_back(this->data(place).predict_for_all()); +// this->data(place).predict_for_all(column.getData(), block, arguments); + } }; class LogisticRegression : public IGradientComputer { @@ -149,6 +180,14 @@ public: res = 1 / (1 + exp(-res)); return res; } + void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override + { + std::ignore = container; + std::ignore = block; + std::ignore = arguments; + std::ignore = weights; + std::ignore = bias; + } }; class IWeightsUpdater @@ -191,6 +230,7 @@ public: } bias += hk_[weights.size()] / cur_batch; } + /// virtual? virtual void merge(const std::shared_ptr rhs, Float64 frac, Float64 rhs_frac) override { auto momentum_rhs = std::dynamic_pointer_cast(rhs); for (size_t i = 0; i < hk_.size(); ++i) @@ -199,9 +239,10 @@ public: } } -Float64 alpha_{0.1}; -std::vector hk_; + Float64 alpha_{0.1}; + std::vector hk_; }; + class LinearModelData { public: @@ -223,7 +264,6 @@ public: } - void add(Float64 target, const IColumn ** columns, size_t row_num) { gradient_computer->compute(weights, bias, learning_rate, target, columns, row_num); @@ -285,6 +325,10 @@ public: return gradient_computer->predict(predict_feature, weights, bias); } + void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments) const + { + gradient_computer->predict_for_all(container, block, arguments, weights, bias); + } private: std::vector weights; @@ -366,23 +410,28 @@ public: void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, size_t row_num, const ColumnNumbers & arguments) const { + std::ignore = row_num; + std::cout << "\n\n IM CALLED \n\n"; + if (arguments.size() != param_num + 1) throw Exception("Predict got incorrect number of arguments. Got: " + std::to_string(arguments.size()) + ". Required: " + std::to_string(param_num + 1), ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); auto &column = dynamic_cast &>(to); - std::vector predict_features(arguments.size() - 1); - for (size_t i = 1; i < arguments.size(); ++i) - { - const auto& element = (*block.getByPosition(arguments[i]).column)[row_num]; - if (element.getType() != Field::Types::Float64) - throw Exception("Prediction arguments must be values of type Float", - ErrorCodes::BAD_ARGUMENTS); - - predict_features[i - 1] = element.get(); - } - column.getData().push_back(this->data(place).predict(predict_features)); +// std::vector predict_features(arguments.size() - 1); +// for (size_t i = 1; i < arguments.size(); ++i) +// { +// const auto& element = (*block.getByPosition(arguments[i]).column)[row_num]; +// if (element.getType() != Field::Types::Float64) +// throw Exception("Prediction arguments must be values of type Float", +// ErrorCodes::BAD_ARGUMENTS); +// +//// predict_features[i - 1] = element.get(); +// } +// column.getData().push_back(this->data(place).predict(predict_features)); +// column.getData().push_back(this->data(place).predict_for_all()); + this->data(place).predict_for_all(column.getData(), block, arguments); } void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index b9fa94f1956..0a84242c81f 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -33,9 +33,9 @@ void ColumnAggregateFunction::addArena(ArenaPtr arena_) arenas.push_back(arena_); } -bool ColumnAggregateFunction::convertion(MutableColumnPtr* res_) const +bool ColumnAggregateFunction::convertion(MutableColumnPtr *res_) const { - if (const AggregateFunctionState * function_state = typeid_cast(func.get())) + if (const AggregateFunctionState *function_state = typeid_cast(func.get())) { auto res = createView(); res->set(function_state->getNestedFunction()); @@ -122,16 +122,25 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col return res; } + std::cout << "\n\nHELLO: " << data.size() << "\n\n"; + /// На моих тестах дважды в эту функцию приходит нечтно, имеющее data.size() == 0 однако оно по сути ничего не делает в следующих строках + if (1 != data.size()) + return res; + // auto ML_function = typeid_cast *>(func.get()); auto ML_function_Linear = typeid_cast *>(func.get()); auto ML_function_Logistic = typeid_cast *>(func.get()); if (ML_function_Linear) { size_t row_num = 0; + std::cout << "\n\nIM HERE\n" << data.size() << "\n"; for (auto val : data) { + std::cout << "HIII\n\n"; ML_function_Linear->predictResultInto(val, *res, block, row_num, arguments); ++row_num; } +// ML_function_Linear->predictResultInto(data[0], *res, block, row_num, arguments); + } else if (ML_function_Logistic) { size_t row_num = 0; diff --git a/dbms/src/Functions/evalMLMethod.cpp b/dbms/src/Functions/evalMLMethod.cpp index e299206dbd2..23e21b3605f 100644 --- a/dbms/src/Functions/evalMLMethod.cpp +++ b/dbms/src/Functions/evalMLMethod.cpp @@ -59,9 +59,20 @@ namespace DB void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override { +// const ColumnAggregateFunction * column_with_states = +// typeid_cast(static_cast(&*block.getByPosition(arguments.at(0)).column)); + + +// std::cout << "\n\n\nHELOOOOO\n\n\n"; // завести МЛ_аггр_функции как отдельный класс, чтобы тут сразу это проверять, а не делать это внутри predictValues() const ColumnAggregateFunction * column_with_states = typeid_cast(&*block.getByPosition(arguments.at(0)).column); +// std::cout << "\n\n\nHELOOOOO 2\n\n\n"; + +// const ColumnConst * column_with_states +// = typeid_cast(&*block.getByPosition(arguments.at(0)).column); + + if (!column_with_states) throw Exception("Illegal column " + block.getByPosition(arguments.at(0)).column->getName() + " of first argument of function " diff --git a/dbms/tests/queries/0_stateless/00900_stest.sql b/dbms/tests/queries/0_stateless/00900_stest.sql index 0a0acfdee11..739de5aae35 100644 --- a/dbms/tests/queries/0_stateless/00900_stest.sql +++ b/dbms/tests/queries/0_stateless/00900_stest.sql @@ -41,7 +41,17 @@ create table test.model engine = Memory as select LinearRegressionState(0.1, 5, -- -- select multiply(param1, param2) from test.defaults; -- -- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; -select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; + +-- select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; + + +-- select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; + +-- select evalMLMethod(state, 0.1, 0.2) from test.model; + +-- with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; + + -- -- select evalLinReg(state, predict1, predict2) from test.model inner join (select * from test.tests) using state; -- -- select evalLinReg(state1, predict1, predict2) from test.tests; -- diff --git a/dbms/tests/queries/0_stateless/00900_mytest.sql b/dbms/tests/queries/0_stateless/10900_mytest_old.sql similarity index 63% rename from dbms/tests/queries/0_stateless/00900_mytest.sql rename to dbms/tests/queries/0_stateless/10900_mytest_old.sql index ddb99c77d19..bdeaf50f1ae 100644 --- a/dbms/tests/queries/0_stateless/00900_mytest.sql +++ b/dbms/tests/queries/0_stateless/10900_mytest_old.sql @@ -9,9 +9,12 @@ CREATE TABLE IF NOT EXISTS test.defaults predict2 Float64 ) ENGINE = Memory; -- -- insert into test.defaults values (2.533, 0.543, 3.181), (1.999, 1.765, 0.470), (0.631, 2.580, -1.845), (-1.164, 0.889, 0.640), (2.110, 0.768, 2.519), (1.251, 0.483, 2.659), (-3.958, 1.299, -1.576), (-2.152, -1.316, 4.556), (3.269, 1.441, 1.753), (4.206, -1.635, 8.373), (-3.479, -0.544, 2.349), (4.006, 0.167, 4.670), (-4.478, 2.400, -4.039), (1.856, 0.256, 3.417), (1.470, 1.685, 0.366), (-4.052, 2.326, -3.678), (-0.971, -0.969, 4.453), (0.881, -1.848, 7.137), (-1.551, -1.766, 5.756), (-0.988, -0.945, 4.395), (-4.636, 1.074, -1.466), (-4.074, -1.486, 3.934), (0.754, 2.627, -1.877), (1.035, 0.889, 1.738), (3.707, -1.281, 7.415), (-2.215, 1.110, -0.327), (-2.965, -1.316, 4.150), (-3.581, 1.063, -0.917), (0.548, 0.343, 2.588), (3.023, -0.870, 6.251), (4.053, -1.441, 7.909), (-0.750, 0.639, 1.348), (-4.411, 1.636, -2.477), (1.786, 0.398, 3.096), (-2.514, 0.033, 1.676), (4.935, -0.840, 7.148), (1.075, -0.921, 5.380), (-3.418, 2.177, -3.063), (3.122, 1.883, 0.795), (-2.254, -1.389, 4.650), (-4.603, 2.909, -5.119), (-1.886, -1.220, 4.497), (-0.509, -1.498, 5.741), (2.192, 1.882, 0.332), (4.056, -1.108, 7.244), (-1.918, 0.230, 1.581), (4.867, 1.516, 2.401), (-0.993, -0.011, 2.526), (-0.757, -1.192, 5.006), (-4.161, 2.059, -3.198), (2.258, 1.157, 1.814), (-3.878, -0.052, 1.165), (1.915, 2.998, -2.038), (-2.164, 2.379, -2.841), (-0.114, -1.914, 6.772), (3.812, 2.138, 0.630), (-1.863, 1.508, -0.947), (-2.964, 0.398, 0.722), (-2.046, -0.193, 2.363), (-1.525, -0.836, 3.910), (-4.557, -0.582, 1.886), (1.031, -0.461, 4.437), (-0.802, 0.699, 1.201), (3.982, 2.084, 0.824), (-2.243, 2.726, -3.573), (-3.989, -0.803, 2.611), (4.900, 0.253, 4.944), (-1.208, -1.587, 5.571), (0.370, 2.579, -1.972), (2.824, 0.964, 2.484), (-1.290, -0.128, 2.611), (0.190, 2.058, -1.021), (4.058, 2.122, 0.784), (4.879, 0.945, 3.549), (1.119, 1.992, -0.424), (4.050, 2.005, 1.015), (-0.064, 1.485, -0.002), (-2.496, 0.456, 0.840), (-1.835, 1.586, -1.090), (0.603, 1.856, -0.411), (-3.062, -0.966, 3.401), (-3.351, 0.430, 0.465), (-2.724, -1.331, 4.299), (3.291, -1.027, 6.699), (-4.263, 0.785, -0.701), (-3.289, -0.886, 3.128), (4.627, 1.331, 2.651), (-0.618, 0.602, 1.486), (0.056, 1.778, -0.528), (4.823, 1.154, 3.103), (-3.983, 0.509, -0.010), (-4.474, -1.400, 3.563), (-3.782, 2.996, -4.883), (4.515, -0.656, 6.569), (1.269, 2.592, -1.549), (-1.710, -0.241, 2.627), (2.171, 1.453, 1.180), (-1.931, -1.845, 5.726), (1.767, -1.798, 7.480), (4.352, 2.369, 0.438), (-4.498, 2.611, -4.472), (0.067, 0.517, 2.000), (4.151, 0.624, 3.827), (0.409, -0.969, 5.142), (0.193, -1.713, 6.522), (-2.487, 2.827, -3.898), (-4.363, 2.011, -3.203), (-2.383, 2.554, -3.299), (-4.457, -0.958, 2.687), (3.342, -0.360, 5.392), (0.902, 2.978, -2.505), (4.073, -1.524, 8.084), (3.036, 1.672, 1.173), (2.169, -0.564, 5.213), (-4.780, 0.962, -1.313), (-1.815, 2.096, -2.100), (-1.445, 0.458, 1.362), (1.891, -1.437, 6.820), (1.942, -1.761, 7.493), (-4.613, -1.551, 3.795), (-3.472, -1.110, 3.485), (-2.026, 1.961, -1.935), (0.091, -0.961, 4.967), (3.902, -1.336, 7.622), (-3.483, -0.769, 2.796), (-0.066, -1.233, 5.433), (2.597, 2.789, -1.280), (-1.657, -1.842, 5.856), (0.232, -1.420, 5.957), (-3.321, 1.609, -1.879), (2.673, 2.781, -1.226), (0.869, 0.072, 3.291), (1.444, -1.271, 6.264), (1.190, 1.460, 0.675), (3.497, 0.870, 3.008), (-2.884, -1.303, 4.163), (3.620, 0.381, 4.047), (2.594, 0.247, 3.803), (-3.902, -1.315, 3.678), (-4.753, -1.005, 2.634), (0.881, 0.675, 2.091), (0.414, 2.071, -0.935), (3.458, -0.920, 6.568), (-2.986, -0.411, 2.329), (3.076, -1.960, 8.458), (2.951, 2.988, -1.501), (2.408, 1.301, 1.603), (4.725, 0.366, 4.631), (4.924, -1.762, 8.985), (3.719, 0.970, 2.920), (-0.295, 0.257, 2.340), (-4.607, 2.548, -4.400), (0.288, 1.953, -0.761), (-3.311, 0.844, -0.344), (3.679, -0.642, 6.123), (-2.310, -0.838, 3.522), (-4.397, -0.226, 1.254), (-4.366, -0.024, 0.864), (2.405, 1.458, 1.286), (-4.296, -1.071, 2.994), (0.452, -1.901, 7.028), (-0.214, -0.467, 3.827), (2.559, 1.547, 1.185), (0.990, 1.539, 0.417), (0.478, -0.089, 3.417), (-2.734, -1.007, 3.646), (3.483, 0.247, 4.247), (3.507, 2.727, -0.701), (-4.399, 2.437, -4.073), (3.785, 0.036, 4.820), (-0.824, 2.417, -2.245), (-2.588, 0.369, 0.968), (-3.037, -1.639, 4.759), (4.531, -0.499, 6.264), (4.742, -1.161, 7.693), (-0.063, -0.595, 4.159), (0.697, 2.281, -1.212), (0.413, 0.607, 1.992), (-4.081, 0.383, 0.194), (0.712, 2.638, -1.920), (-1.620, 1.092, 0.006), (-3.425, -0.911, 3.109), (-0.124, 1.711, -0.484), (4.347, 1.387, 2.399), (-3.237, -0.900, 3.182), (-3.961, 0.358, 0.304), (4.326, -0.068, 5.298), (3.846, 1.725, 1.473), (-2.089, 0.953, 0.049), (-1.025, -1.470, 5.428), (2.061, -0.156, 4.343), (1.547, -1.827, 7.427), (2.786, 0.460, 3.473), (0.076, 0.659, 1.720), (3.597, 1.966, 0.866), (-0.933, -1.180, 4.894), (4.647, 1.190, 2.943), (-0.032, 0.544, 1.896), (4.461, -1.806, 8.843), (-0.586, 1.821, -0.934), (3.725, 1.715, 1.432), (-2.091, 2.714, -3.474), (4.494, -1.494, 8.236), (3.766, -0.209, 5.301), (-1.991, 1.776, -1.548), (-4.992, -0.742, 1.989), (-2.400, 1.828, -1.855), (-1.329, 0.143, 2.050), (1.954, 1.759, 0.459), (-4.422, 1.507, -2.224), (-2.243, -1.126, 4.131), (4.417, -1.080, 7.368), (1.737, -1.144, 6.157), (2.661, -1.084, 6.498), (-3.198, 0.443, 0.515), (4.191, -1.250, 7.596), (-2.419, -0.163, 2.116), (1.910, -1.173, 6.301), (-0.241, 1.902, -0.925), (-4.415, 2.479, -4.165), (3.307, -0.465, 5.583), (-2.382, 1.364, -0.920), (-3.154, 2.953, -4.483), (-2.562, 2.803, -3.888), (3.076, 0.195, 4.149), (-0.101, 0.896, 1.157), (-2.067, 1.120, -0.273), (-4.680, 2.756, -4.851), (-4.283, -0.607, 2.072), (4.013, -1.072, 7.150), (-4.401, -0.896, 2.591), (4.544, 2.498, 0.276), (4.075, -1.204, 7.445), (-3.463, 1.242, -1.216), (3.992, 2.782, -0.568), (-4.503, 0.239, 0.270), (-3.095, 1.161, -0.870), (0.768, -0.904, 5.192), (1.255, 2.870, -2.112), (-1.537, -0.049, 2.330), (2.851, -1.182, 6.789), (1.974, -0.922, 5.832), (4.447, 2.719, -0.214), (-3.413, 0.555, 0.184), (4.943, 2.120, 1.231), (3.645, -0.413, 5.648), (-4.776, 0.079, 0.453), (1.991, 1.565, 0.866), (2.413, 1.793, 0.620), (4.245, 2.663, -0.205), (-2.022, -1.180, 4.350), (-2.285, -1.246, 4.350), (2.276, 0.488, 3.162), (2.582, -0.037, 4.365), (-4.875, 1.468, -2.374), (-2.492, 2.730, -3.706), (2.696, -1.833, 8.013), (4.618, -1.127, 7.563), (-4.156, 0.987, -1.053), (1.873, -1.566, 7.068), (1.699, 0.794, 2.262), (-3.181, 1.640, -1.871), (-3.225, 1.526, -1.664), (-2.679, -1.811, 5.281), (3.717, 1.532, 1.794), (1.288, -0.999, 5.642), (-1.057, 0.044, 2.384), (-0.147, 1.108, 0.711), (-3.827, -1.139, 3.365), (0.872, -1.482, 6.399), (1.982, 0.286, 3.418), (-1.381, 2.374, -2.439), (-1.091, 2.010, -1.565), (-1.192, 2.751, -3.097), (1.468, -0.992, 5.718), (2.249, 0.949, 2.228), (3.064, 0.911, 2.711), (-1.576, -1.584, 5.380), (2.130, -1.489, 7.043), (4.386, -1.284, 7.761), (1.662, -1.645, 7.121), (-3.395, 1.784, -2.265), (4.618, 1.951, 1.406), (-0.299, 0.378, 2.095), (-2.911, 2.131, -2.717), (0.876, 2.869, -2.301), (-1.785, 0.961, 0.186), (-4.188, 2.442, -3.977), (-1.128, 0.127, 2.181), (1.755, -1.215, 6.307), (-2.276, 0.596, 0.669), (-4.630, 1.978, -3.272), (-0.454, 0.275, 2.224), (-1.950, -1.385, 4.794), (-0.889, 2.696, -2.837), (-4.832, -0.038, 0.661), (3.738, 0.604, 3.662), (-0.224, -0.465, 3.819); -insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +-- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); -- + +insert into test.defaults values (-1.0, -2.0, 3.5, 20.0, 40.0); + DROP TABLE IF EXISTS test.model; create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; -- -- select toTypeName(state) from test.model; @@ -41,7 +44,16 @@ create table test.model engine = Memory as select LinearRegressionState(0.1, 5, -- -- select multiply(param1, param2) from test.defaults; -- -- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; + + + select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; + + +-- select evalMLMethod(state, 0.1, 0.2) from test.model; +-- with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; + + -- -- select evalLinReg(state, predict1, predict2) from test.model inner join (select * from test.tests) using state; -- -- select evalLinReg(state1, predict1, predict2) from test.tests; -- From fc4c721fa557fa46823756291517299fb2529db4 Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Mon, 11 Feb 2019 01:07:47 +0300 Subject: [PATCH 013/194] some review fixes --- .../AggregateFunctionMLMethod.h | 81 ++++++++++--------- dbms/src/Columns/ColumnAggregateFunction.cpp | 6 +- .../tests/queries/0_stateless/00900_stest.sql | 48 ----------- 3 files changed, 48 insertions(+), 87 deletions(-) delete mode 100644 dbms/tests/queries/0_stateless/00900_stest.sql diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 4c85d5cff76..545b278cce5 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -78,14 +78,14 @@ public: Float64 derivative = (target - bias); for (size_t i = 0; i < weights.size(); ++i) { - derivative -= weights[i] * static_cast &>(*columns[i + 1]).getData()[row_num]; + derivative -= weights[i] * static_cast &>(*columns[i]).getData()[row_num]; } derivative *= (2 * learning_rate); batch_gradient[weights.size()] += derivative; for (size_t i = 0; i < weights.size(); ++i) { - batch_gradient[i] += derivative * static_cast &>(*columns[i + 1]).getData()[row_num];; + batch_gradient[i] += derivative * static_cast &>(*columns[i]).getData()[row_num];; } } Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const override @@ -107,6 +107,7 @@ public: return res; } }; + class LogisticRegression : public IGradientComputer { public: @@ -120,7 +121,7 @@ public: Float64 derivative = bias; for (size_t i = 0; i < weights.size(); ++i) { - derivative += weights[i] * static_cast &>(*columns[i + 1]).getData()[row_num];; + derivative += weights[i] * static_cast &>(*columns[i]).getData()[row_num];; } derivative *= target; derivative = learning_rate * exp(derivative); @@ -128,7 +129,7 @@ public: batch_gradient[weights.size()] += target / (derivative + 1);; for (size_t i = 0; i < weights.size(); ++i) { - batch_gradient[i] += target / (derivative + 1) * static_cast &>(*columns[i + 1]).getData()[row_num]; + batch_gradient[i] += target / (derivative + 1) * static_cast &>(*columns[i]).getData()[row_num]; } } Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const override @@ -156,27 +157,32 @@ class IWeightsUpdater public: virtual ~IWeightsUpdater() = default; - virtual void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & gradient) = 0; - virtual void merge(const std::shared_ptr, Float64, Float64) {} + virtual void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & gradient) = 0; + virtual void merge(const IWeightsUpdater &, Float64, Float64) {} }; class StochasticGradientDescent : public IWeightsUpdater { public: - void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + /// batch_size is already checked to be greater than 0 + for (size_t i = 0; i < weights.size(); ++i) { - weights[i] += batch_gradient[i] / cur_batch; + weights[i] += batch_gradient[i] / batch_size; } - bias += batch_gradient[weights.size()] / cur_batch; + bias += batch_gradient[weights.size()] / batch_size; } }; + class Momentum : public IWeightsUpdater { public: Momentum() {} Momentum (Float64 alpha) : alpha_(alpha) {} - void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + /// batch_size is already checked to be greater than 0 + if (hk_.size() == 0) { hk_.resize(batch_gradient.size(), Float64{0.0}); @@ -187,21 +193,23 @@ public: } for (size_t i = 0; i < weights.size(); ++i) { - weights[i] += hk_[i] / cur_batch; + weights[i] += hk_[i] / batch_size; } - bias += hk_[weights.size()] / cur_batch; + bias += hk_[weights.size()] / batch_size; } - virtual void merge(const std::shared_ptr rhs, Float64 frac, Float64 rhs_frac) override { - auto momentum_rhs = std::dynamic_pointer_cast(rhs); + virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override { + const auto & momentum_rhs = dynamic_cast(rhs); for (size_t i = 0; i < hk_.size(); ++i) { - hk_[i] = hk_[i] * frac + momentum_rhs->hk_[i] * rhs_frac; + hk_[i] = hk_[i] * frac + momentum_rhs.hk_[i] * rhs_frac; } } -Float64 alpha_{0.1}; -std::vector hk_; +private: + Float64 alpha_{0.1}; + std::vector hk_; }; + class LinearModelData { public: @@ -210,25 +218,26 @@ public: LinearModelData(Float64 learning_rate, UInt32 param_num, - UInt32 batch_size, + UInt32 batch_capacity, std::shared_ptr gc, std::shared_ptr wu) : learning_rate(learning_rate), - batch_size(batch_size), + batch_capacity(batch_capacity), gradient_computer(std::move(gc)), weights_updater(std::move(wu)) { weights.resize(param_num, Float64{0.0}); - cur_batch = 0; + batch_size = 0; } - - - void add(Float64 target, const IColumn ** columns, size_t row_num) + void add(const IColumn ** columns, size_t row_num) { - gradient_computer->compute(weights, bias, learning_rate, target, columns, row_num); - ++cur_batch; - if (cur_batch == batch_size) + /// first column stores target; features start from (columns + 1) + const auto & target = static_cast &>(*columns[0]).getData()[row_num]; + + gradient_computer->compute(weights, bias, learning_rate, target, columns + 1, row_num); + ++batch_size; + if (batch_size == batch_capacity) { update_state(); } @@ -253,7 +262,7 @@ public: bias = bias * frac + rhs.bias * rhs_frac; iter_num += rhs.iter_num; - weights_updater->merge(rhs.weights_updater, frac, rhs_frac); + weights_updater->merge(*rhs.weights_updater, frac, rhs_frac); } void write(WriteBuffer & buf) const @@ -261,7 +270,7 @@ public: writeBinary(bias, buf); writeBinary(weights, buf); writeBinary(iter_num, buf); - writeBinary(cur_batch, buf); + writeBinary(batch_size, buf); gradient_computer->write(buf); } @@ -270,7 +279,7 @@ public: readBinary(bias, buf); readBinary(weights, buf); readBinary(iter_num, buf); - readBinary(cur_batch, buf); + readBinary(batch_size, buf); gradient_computer->read(buf); } @@ -289,20 +298,20 @@ public: private: std::vector weights; Float64 learning_rate; - UInt32 batch_size; + UInt32 batch_capacity; Float64 bias{0.0}; UInt32 iter_num = 0; - UInt32 cur_batch; + UInt32 batch_size; std::shared_ptr gradient_computer; std::shared_ptr weights_updater; void update_state() { - if (cur_batch == 0) + if (batch_size == 0) return; - weights_updater->update(cur_batch, weights, bias, gradient_computer->get()); - cur_batch = 0; + weights_updater->update(batch_size, weights, bias, gradient_computer->get()); + batch_size = 0; ++iter_num; gradient_computer->reset(); } @@ -343,9 +352,7 @@ public: void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override { - const auto & target = static_cast &>(*columns[0]); - - this->data(place).add(target.getData()[row_num], columns, row_num); + this->data(place).add(columns, row_num); } /// хочется не константный rhs diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index b9fa94f1956..2afb75ee4b1 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -128,14 +128,16 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col if (ML_function_Linear) { size_t row_num = 0; - for (auto val : data) { + for (auto val : data) + { ML_function_Linear->predictResultInto(val, *res, block, row_num, arguments); ++row_num; } } else if (ML_function_Logistic) { size_t row_num = 0; - for (auto val : data) { + for (auto val : data) + { ML_function_Logistic->predictResultInto(val, *res, block, row_num, arguments); ++row_num; } diff --git a/dbms/tests/queries/0_stateless/00900_stest.sql b/dbms/tests/queries/0_stateless/00900_stest.sql deleted file mode 100644 index 0a0acfdee11..00000000000 --- a/dbms/tests/queries/0_stateless/00900_stest.sql +++ /dev/null @@ -1,48 +0,0 @@ -CREATE DATABASE IF NOT EXISTS test; -DROP TABLE IF EXISTS test.defaults; -CREATE TABLE IF NOT EXISTS test.defaults -( - param1 Float64, - param2 Float64, - target Float64, - predict1 Float64, - predict2 Float64 -) ENGINE = Memory; --- -- insert into test.defaults values (2.533, 0.543, 3.181), (1.999, 1.765, 0.470), (0.631, 2.580, -1.845), (-1.164, 0.889, 0.640), (2.110, 0.768, 2.519), (1.251, 0.483, 2.659), (-3.958, 1.299, -1.576), (-2.152, -1.316, 4.556), (3.269, 1.441, 1.753), (4.206, -1.635, 8.373), (-3.479, -0.544, 2.349), (4.006, 0.167, 4.670), (-4.478, 2.400, -4.039), (1.856, 0.256, 3.417), (1.470, 1.685, 0.366), (-4.052, 2.326, -3.678), (-0.971, -0.969, 4.453), (0.881, -1.848, 7.137), (-1.551, -1.766, 5.756), (-0.988, -0.945, 4.395), (-4.636, 1.074, -1.466), (-4.074, -1.486, 3.934), (0.754, 2.627, -1.877), (1.035, 0.889, 1.738), (3.707, -1.281, 7.415), (-2.215, 1.110, -0.327), (-2.965, -1.316, 4.150), (-3.581, 1.063, -0.917), (0.548, 0.343, 2.588), (3.023, -0.870, 6.251), (4.053, -1.441, 7.909), (-0.750, 0.639, 1.348), (-4.411, 1.636, -2.477), (1.786, 0.398, 3.096), (-2.514, 0.033, 1.676), (4.935, -0.840, 7.148), (1.075, -0.921, 5.380), (-3.418, 2.177, -3.063), (3.122, 1.883, 0.795), (-2.254, -1.389, 4.650), (-4.603, 2.909, -5.119), (-1.886, -1.220, 4.497), (-0.509, -1.498, 5.741), (2.192, 1.882, 0.332), (4.056, -1.108, 7.244), (-1.918, 0.230, 1.581), (4.867, 1.516, 2.401), (-0.993, -0.011, 2.526), (-0.757, -1.192, 5.006), (-4.161, 2.059, -3.198), (2.258, 1.157, 1.814), (-3.878, -0.052, 1.165), (1.915, 2.998, -2.038), (-2.164, 2.379, -2.841), (-0.114, -1.914, 6.772), (3.812, 2.138, 0.630), (-1.863, 1.508, -0.947), (-2.964, 0.398, 0.722), (-2.046, -0.193, 2.363), (-1.525, -0.836, 3.910), (-4.557, -0.582, 1.886), (1.031, -0.461, 4.437), (-0.802, 0.699, 1.201), (3.982, 2.084, 0.824), (-2.243, 2.726, -3.573), (-3.989, -0.803, 2.611), (4.900, 0.253, 4.944), (-1.208, -1.587, 5.571), (0.370, 2.579, -1.972), (2.824, 0.964, 2.484), (-1.290, -0.128, 2.611), (0.190, 2.058, -1.021), (4.058, 2.122, 0.784), (4.879, 0.945, 3.549), (1.119, 1.992, -0.424), (4.050, 2.005, 1.015), (-0.064, 1.485, -0.002), (-2.496, 0.456, 0.840), (-1.835, 1.586, -1.090), (0.603, 1.856, -0.411), (-3.062, -0.966, 3.401), (-3.351, 0.430, 0.465), (-2.724, -1.331, 4.299), (3.291, -1.027, 6.699), (-4.263, 0.785, -0.701), (-3.289, -0.886, 3.128), (4.627, 1.331, 2.651), (-0.618, 0.602, 1.486), (0.056, 1.778, -0.528), (4.823, 1.154, 3.103), (-3.983, 0.509, -0.010), (-4.474, -1.400, 3.563), (-3.782, 2.996, -4.883), (4.515, -0.656, 6.569), (1.269, 2.592, -1.549), (-1.710, -0.241, 2.627), (2.171, 1.453, 1.180), (-1.931, -1.845, 5.726), (1.767, -1.798, 7.480), (4.352, 2.369, 0.438), (-4.498, 2.611, -4.472), (0.067, 0.517, 2.000), (4.151, 0.624, 3.827), (0.409, -0.969, 5.142), (0.193, -1.713, 6.522), (-2.487, 2.827, -3.898), (-4.363, 2.011, -3.203), (-2.383, 2.554, -3.299), (-4.457, -0.958, 2.687), (3.342, -0.360, 5.392), (0.902, 2.978, -2.505), (4.073, -1.524, 8.084), (3.036, 1.672, 1.173), (2.169, -0.564, 5.213), (-4.780, 0.962, -1.313), (-1.815, 2.096, -2.100), (-1.445, 0.458, 1.362), (1.891, -1.437, 6.820), (1.942, -1.761, 7.493), (-4.613, -1.551, 3.795), (-3.472, -1.110, 3.485), (-2.026, 1.961, -1.935), (0.091, -0.961, 4.967), (3.902, -1.336, 7.622), (-3.483, -0.769, 2.796), (-0.066, -1.233, 5.433), (2.597, 2.789, -1.280), (-1.657, -1.842, 5.856), (0.232, -1.420, 5.957), (-3.321, 1.609, -1.879), (2.673, 2.781, -1.226), (0.869, 0.072, 3.291), (1.444, -1.271, 6.264), (1.190, 1.460, 0.675), (3.497, 0.870, 3.008), (-2.884, -1.303, 4.163), (3.620, 0.381, 4.047), (2.594, 0.247, 3.803), (-3.902, -1.315, 3.678), (-4.753, -1.005, 2.634), (0.881, 0.675, 2.091), (0.414, 2.071, -0.935), (3.458, -0.920, 6.568), (-2.986, -0.411, 2.329), (3.076, -1.960, 8.458), (2.951, 2.988, -1.501), (2.408, 1.301, 1.603), (4.725, 0.366, 4.631), (4.924, -1.762, 8.985), (3.719, 0.970, 2.920), (-0.295, 0.257, 2.340), (-4.607, 2.548, -4.400), (0.288, 1.953, -0.761), (-3.311, 0.844, -0.344), (3.679, -0.642, 6.123), (-2.310, -0.838, 3.522), (-4.397, -0.226, 1.254), (-4.366, -0.024, 0.864), (2.405, 1.458, 1.286), (-4.296, -1.071, 2.994), (0.452, -1.901, 7.028), (-0.214, -0.467, 3.827), (2.559, 1.547, 1.185), (0.990, 1.539, 0.417), (0.478, -0.089, 3.417), (-2.734, -1.007, 3.646), (3.483, 0.247, 4.247), (3.507, 2.727, -0.701), (-4.399, 2.437, -4.073), (3.785, 0.036, 4.820), (-0.824, 2.417, -2.245), (-2.588, 0.369, 0.968), (-3.037, -1.639, 4.759), (4.531, -0.499, 6.264), (4.742, -1.161, 7.693), (-0.063, -0.595, 4.159), (0.697, 2.281, -1.212), (0.413, 0.607, 1.992), (-4.081, 0.383, 0.194), (0.712, 2.638, -1.920), (-1.620, 1.092, 0.006), (-3.425, -0.911, 3.109), (-0.124, 1.711, -0.484), (4.347, 1.387, 2.399), (-3.237, -0.900, 3.182), (-3.961, 0.358, 0.304), (4.326, -0.068, 5.298), (3.846, 1.725, 1.473), (-2.089, 0.953, 0.049), (-1.025, -1.470, 5.428), (2.061, -0.156, 4.343), (1.547, -1.827, 7.427), (2.786, 0.460, 3.473), (0.076, 0.659, 1.720), (3.597, 1.966, 0.866), (-0.933, -1.180, 4.894), (4.647, 1.190, 2.943), (-0.032, 0.544, 1.896), (4.461, -1.806, 8.843), (-0.586, 1.821, -0.934), (3.725, 1.715, 1.432), (-2.091, 2.714, -3.474), (4.494, -1.494, 8.236), (3.766, -0.209, 5.301), (-1.991, 1.776, -1.548), (-4.992, -0.742, 1.989), (-2.400, 1.828, -1.855), (-1.329, 0.143, 2.050), (1.954, 1.759, 0.459), (-4.422, 1.507, -2.224), (-2.243, -1.126, 4.131), (4.417, -1.080, 7.368), (1.737, -1.144, 6.157), (2.661, -1.084, 6.498), (-3.198, 0.443, 0.515), (4.191, -1.250, 7.596), (-2.419, -0.163, 2.116), (1.910, -1.173, 6.301), (-0.241, 1.902, -0.925), (-4.415, 2.479, -4.165), (3.307, -0.465, 5.583), (-2.382, 1.364, -0.920), (-3.154, 2.953, -4.483), (-2.562, 2.803, -3.888), (3.076, 0.195, 4.149), (-0.101, 0.896, 1.157), (-2.067, 1.120, -0.273), (-4.680, 2.756, -4.851), (-4.283, -0.607, 2.072), (4.013, -1.072, 7.150), (-4.401, -0.896, 2.591), (4.544, 2.498, 0.276), (4.075, -1.204, 7.445), (-3.463, 1.242, -1.216), (3.992, 2.782, -0.568), (-4.503, 0.239, 0.270), (-3.095, 1.161, -0.870), (0.768, -0.904, 5.192), (1.255, 2.870, -2.112), (-1.537, -0.049, 2.330), (2.851, -1.182, 6.789), (1.974, -0.922, 5.832), (4.447, 2.719, -0.214), (-3.413, 0.555, 0.184), (4.943, 2.120, 1.231), (3.645, -0.413, 5.648), (-4.776, 0.079, 0.453), (1.991, 1.565, 0.866), (2.413, 1.793, 0.620), (4.245, 2.663, -0.205), (-2.022, -1.180, 4.350), (-2.285, -1.246, 4.350), (2.276, 0.488, 3.162), (2.582, -0.037, 4.365), (-4.875, 1.468, -2.374), (-2.492, 2.730, -3.706), (2.696, -1.833, 8.013), (4.618, -1.127, 7.563), (-4.156, 0.987, -1.053), (1.873, -1.566, 7.068), (1.699, 0.794, 2.262), (-3.181, 1.640, -1.871), (-3.225, 1.526, -1.664), (-2.679, -1.811, 5.281), (3.717, 1.532, 1.794), (1.288, -0.999, 5.642), (-1.057, 0.044, 2.384), (-0.147, 1.108, 0.711), (-3.827, -1.139, 3.365), (0.872, -1.482, 6.399), (1.982, 0.286, 3.418), (-1.381, 2.374, -2.439), (-1.091, 2.010, -1.565), (-1.192, 2.751, -3.097), (1.468, -0.992, 5.718), (2.249, 0.949, 2.228), (3.064, 0.911, 2.711), (-1.576, -1.584, 5.380), (2.130, -1.489, 7.043), (4.386, -1.284, 7.761), (1.662, -1.645, 7.121), (-3.395, 1.784, -2.265), (4.618, 1.951, 1.406), (-0.299, 0.378, 2.095), (-2.911, 2.131, -2.717), (0.876, 2.869, -2.301), (-1.785, 0.961, 0.186), (-4.188, 2.442, -3.977), (-1.128, 0.127, 2.181), (1.755, -1.215, 6.307), (-2.276, 0.596, 0.669), (-4.630, 1.978, -3.272), (-0.454, 0.275, 2.224), (-1.950, -1.385, 4.794), (-0.889, 2.696, -2.837), (-4.832, -0.038, 0.661), (3.738, 0.604, 3.662), (-0.224, -0.465, 3.819); -insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); --- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); --- -DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; --- -- select toTypeName(state) from test.model; --- -- --- -- DROP TABLE IF EXISTS test.tests; --- -- CREATE TABLE IF NOT EXISTS test.tests --- -- ( --- -- predict1 Float64, --- -- predict2 Float64, --- -- state1 AggregateFunction(LinReg(0.01), Float64, Float64, Float64) --- -- ) ENGINE = Memory; --- -- insert into test.tests select 20.0, 40.0, LinRegState(0.01)(target, param1, param2) from test.defaults; --- -- select evalLinReg(state1, predict1, predict2) from test.tests; --- --- --- --- -- DROP TABLE IF EXISTS test.prediction; --- -- CREATE TABLE IF NOT EXISTS test.prediction --- -- ( --- -- predict1 Float64, --- -- predict2 Float64 --- -- ) ENGINE = Memory; --- --- --- -- insert into test.prediction values (20.0, 40.0); --- --- -- select multiply(param1, param2) from test.defaults; --- --- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; -select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; --- -- select evalLinReg(state, predict1, predict2) from test.model inner join (select * from test.tests) using state; --- -- select evalLinReg(state1, predict1, predict2) from test.tests; --- --- -- select negate(target) from test.defaults; From 6a8542c8f6e524607b08e3ab00b02a0b3fb36d99 Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Wed, 13 Feb 2019 00:18:27 +0300 Subject: [PATCH 014/194] constructor changes change --- .../AggregateFunctions/AggregateFunctionMLMethod.cpp | 2 +- .../AggregateFunctions/AggregateFunctionMLMethod.h | 7 +++++-- ...0900_mytest.reference => 00950_ml_test.reference} | 0 .../{00900_stest.sql => 00950_ml_test.sql} | 12 +++++++----- 4 files changed, 13 insertions(+), 8 deletions(-) rename dbms/tests/queries/0_stateless/{00900_mytest.reference => 00950_ml_test.reference} (100%) rename dbms/tests/queries/0_stateless/{00900_stest.sql => 00950_ml_test.sql} (63%) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 116a62b8408..04d31f918d0 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -73,7 +73,7 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (argument_types.size() < 2) throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); - return std::make_shared(argument_types.size() - 1, gc, wu, learning_rate, batch_size); + return std::make_shared(argument_types.size() - 1, gc, wu, learning_rate, batch_size, argument_types, parameters); } } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 9fde4174d4f..f9e12832f15 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -375,8 +375,11 @@ public: std::shared_ptr gradient_computer, std::shared_ptr weights_updater, Float64 learning_rate, - UInt32 batch_size) - : param_num(param_num), + UInt32 batch_size, + const DataTypes & argument_types, + const Array & params) + : IAggregateFunctionDataHelper>(argument_types, params), + param_num(param_num), learning_rate(learning_rate), batch_size(batch_size), gc(std::move(gradient_computer)), diff --git a/dbms/tests/queries/0_stateless/00900_mytest.reference b/dbms/tests/queries/0_stateless/00950_ml_test.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00900_mytest.reference rename to dbms/tests/queries/0_stateless/00950_ml_test.reference diff --git a/dbms/tests/queries/0_stateless/00900_stest.sql b/dbms/tests/queries/0_stateless/00950_ml_test.sql similarity index 63% rename from dbms/tests/queries/0_stateless/00900_stest.sql rename to dbms/tests/queries/0_stateless/00950_ml_test.sql index 739de5aae35..4c1abb78bb6 100644 --- a/dbms/tests/queries/0_stateless/00900_stest.sql +++ b/dbms/tests/queries/0_stateless/00950_ml_test.sql @@ -1,6 +1,6 @@ CREATE DATABASE IF NOT EXISTS test; -DROP TABLE IF EXISTS test.defaults; -CREATE TABLE IF NOT EXISTS test.defaults +DROP TABLE IF EXISTS test.mldata; +CREATE TABLE IF NOT EXISTS test.mldata ( param1 Float64, param2 Float64, @@ -9,11 +9,13 @@ CREATE TABLE IF NOT EXISTS test.defaults predict2 Float64 ) ENGINE = Memory; -- -- insert into test.defaults values (2.533, 0.543, 3.181), (1.999, 1.765, 0.470), (0.631, 2.580, -1.845), (-1.164, 0.889, 0.640), (2.110, 0.768, 2.519), (1.251, 0.483, 2.659), (-3.958, 1.299, -1.576), (-2.152, -1.316, 4.556), (3.269, 1.441, 1.753), (4.206, -1.635, 8.373), (-3.479, -0.544, 2.349), (4.006, 0.167, 4.670), (-4.478, 2.400, -4.039), (1.856, 0.256, 3.417), (1.470, 1.685, 0.366), (-4.052, 2.326, -3.678), (-0.971, -0.969, 4.453), (0.881, -1.848, 7.137), (-1.551, -1.766, 5.756), (-0.988, -0.945, 4.395), (-4.636, 1.074, -1.466), (-4.074, -1.486, 3.934), (0.754, 2.627, -1.877), (1.035, 0.889, 1.738), (3.707, -1.281, 7.415), (-2.215, 1.110, -0.327), (-2.965, -1.316, 4.150), (-3.581, 1.063, -0.917), (0.548, 0.343, 2.588), (3.023, -0.870, 6.251), (4.053, -1.441, 7.909), (-0.750, 0.639, 1.348), (-4.411, 1.636, -2.477), (1.786, 0.398, 3.096), (-2.514, 0.033, 1.676), (4.935, -0.840, 7.148), (1.075, -0.921, 5.380), (-3.418, 2.177, -3.063), (3.122, 1.883, 0.795), (-2.254, -1.389, 4.650), (-4.603, 2.909, -5.119), (-1.886, -1.220, 4.497), (-0.509, -1.498, 5.741), (2.192, 1.882, 0.332), (4.056, -1.108, 7.244), (-1.918, 0.230, 1.581), (4.867, 1.516, 2.401), (-0.993, -0.011, 2.526), (-0.757, -1.192, 5.006), (-4.161, 2.059, -3.198), (2.258, 1.157, 1.814), (-3.878, -0.052, 1.165), (1.915, 2.998, -2.038), (-2.164, 2.379, -2.841), (-0.114, -1.914, 6.772), (3.812, 2.138, 0.630), (-1.863, 1.508, -0.947), (-2.964, 0.398, 0.722), (-2.046, -0.193, 2.363), (-1.525, -0.836, 3.910), (-4.557, -0.582, 1.886), (1.031, -0.461, 4.437), (-0.802, 0.699, 1.201), (3.982, 2.084, 0.824), (-2.243, 2.726, -3.573), (-3.989, -0.803, 2.611), (4.900, 0.253, 4.944), (-1.208, -1.587, 5.571), (0.370, 2.579, -1.972), (2.824, 0.964, 2.484), (-1.290, -0.128, 2.611), (0.190, 2.058, -1.021), (4.058, 2.122, 0.784), (4.879, 0.945, 3.549), (1.119, 1.992, -0.424), (4.050, 2.005, 1.015), (-0.064, 1.485, -0.002), (-2.496, 0.456, 0.840), (-1.835, 1.586, -1.090), (0.603, 1.856, -0.411), (-3.062, -0.966, 3.401), (-3.351, 0.430, 0.465), (-2.724, -1.331, 4.299), (3.291, -1.027, 6.699), (-4.263, 0.785, -0.701), (-3.289, -0.886, 3.128), (4.627, 1.331, 2.651), (-0.618, 0.602, 1.486), (0.056, 1.778, -0.528), (4.823, 1.154, 3.103), (-3.983, 0.509, -0.010), (-4.474, -1.400, 3.563), (-3.782, 2.996, -4.883), (4.515, -0.656, 6.569), (1.269, 2.592, -1.549), (-1.710, -0.241, 2.627), (2.171, 1.453, 1.180), (-1.931, -1.845, 5.726), (1.767, -1.798, 7.480), (4.352, 2.369, 0.438), (-4.498, 2.611, -4.472), (0.067, 0.517, 2.000), (4.151, 0.624, 3.827), (0.409, -0.969, 5.142), (0.193, -1.713, 6.522), (-2.487, 2.827, -3.898), (-4.363, 2.011, -3.203), (-2.383, 2.554, -3.299), (-4.457, -0.958, 2.687), (3.342, -0.360, 5.392), (0.902, 2.978, -2.505), (4.073, -1.524, 8.084), (3.036, 1.672, 1.173), (2.169, -0.564, 5.213), (-4.780, 0.962, -1.313), (-1.815, 2.096, -2.100), (-1.445, 0.458, 1.362), (1.891, -1.437, 6.820), (1.942, -1.761, 7.493), (-4.613, -1.551, 3.795), (-3.472, -1.110, 3.485), (-2.026, 1.961, -1.935), (0.091, -0.961, 4.967), (3.902, -1.336, 7.622), (-3.483, -0.769, 2.796), (-0.066, -1.233, 5.433), (2.597, 2.789, -1.280), (-1.657, -1.842, 5.856), (0.232, -1.420, 5.957), (-3.321, 1.609, -1.879), (2.673, 2.781, -1.226), (0.869, 0.072, 3.291), (1.444, -1.271, 6.264), (1.190, 1.460, 0.675), (3.497, 0.870, 3.008), (-2.884, -1.303, 4.163), (3.620, 0.381, 4.047), (2.594, 0.247, 3.803), (-3.902, -1.315, 3.678), (-4.753, -1.005, 2.634), (0.881, 0.675, 2.091), (0.414, 2.071, -0.935), (3.458, -0.920, 6.568), (-2.986, -0.411, 2.329), (3.076, -1.960, 8.458), (2.951, 2.988, -1.501), (2.408, 1.301, 1.603), (4.725, 0.366, 4.631), (4.924, -1.762, 8.985), (3.719, 0.970, 2.920), (-0.295, 0.257, 2.340), (-4.607, 2.548, -4.400), (0.288, 1.953, -0.761), (-3.311, 0.844, -0.344), (3.679, -0.642, 6.123), (-2.310, -0.838, 3.522), (-4.397, -0.226, 1.254), (-4.366, -0.024, 0.864), (2.405, 1.458, 1.286), (-4.296, -1.071, 2.994), (0.452, -1.901, 7.028), (-0.214, -0.467, 3.827), (2.559, 1.547, 1.185), (0.990, 1.539, 0.417), (0.478, -0.089, 3.417), (-2.734, -1.007, 3.646), (3.483, 0.247, 4.247), (3.507, 2.727, -0.701), (-4.399, 2.437, -4.073), (3.785, 0.036, 4.820), (-0.824, 2.417, -2.245), (-2.588, 0.369, 0.968), (-3.037, -1.639, 4.759), (4.531, -0.499, 6.264), (4.742, -1.161, 7.693), (-0.063, -0.595, 4.159), (0.697, 2.281, -1.212), (0.413, 0.607, 1.992), (-4.081, 0.383, 0.194), (0.712, 2.638, -1.920), (-1.620, 1.092, 0.006), (-3.425, -0.911, 3.109), (-0.124, 1.711, -0.484), (4.347, 1.387, 2.399), (-3.237, -0.900, 3.182), (-3.961, 0.358, 0.304), (4.326, -0.068, 5.298), (3.846, 1.725, 1.473), (-2.089, 0.953, 0.049), (-1.025, -1.470, 5.428), (2.061, -0.156, 4.343), (1.547, -1.827, 7.427), (2.786, 0.460, 3.473), (0.076, 0.659, 1.720), (3.597, 1.966, 0.866), (-0.933, -1.180, 4.894), (4.647, 1.190, 2.943), (-0.032, 0.544, 1.896), (4.461, -1.806, 8.843), (-0.586, 1.821, -0.934), (3.725, 1.715, 1.432), (-2.091, 2.714, -3.474), (4.494, -1.494, 8.236), (3.766, -0.209, 5.301), (-1.991, 1.776, -1.548), (-4.992, -0.742, 1.989), (-2.400, 1.828, -1.855), (-1.329, 0.143, 2.050), (1.954, 1.759, 0.459), (-4.422, 1.507, -2.224), (-2.243, -1.126, 4.131), (4.417, -1.080, 7.368), (1.737, -1.144, 6.157), (2.661, -1.084, 6.498), (-3.198, 0.443, 0.515), (4.191, -1.250, 7.596), (-2.419, -0.163, 2.116), (1.910, -1.173, 6.301), (-0.241, 1.902, -0.925), (-4.415, 2.479, -4.165), (3.307, -0.465, 5.583), (-2.382, 1.364, -0.920), (-3.154, 2.953, -4.483), (-2.562, 2.803, -3.888), (3.076, 0.195, 4.149), (-0.101, 0.896, 1.157), (-2.067, 1.120, -0.273), (-4.680, 2.756, -4.851), (-4.283, -0.607, 2.072), (4.013, -1.072, 7.150), (-4.401, -0.896, 2.591), (4.544, 2.498, 0.276), (4.075, -1.204, 7.445), (-3.463, 1.242, -1.216), (3.992, 2.782, -0.568), (-4.503, 0.239, 0.270), (-3.095, 1.161, -0.870), (0.768, -0.904, 5.192), (1.255, 2.870, -2.112), (-1.537, -0.049, 2.330), (2.851, -1.182, 6.789), (1.974, -0.922, 5.832), (4.447, 2.719, -0.214), (-3.413, 0.555, 0.184), (4.943, 2.120, 1.231), (3.645, -0.413, 5.648), (-4.776, 0.079, 0.453), (1.991, 1.565, 0.866), (2.413, 1.793, 0.620), (4.245, 2.663, -0.205), (-2.022, -1.180, 4.350), (-2.285, -1.246, 4.350), (2.276, 0.488, 3.162), (2.582, -0.037, 4.365), (-4.875, 1.468, -2.374), (-2.492, 2.730, -3.706), (2.696, -1.833, 8.013), (4.618, -1.127, 7.563), (-4.156, 0.987, -1.053), (1.873, -1.566, 7.068), (1.699, 0.794, 2.262), (-3.181, 1.640, -1.871), (-3.225, 1.526, -1.664), (-2.679, -1.811, 5.281), (3.717, 1.532, 1.794), (1.288, -0.999, 5.642), (-1.057, 0.044, 2.384), (-0.147, 1.108, 0.711), (-3.827, -1.139, 3.365), (0.872, -1.482, 6.399), (1.982, 0.286, 3.418), (-1.381, 2.374, -2.439), (-1.091, 2.010, -1.565), (-1.192, 2.751, -3.097), (1.468, -0.992, 5.718), (2.249, 0.949, 2.228), (3.064, 0.911, 2.711), (-1.576, -1.584, 5.380), (2.130, -1.489, 7.043), (4.386, -1.284, 7.761), (1.662, -1.645, 7.121), (-3.395, 1.784, -2.265), (4.618, 1.951, 1.406), (-0.299, 0.378, 2.095), (-2.911, 2.131, -2.717), (0.876, 2.869, -2.301), (-1.785, 0.961, 0.186), (-4.188, 2.442, -3.977), (-1.128, 0.127, 2.181), (1.755, -1.215, 6.307), (-2.276, 0.596, 0.669), (-4.630, 1.978, -3.272), (-0.454, 0.275, 2.224), (-1.950, -1.385, 4.794), (-0.889, 2.696, -2.837), (-4.832, -0.038, 0.661), (3.738, 0.604, 3.662), (-0.224, -0.465, 3.819); -insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +-- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); -- -DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; +insert into test.mldata values (-1.0, -2.0, -3.0, -4.0, -5.0); + +-- DROP TABLE IF EXISTS test.model; +-- create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; -- -- select toTypeName(state) from test.model; -- -- -- -- DROP TABLE IF EXISTS test.tests; From a7f7c4a15704736df3c13540007e0a0b18f5f32f Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Wed, 13 Feb 2019 00:37:49 +0300 Subject: [PATCH 015/194] ml constructor changed --- dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp | 2 +- dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h | 7 +++++-- .../{00900_mytest.reference => 00950_mltest.reference} | 0 .../0_stateless/{00900_mytest.sql => 00950_mltest.sql} | 5 ++++- 4 files changed, 10 insertions(+), 4 deletions(-) rename dbms/tests/queries/0_stateless/{00900_mytest.reference => 00950_mltest.reference} (100%) rename dbms/tests/queries/0_stateless/{00900_mytest.sql => 00950_mltest.sql} (99%) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 116a62b8408..04d31f918d0 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -73,7 +73,7 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (argument_types.size() < 2) throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); - return std::make_shared(argument_types.size() - 1, gc, wu, learning_rate, batch_size); + return std::make_shared(argument_types.size() - 1, gc, wu, learning_rate, batch_size, argument_types, parameters); } } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 545b278cce5..363f514c136 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -332,8 +332,11 @@ public: std::shared_ptr gradient_computer, std::shared_ptr weights_updater, Float64 learning_rate, - UInt32 batch_size) - : param_num(param_num), + UInt32 batch_size, + const DataTypes & argument_types, + const Array & params) + : IAggregateFunctionDataHelper>(argument_types, params), + param_num(param_num), learning_rate(learning_rate), batch_size(batch_size), gc(std::move(gradient_computer)), diff --git a/dbms/tests/queries/0_stateless/00900_mytest.reference b/dbms/tests/queries/0_stateless/00950_mltest.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00900_mytest.reference rename to dbms/tests/queries/0_stateless/00950_mltest.reference diff --git a/dbms/tests/queries/0_stateless/00900_mytest.sql b/dbms/tests/queries/0_stateless/00950_mltest.sql similarity index 99% rename from dbms/tests/queries/0_stateless/00900_mytest.sql rename to dbms/tests/queries/0_stateless/00950_mltest.sql index ddb99c77d19..28e431b6814 100644 --- a/dbms/tests/queries/0_stateless/00900_mytest.sql +++ b/dbms/tests/queries/0_stateless/00950_mltest.sql @@ -36,12 +36,15 @@ create table test.model engine = Memory as select LinearRegressionState(0.1, 5, -- -- ) ENGINE = Memory; -- -- + +with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults + -- -- insert into test.prediction values (20.0, 40.0); -- -- -- select multiply(param1, param2) from test.defaults; -- -- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; -select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; +-- select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; -- -- select evalLinReg(state, predict1, predict2) from test.model inner join (select * from test.tests) using state; -- -- select evalLinReg(state1, predict1, predict2) from test.tests; -- From b23cd21ce176701c1fa2d1af088476763f85dcc6 Mon Sep 17 00:00:00 2001 From: alexander kozhikhov Date: Wed, 13 Feb 2019 01:33:37 +0300 Subject: [PATCH 016/194] predict correctly using scalar aggr state --- .../AggregateFunctionMLMethod.h | 16 +- dbms/src/Columns/ColumnAggregateFunction.cpp | 19 +- dbms/src/Functions/evalMLMethod.cpp | 15 +- .../0_stateless/00950_ml_test.reference | 600 +++++++++--------- .../queries/0_stateless/00950_ml_test.sql | 55 +- 5 files changed, 321 insertions(+), 384 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index f9e12832f15..0dc0999da3f 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -110,22 +110,20 @@ public: void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override { size_t rows_num = block.rows(); - std::cout << "\n\nROWS NUM: " << rows_num << "\n\n"; std::vector results(rows_num, bias); - for (size_t i = 1; i < arguments.size(); ++i) { ColumnPtr cur_col = block.getByPosition(arguments[i]).column; for (size_t row_num = 0; row_num != rows_num; ++row_num) { + const auto &element = (*cur_col)[row_num]; if (element.getType() != Field::Types::Float64) throw Exception("Prediction arguments must be values of type Float", ErrorCodes::BAD_ARGUMENTS); - results[row_num] += weights[row_num] * element.get(); - // predict_features[i - 1] = element.get(); + results[row_num] += weights[i - 1] * element.get(); } } @@ -133,9 +131,6 @@ public: { container.emplace_back(results[row_num]); } -// column.getData().push_back(this->data(place).predict(predict_features)); -// column.getData().push_back(this->data(place).predict_for_all()); -// this->data(place).predict_for_all(column.getData(), block, arguments); } }; @@ -183,6 +178,7 @@ public: } void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override { + // TODO std::ignore = container; std::ignore = block; std::ignore = arguments; @@ -417,17 +413,15 @@ public: this->data(place).read(buf); } - void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, size_t row_num, const ColumnNumbers & arguments) const + void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments) const { - std::ignore = row_num; - std::cout << "\n\n IM CALLED \n\n"; - if (arguments.size() != param_num + 1) throw Exception("Predict got incorrect number of arguments. Got: " + std::to_string(arguments.size()) + ". Required: " + std::to_string(param_num + 1), ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); auto &column = dynamic_cast &>(to); + /// Так делали с одним предиктом, пока пусть побудет тут // std::vector predict_features(arguments.size() - 1); // for (size_t i = 1; i < arguments.size(); ++i) // { diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index d5db26e3420..52f2f087b9e 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -108,28 +108,14 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const ColumnNumbers & arguments) const { -// if (const AggregateFunctionState * function_state = typeid_cast(func.get())) -// { -// auto res = createView(); -// res->set(function_state->getNestedFunction()); -// res->data.assign(data.begin(), data.end()); -// return res; -// } -// -// MutableColumnPtr res = func->getReturnType()->createColumn(); -// res->reserve(data.size()); MutableColumnPtr res; if (convertion(&res)) { return res; } - std::cout << "\n\nHELLO: " << data.size() << "\n\n"; /// На моих тестах дважды в эту функцию приходит нечтно, имеющее data.size() == 0 однако оно по сути ничего не делает в следующих строках - if (1 != data.size()) - return res; -// auto ML_function = typeid_cast *>(func.get()); auto ML_function_Linear = typeid_cast *>(func.get()); auto ML_function_Logistic = typeid_cast *>(func.get()); if (ML_function_Linear) @@ -137,17 +123,16 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col size_t row_num = 0; for (auto val : data) { - ML_function_Linear->predictResultInto(val, *res, block, row_num, arguments); + ML_function_Linear->predictResultInto(val, *res, block, arguments); ++row_num; } -// ML_function_Linear->predictResultInto(data[0], *res, block, row_num, arguments); } else if (ML_function_Logistic) { size_t row_num = 0; for (auto val : data) { - ML_function_Logistic->predictResultInto(val, *res, block, row_num, arguments); + ML_function_Logistic->predictResultInto(val, *res, block, arguments); ++row_num; } } else diff --git a/dbms/src/Functions/evalMLMethod.cpp b/dbms/src/Functions/evalMLMethod.cpp index 23e21b3605f..2585c2ae1c9 100644 --- a/dbms/src/Functions/evalMLMethod.cpp +++ b/dbms/src/Functions/evalMLMethod.cpp @@ -63,14 +63,14 @@ namespace DB // typeid_cast(static_cast(&*block.getByPosition(arguments.at(0)).column)); -// std::cout << "\n\n\nHELOOOOO\n\n\n"; // завести МЛ_аггр_функции как отдельный класс, чтобы тут сразу это проверять, а не делать это внутри predictValues() - const ColumnAggregateFunction * column_with_states - = typeid_cast(&*block.getByPosition(arguments.at(0)).column); -// std::cout << "\n\n\nHELOOOOO 2\n\n\n"; -// const ColumnConst * column_with_states -// = typeid_cast(&*block.getByPosition(arguments.at(0)).column); +// const ColumnAggregateFunction * column_with_states +// = typeid_cast(&*block.getByPosition(arguments.at(0)).column); + + + const ColumnConst * column_with_states + = typeid_cast(&*block.getByPosition(arguments.at(0)).column); if (!column_with_states) @@ -94,7 +94,8 @@ namespace DB } block.getByPosition(result).column = column_with_states->predictValues(predict_features); */ - block.getByPosition(result).column = column_with_states->predictValues(block, arguments); + block.getByPosition(result).column = + typeid_cast(&*column_with_states->getDataColumnPtr())->predictValues(block, arguments); } }; diff --git a/dbms/tests/queries/0_stateless/00950_ml_test.reference b/dbms/tests/queries/0_stateless/00950_ml_test.reference index 8a9f3c31da5..6326f98fcd1 100644 --- a/dbms/tests/queries/0_stateless/00950_ml_test.reference +++ b/dbms/tests/queries/0_stateless/00950_ml_test.reference @@ -1,300 +1,300 @@ --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 --66.99407003753556 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 +-67.00423606399804 diff --git a/dbms/tests/queries/0_stateless/00950_ml_test.sql b/dbms/tests/queries/0_stateless/00950_ml_test.sql index 4c1abb78bb6..0a009c29d29 100644 --- a/dbms/tests/queries/0_stateless/00950_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00950_ml_test.sql @@ -1,6 +1,6 @@ CREATE DATABASE IF NOT EXISTS test; -DROP TABLE IF EXISTS test.mldata; -CREATE TABLE IF NOT EXISTS test.mldata +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults ( param1 Float64, param2 Float64, @@ -8,53 +8,10 @@ CREATE TABLE IF NOT EXISTS test.mldata predict1 Float64, predict2 Float64 ) ENGINE = Memory; --- -- insert into test.defaults values (2.533, 0.543, 3.181), (1.999, 1.765, 0.470), (0.631, 2.580, -1.845), (-1.164, 0.889, 0.640), (2.110, 0.768, 2.519), (1.251, 0.483, 2.659), (-3.958, 1.299, -1.576), (-2.152, -1.316, 4.556), (3.269, 1.441, 1.753), (4.206, -1.635, 8.373), (-3.479, -0.544, 2.349), (4.006, 0.167, 4.670), (-4.478, 2.400, -4.039), (1.856, 0.256, 3.417), (1.470, 1.685, 0.366), (-4.052, 2.326, -3.678), (-0.971, -0.969, 4.453), (0.881, -1.848, 7.137), (-1.551, -1.766, 5.756), (-0.988, -0.945, 4.395), (-4.636, 1.074, -1.466), (-4.074, -1.486, 3.934), (0.754, 2.627, -1.877), (1.035, 0.889, 1.738), (3.707, -1.281, 7.415), (-2.215, 1.110, -0.327), (-2.965, -1.316, 4.150), (-3.581, 1.063, -0.917), (0.548, 0.343, 2.588), (3.023, -0.870, 6.251), (4.053, -1.441, 7.909), (-0.750, 0.639, 1.348), (-4.411, 1.636, -2.477), (1.786, 0.398, 3.096), (-2.514, 0.033, 1.676), (4.935, -0.840, 7.148), (1.075, -0.921, 5.380), (-3.418, 2.177, -3.063), (3.122, 1.883, 0.795), (-2.254, -1.389, 4.650), (-4.603, 2.909, -5.119), (-1.886, -1.220, 4.497), (-0.509, -1.498, 5.741), (2.192, 1.882, 0.332), (4.056, -1.108, 7.244), (-1.918, 0.230, 1.581), (4.867, 1.516, 2.401), (-0.993, -0.011, 2.526), (-0.757, -1.192, 5.006), (-4.161, 2.059, -3.198), (2.258, 1.157, 1.814), (-3.878, -0.052, 1.165), (1.915, 2.998, -2.038), (-2.164, 2.379, -2.841), (-0.114, -1.914, 6.772), (3.812, 2.138, 0.630), (-1.863, 1.508, -0.947), (-2.964, 0.398, 0.722), (-2.046, -0.193, 2.363), (-1.525, -0.836, 3.910), (-4.557, -0.582, 1.886), (1.031, -0.461, 4.437), (-0.802, 0.699, 1.201), (3.982, 2.084, 0.824), (-2.243, 2.726, -3.573), (-3.989, -0.803, 2.611), (4.900, 0.253, 4.944), (-1.208, -1.587, 5.571), (0.370, 2.579, -1.972), (2.824, 0.964, 2.484), (-1.290, -0.128, 2.611), (0.190, 2.058, -1.021), (4.058, 2.122, 0.784), (4.879, 0.945, 3.549), (1.119, 1.992, -0.424), (4.050, 2.005, 1.015), (-0.064, 1.485, -0.002), (-2.496, 0.456, 0.840), (-1.835, 1.586, -1.090), (0.603, 1.856, -0.411), (-3.062, -0.966, 3.401), (-3.351, 0.430, 0.465), (-2.724, -1.331, 4.299), (3.291, -1.027, 6.699), (-4.263, 0.785, -0.701), (-3.289, -0.886, 3.128), (4.627, 1.331, 2.651), (-0.618, 0.602, 1.486), (0.056, 1.778, -0.528), (4.823, 1.154, 3.103), (-3.983, 0.509, -0.010), (-4.474, -1.400, 3.563), (-3.782, 2.996, -4.883), (4.515, -0.656, 6.569), (1.269, 2.592, -1.549), (-1.710, -0.241, 2.627), (2.171, 1.453, 1.180), (-1.931, -1.845, 5.726), (1.767, -1.798, 7.480), (4.352, 2.369, 0.438), (-4.498, 2.611, -4.472), (0.067, 0.517, 2.000), (4.151, 0.624, 3.827), (0.409, -0.969, 5.142), (0.193, -1.713, 6.522), (-2.487, 2.827, -3.898), (-4.363, 2.011, -3.203), (-2.383, 2.554, -3.299), (-4.457, -0.958, 2.687), (3.342, -0.360, 5.392), (0.902, 2.978, -2.505), (4.073, -1.524, 8.084), (3.036, 1.672, 1.173), (2.169, -0.564, 5.213), (-4.780, 0.962, -1.313), (-1.815, 2.096, -2.100), (-1.445, 0.458, 1.362), (1.891, -1.437, 6.820), (1.942, -1.761, 7.493), (-4.613, -1.551, 3.795), (-3.472, -1.110, 3.485), (-2.026, 1.961, -1.935), (0.091, -0.961, 4.967), (3.902, -1.336, 7.622), (-3.483, -0.769, 2.796), (-0.066, -1.233, 5.433), (2.597, 2.789, -1.280), (-1.657, -1.842, 5.856), (0.232, -1.420, 5.957), (-3.321, 1.609, -1.879), (2.673, 2.781, -1.226), (0.869, 0.072, 3.291), (1.444, -1.271, 6.264), (1.190, 1.460, 0.675), (3.497, 0.870, 3.008), (-2.884, -1.303, 4.163), (3.620, 0.381, 4.047), (2.594, 0.247, 3.803), (-3.902, -1.315, 3.678), (-4.753, -1.005, 2.634), (0.881, 0.675, 2.091), (0.414, 2.071, -0.935), (3.458, -0.920, 6.568), (-2.986, -0.411, 2.329), (3.076, -1.960, 8.458), (2.951, 2.988, -1.501), (2.408, 1.301, 1.603), (4.725, 0.366, 4.631), (4.924, -1.762, 8.985), (3.719, 0.970, 2.920), (-0.295, 0.257, 2.340), (-4.607, 2.548, -4.400), (0.288, 1.953, -0.761), (-3.311, 0.844, -0.344), (3.679, -0.642, 6.123), (-2.310, -0.838, 3.522), (-4.397, -0.226, 1.254), (-4.366, -0.024, 0.864), (2.405, 1.458, 1.286), (-4.296, -1.071, 2.994), (0.452, -1.901, 7.028), (-0.214, -0.467, 3.827), (2.559, 1.547, 1.185), (0.990, 1.539, 0.417), (0.478, -0.089, 3.417), (-2.734, -1.007, 3.646), (3.483, 0.247, 4.247), (3.507, 2.727, -0.701), (-4.399, 2.437, -4.073), (3.785, 0.036, 4.820), (-0.824, 2.417, -2.245), (-2.588, 0.369, 0.968), (-3.037, -1.639, 4.759), (4.531, -0.499, 6.264), (4.742, -1.161, 7.693), (-0.063, -0.595, 4.159), (0.697, 2.281, -1.212), (0.413, 0.607, 1.992), (-4.081, 0.383, 0.194), (0.712, 2.638, -1.920), (-1.620, 1.092, 0.006), (-3.425, -0.911, 3.109), (-0.124, 1.711, -0.484), (4.347, 1.387, 2.399), (-3.237, -0.900, 3.182), (-3.961, 0.358, 0.304), (4.326, -0.068, 5.298), (3.846, 1.725, 1.473), (-2.089, 0.953, 0.049), (-1.025, -1.470, 5.428), (2.061, -0.156, 4.343), (1.547, -1.827, 7.427), (2.786, 0.460, 3.473), (0.076, 0.659, 1.720), (3.597, 1.966, 0.866), (-0.933, -1.180, 4.894), (4.647, 1.190, 2.943), (-0.032, 0.544, 1.896), (4.461, -1.806, 8.843), (-0.586, 1.821, -0.934), (3.725, 1.715, 1.432), (-2.091, 2.714, -3.474), (4.494, -1.494, 8.236), (3.766, -0.209, 5.301), (-1.991, 1.776, -1.548), (-4.992, -0.742, 1.989), (-2.400, 1.828, -1.855), (-1.329, 0.143, 2.050), (1.954, 1.759, 0.459), (-4.422, 1.507, -2.224), (-2.243, -1.126, 4.131), (4.417, -1.080, 7.368), (1.737, -1.144, 6.157), (2.661, -1.084, 6.498), (-3.198, 0.443, 0.515), (4.191, -1.250, 7.596), (-2.419, -0.163, 2.116), (1.910, -1.173, 6.301), (-0.241, 1.902, -0.925), (-4.415, 2.479, -4.165), (3.307, -0.465, 5.583), (-2.382, 1.364, -0.920), (-3.154, 2.953, -4.483), (-2.562, 2.803, -3.888), (3.076, 0.195, 4.149), (-0.101, 0.896, 1.157), (-2.067, 1.120, -0.273), (-4.680, 2.756, -4.851), (-4.283, -0.607, 2.072), (4.013, -1.072, 7.150), (-4.401, -0.896, 2.591), (4.544, 2.498, 0.276), (4.075, -1.204, 7.445), (-3.463, 1.242, -1.216), (3.992, 2.782, -0.568), (-4.503, 0.239, 0.270), (-3.095, 1.161, -0.870), (0.768, -0.904, 5.192), (1.255, 2.870, -2.112), (-1.537, -0.049, 2.330), (2.851, -1.182, 6.789), (1.974, -0.922, 5.832), (4.447, 2.719, -0.214), (-3.413, 0.555, 0.184), (4.943, 2.120, 1.231), (3.645, -0.413, 5.648), (-4.776, 0.079, 0.453), (1.991, 1.565, 0.866), (2.413, 1.793, 0.620), (4.245, 2.663, -0.205), (-2.022, -1.180, 4.350), (-2.285, -1.246, 4.350), (2.276, 0.488, 3.162), (2.582, -0.037, 4.365), (-4.875, 1.468, -2.374), (-2.492, 2.730, -3.706), (2.696, -1.833, 8.013), (4.618, -1.127, 7.563), (-4.156, 0.987, -1.053), (1.873, -1.566, 7.068), (1.699, 0.794, 2.262), (-3.181, 1.640, -1.871), (-3.225, 1.526, -1.664), (-2.679, -1.811, 5.281), (3.717, 1.532, 1.794), (1.288, -0.999, 5.642), (-1.057, 0.044, 2.384), (-0.147, 1.108, 0.711), (-3.827, -1.139, 3.365), (0.872, -1.482, 6.399), (1.982, 0.286, 3.418), (-1.381, 2.374, -2.439), (-1.091, 2.010, -1.565), (-1.192, 2.751, -3.097), (1.468, -0.992, 5.718), (2.249, 0.949, 2.228), (3.064, 0.911, 2.711), (-1.576, -1.584, 5.380), (2.130, -1.489, 7.043), (4.386, -1.284, 7.761), (1.662, -1.645, 7.121), (-3.395, 1.784, -2.265), (4.618, 1.951, 1.406), (-0.299, 0.378, 2.095), (-2.911, 2.131, -2.717), (0.876, 2.869, -2.301), (-1.785, 0.961, 0.186), (-4.188, 2.442, -3.977), (-1.128, 0.127, 2.181), (1.755, -1.215, 6.307), (-2.276, 0.596, 0.669), (-4.630, 1.978, -3.272), (-0.454, 0.275, 2.224), (-1.950, -1.385, 4.794), (-0.889, 2.696, -2.837), (-4.832, -0.038, 0.661), (3.738, 0.604, 3.662), (-0.224, -0.465, 3.819); --- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); --- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); --- -insert into test.mldata values (-1.0, -2.0, -3.0, -4.0, -5.0); +insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); --- DROP TABLE IF EXISTS test.model; --- create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; --- -- select toTypeName(state) from test.model; --- -- --- -- DROP TABLE IF EXISTS test.tests; --- -- CREATE TABLE IF NOT EXISTS test.tests --- -- ( --- -- predict1 Float64, --- -- predict2 Float64, --- -- state1 AggregateFunction(LinReg(0.01), Float64, Float64, Float64) --- -- ) ENGINE = Memory; --- -- insert into test.tests select 20.0, 40.0, LinRegState(0.01)(target, param1, param2) from test.defaults; --- -- select evalLinReg(state1, predict1, predict2) from test.tests; --- --- --- --- -- DROP TABLE IF EXISTS test.prediction; --- -- CREATE TABLE IF NOT EXISTS test.prediction --- -- ( --- -- predict1 Float64, --- -- predict2 Float64 --- -- ) ENGINE = Memory; --- --- --- -- insert into test.prediction values (20.0, 40.0); --- --- -- select multiply(param1, param2) from test.defaults; --- --- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; - --- select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; --- select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; - --- select evalMLMethod(state, 0.1, 0.2) from test.model; - --- with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; - - --- -- select evalLinReg(state, predict1, predict2) from test.model inner join (select * from test.tests) using state; --- -- select evalLinReg(state1, predict1, predict2) from test.tests; --- --- -- select negate(target) from test.defaults; +with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; From d5753636bdbd8e0dd2116c8842ade201f2fb261d Mon Sep 17 00:00:00 2001 From: Masha Date: Fri, 15 Feb 2019 22:47:56 +0000 Subject: [PATCH 017/194] Logistic Regression and new tests --- .../AggregateFunctionMLMethod.h | 46 +- .../0_stateless/00951_ml_test.reference | 92 +++ .../queries/0_stateless/00951_ml_test.sql | 16 + .../0_stateless/00952_ml_test.good_reference | 370 +++++++++++ .../0_stateless/00952_ml_test.norm_reference | 1 + .../0_stateless/00952_ml_test.reference | 370 +++++++++++ .../queries/0_stateless/00952_ml_test.sql | 25 + .../0_stateless/00953_ml_test.good_reference | 580 ++++++++++++++++++ .../0_stateless/00953_ml_test.reference | 580 ++++++++++++++++++ .../00953_ml_test.rock_auc_reference | 1 + .../queries/0_stateless/00953_ml_test.sql | 25 + 11 files changed, 2091 insertions(+), 15 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00951_ml_test.reference create mode 100644 dbms/tests/queries/0_stateless/00951_ml_test.sql create mode 100644 dbms/tests/queries/0_stateless/00952_ml_test.good_reference create mode 100644 dbms/tests/queries/0_stateless/00952_ml_test.norm_reference create mode 100644 dbms/tests/queries/0_stateless/00952_ml_test.reference create mode 100644 dbms/tests/queries/0_stateless/00952_ml_test.sql create mode 100644 dbms/tests/queries/0_stateless/00953_ml_test.good_reference create mode 100644 dbms/tests/queries/0_stateless/00953_ml_test.reference create mode 100644 dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference create mode 100644 dbms/tests/queries/0_stateless/00953_ml_test.sql diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 0dc0999da3f..286e19eee50 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -178,12 +178,28 @@ public: } void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override { - // TODO - std::ignore = container; - std::ignore = block; - std::ignore = arguments; - std::ignore = weights; - std::ignore = bias; + size_t rows_num = block.rows(); + std::vector results(rows_num, bias); + + for (size_t i = 1; i < arguments.size(); ++i) + { + ColumnPtr cur_col = block.getByPosition(arguments[i]).column; + for (size_t row_num = 0; row_num != rows_num; ++row_num) + { + + const auto &element = (*cur_col)[row_num]; + if (element.getType() != Field::Types::Float64) + throw Exception("Prediction arguments must be values of type Float", + ErrorCodes::BAD_ARGUMENTS); + + results[row_num] += weights[i - 1] * element.get(); + } + } + for (size_t row_num = 0; row_num != rows_num; ++row_num) + { + results[row_num] = 1 / (1 + exp(-results[row_num])); + container.emplace_back(results[row_num]); + } } }; @@ -218,31 +234,31 @@ public: void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { /// batch_size is already checked to be greater than 0 - if (hk_.size() == 0) + if (accumulated_gradient.size() == 0) { - hk_.resize(batch_gradient.size(), Float64{0.0}); + accumulated_gradient.resize(batch_gradient.size(), Float64{0.0}); } for (size_t i = 0; i < batch_gradient.size(); ++i) { - hk_[i] = hk_[i] * alpha_ + batch_gradient[i]; + accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i]; } for (size_t i = 0; i < weights.size(); ++i) { - weights[i] += hk_[i] / batch_size; + weights[i] += accumulated_gradient[i] / batch_size; } - bias += hk_[weights.size()] / batch_size; + bias += accumulated_gradient[weights.size()] / batch_size; } virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override { - const auto & momentum_rhs = dynamic_cast(rhs); - for (size_t i = 0; i < hk_.size(); ++i) + auto & momentum_rhs = static_cast(rhs); + for (size_t i = 0; i < accumulated_gradient.size(); ++i) { - hk_[i] = hk_[i] * frac + momentum_rhs.hk_[i] * rhs_frac; + accumulated_gradient[i] = accumulated_gradient[i] * frac + momentum_rhs.accumulated_gradient[i] * rhs_frac; } } private: Float64 alpha_{0.1}; - std::vector hk_; + std::vector accumulated_gradient; }; class LinearModelData diff --git a/dbms/tests/queries/0_stateless/00951_ml_test.reference b/dbms/tests/queries/0_stateless/00951_ml_test.reference new file mode 100644 index 00000000000..b636d351b84 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00951_ml_test.reference @@ -0,0 +1,92 @@ +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 +0.014756373152892969 +0.9981703893717232 diff --git a/dbms/tests/queries/0_stateless/00951_ml_test.sql b/dbms/tests/queries/0_stateless/00951_ml_test.sql new file mode 100644 index 00000000000..ca9c2f99505 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00951_ml_test.sql @@ -0,0 +1,16 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults +( + param1 Float64, + param2 Float64, + target Float64, + predict1 Float64, + predict2 Float64 +) ENGINE = Memory; +insert into test.defaults values (1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2) +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LogisticRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; + + +with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.good_reference b/dbms/tests/queries/0_stateless/00952_ml_test.good_reference new file mode 100644 index 00000000000..5ad7a9176a4 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00952_ml_test.good_reference @@ -0,0 +1,370 @@ +0.72 +0.72 +0.72 +0.72 +0.72 +0.72 +0.72 +0.72 +0.72 +0.72 +0.72 +0.72 +0.72 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.79 +0.79 +0.79 +0.79 +0.79 +0.79 +0.79 +0.79 +0.79 +0.79 +0.79 +0.79 +0.79 +0.39 +0.39 +0.39 +0.39 +0.39 +0.39 +0.39 +0.39 +0.39 +0.39 +0.39 +0.39 +0.38 +0.38 +0.38 +0.38 +0.38 +0.38 +0.38 +0.38 +0.38 +0.38 +0.38 +0.38 +0.34 +0.34 +0.34 +0.34 +0.34 +0.34 +0.34 +0.34 +0.34 +0.34 +0.34 +0.34 +0.34 +0.47 +0.47 +0.47 +0.47 +0.47 +0.47 +0.47 +0.47 +0.47 +0.47 +0.47 +0.47 +0.56 +0.56 +0.56 +0.56 +0.56 +0.56 +0.56 +0.56 +0.56 +0.56 +0.56 +0.56 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.78 +0.78 +0.78 +0.78 +0.78 +0.78 +0.78 +0.78 +0.78 +0.78 +0.78 +0.78 +0.73 +0.73 +0.73 +0.73 +0.73 +0.73 +0.73 +0.73 +0.73 +0.73 +0.73 +0.73 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.62 +0.62 +0.62 +0.62 +0.62 +0.62 +0.62 +0.62 +0.62 +0.62 +0.62 +0.62 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.96 +0.46 +0.46 +0.46 +0.46 +0.46 +0.46 +0.46 +0.46 +0.46 +0.46 +0.46 +0.46 +0.53 +0.53 +0.53 +0.53 +0.53 +0.53 +0.53 +0.53 +0.53 +0.53 +0.53 +0.53 +0.49 +0.49 +0.49 +0.49 +0.49 +0.49 +0.49 +0.49 +0.49 +0.49 +0.49 +0.49 +0.49 +0.76 +0.76 +0.76 +0.76 +0.76 +0.76 +0.76 +0.76 +0.76 +0.76 +0.76 +0.76 +0.64 +0.64 +0.64 +0.64 +0.64 +0.64 +0.64 +0.64 +0.64 +0.64 +0.64 +0.64 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.71 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.77 +0.77 +0.77 +0.77 +0.77 +0.77 +0.77 +0.77 +0.77 +0.77 +0.77 +0.77 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.89 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.82 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.84 +0.91 +0.91 +0.91 +0.91 +0.91 +0.91 +0.91 +0.91 +0.91 +0.91 +0.91 +0.91 +0.91 +0.67 +0.67 +0.67 +0.67 +0.67 +0.67 +0.67 +0.67 +0.67 +0.67 +0.67 +0.67 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 +0.95 diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.norm_reference b/dbms/tests/queries/0_stateless/00952_ml_test.norm_reference new file mode 100644 index 00000000000..dea24ee3047 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00952_ml_test.norm_reference @@ -0,0 +1 @@ +0.00676015 diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.reference b/dbms/tests/queries/0_stateless/00952_ml_test.reference new file mode 100644 index 00000000000..d7d900a7713 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00952_ml_test.reference @@ -0,0 +1,370 @@ +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.6542885368159769 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.8444267125384497 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.9683751248474649 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.7836319925339996 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.6375535053362572 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5871709781307677 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5202091999924413 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5130525169352177 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.5581075117249047 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.6798311701936688 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7995193250661652 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.7773509726916165 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.8606987912604607 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.6352934050115681 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9771089703353684 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.9955717835823895 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6124539775938347 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.6564358792397615 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.552111558999158 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.7792659923782862 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.6656871036437929 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.7435137743371989 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.8688023472919777 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.7225690042828818 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8866100282141612 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8374461350184257 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.8365104788783658 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.928892180915439 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.7275019293899534 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 +0.9516437185963472 diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.sql b/dbms/tests/queries/0_stateless/00952_ml_test.sql new file mode 100644 index 00000000000..813131cf78d --- /dev/null +++ b/dbms/tests/queries/0_stateless/00952_ml_test.sql @@ -0,0 +1,25 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults +( + param1 Float64, + param2 Float64, + param3 Float64, + param4 Float64, + param5 Float64, + param6 Float64, + param7 Float64, + target Float64, + predict1 Float64, + predict2 Float64, + predict3 Float64, + predict4 Float64, + predict5 Float64, + predict6 Float64, + predict7 Float64 + +) ENGINE = Memory; +insert into test.defaults values (1.76210664421617,1.7469706406568504,0.7988286239230257,1.0938642223599824,1.167321139201246,1.7648182796261376,0.909111664354187,0.92,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,-0.06763531281107672,0.7988286239230257,0.5966532121963541,1.167321139201246,0.4551512643242912,0.909111664354187,0.76,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.07046681268810527,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-1.0056311758200724,0.909111664354187,0.72,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,0.11933920911869125,0.909111664354187,0.8,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.24499761810756004,-0.7274920231630502,-0.952028633990455,-1.3921908284581592,-0.5042604443804907,-0.6530285178541898,-1.0999748867047898,0.65,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.1512488252480781,1.2520781078928702,1.674257252879766,1.0938642223599824,-0.5042604443804907,1.244309594057455,0.909111664354187,0.9,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,0.6101272780073337,-0.6698191206144725,0.909111664354187,0.75,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.7685900343659244,-1.057420378339037,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-1.1735372034228724,-1.0999748867047898,0.68,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-1.2921824506242887,-0.8924562007510436,-1.8274572629471952,-1.3921908284581592,-2.175842027962227,-1.0056311758200724,-1.0999748867047898,0.5,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.5403910062799865,0.09732886477691666,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.0018049897967303734,-1.0999748867047898,0.45,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.7149218116994412,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.3340070654088696,0.909111664354187,0.52,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.889452617118896,0.5922213975408968,0.7988286239230257,0.5966532121963541,1.167321139201246,0.6734291002079332,0.909111664354187,0.84,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.9767180198286235,0.7571855751288902,0.7988286239230257,0.5966532121963541,1.167321139201246,0.8413351278107333,0.909111664354187,0.78,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.8558554370756518,0.26229304236491,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.62,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,-1.618648166768315,-0.6698191206144725,0.909111664354187,0.61,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.24499761810756004,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.5019130930116695,-1.0999748867047898,0.54,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.016798590021622126,-0.06763531281107672,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,0.16971101739953035,-1.0999748867047898,0.66,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.1913293954410769,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.65,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.10406399273134952,0.4272572199529034,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,0.3376170450023333,-1.0999748867047898,0.63,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-1.2049170479145614,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.1661010378060696,-1.0999748867047898,0.62,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,-1.618648166768315,-1.1735372034228724,0.909111664354187,0.64,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.7149218116994412,1.087113930304877,0.7988286239230257,-0.3977688081309026,-1.618648166768315,-0.3340070654088696,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.9767180198286235,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.5129592382219361,0.909111664354187,0.94,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(1.5003104360869879,1.9119348182448437,1.674257252879766,1.5910752325236108,1.167321139201246,1.848771293427536,0.909111664354187,0.95,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(1.6748412415064426,1.9119348182448437,1.674257252879766,0.5966532121963541,0.052933416813421515,2.016677321030339,0.909111664354187,0.97,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(2.023902852345352,2.076898995832837,1.674257252879766,1.0938642223599824,1.167321139201246,1.680865265824736,0.909111664354187,0.94,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.4531256035702591,0.26229304236491,1.674257252879766,1.0938642223599824,0.052933416813421515,0.3376170450023333,-1.0999748867047898,0.76,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.6412440614631982,-1.5523129111030172,-0.952028633990455,-1.8894018386217877,-1.0614543055744028,-1.8451613138340752,0.909111664354187,0.44,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.9030402695923805,-2.377133799042984,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-2.348879396642477,-1.0999748867047898,0.46,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-0.5940592289464697,-1.3873487335150236,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-2.180973369039677,-1.0999748867047898,0.54,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.4667132560437435,-1.7172770886910105,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.8377251482172725,0.909111664354187,0.65,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.889452617118896,-0.7274920231630502,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.5019130930116695,0.909111664354187,0.74,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(1.8493720469258974,1.7469706406568504,0.7988286239230257,-0.3977688081309026,1.167321139201246,1.3450532106191362,0.909111664354187,0.91,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(2.023902852345352,1.087113930304877,1.674257252879766,0.5966532121963541,0.6101272780073337,1.680865265824736,0.909111664354187,0.9,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(1.2385142279578056,0.7571855751288902,1.674257252879766,0.5966532121963541,1.724515000395158,2.016677321030339,0.909111664354187,0.94,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.2785947981508043,0.4272572199529034,1.674257252879766,1.5910752325236108,1.724515000395158,1.0092411554135332,0.909111664354187,0.88,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.553978658753471,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.6101272780073337,-0.3340070654088696,-1.0999748867047898,0.64,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.4667132560437435,-0.39756366798706344,-1.8274572629471952,-2.386612848785416,-1.618648166768315,-1.3414432310256739,-1.0999748867047898,0.58,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-1.117651645204834,-0.39756366798706344,-1.8274572629471952,-0.3977688081309026,-2.175842027962227,-1.8451613138340752,-1.0999748867047898,0.52,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.8558554370756518,0.09732886477691666,-0.952028633990455,0.5966532121963541,0.052933416813421515,-1.5093492586284738,-1.0999748867047898,0.48,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.7685900343659244,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.46,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.07046681268810527,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6698191206144725,0.909111664354187,0.49,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.3322630208172874,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.1661010378060696,0.909111664354187,0.53,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.3257796306675331,1.582006463068857,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.8413351278107333,-1.0999748867047898,0.87,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.8021872144091686,0.9221497527168835,1.674257252879766,1.0938642223599824,0.6101272780073337,1.3450532106191362,0.909111664354187,0.91,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.4531256035702591,0.4272572199529034,1.674257252879766,1.5910752325236108,0.6101272780073337,0.8413351278107333,0.909111664354187,0.88,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.0639834225383509,1.087113930304877,1.674257252879766,0.5966532121963541,1.724515000395158,1.1771471830163363,0.909111664354187,0.86,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.9366374496356247,1.9119348182448437,1.674257252879766,1.0938642223599824,0.6101272780073337,1.848771293427536,-1.0999748867047898,0.89,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.36586020086053167,0.4272572199529034,-0.0766000050337147,0.09944220203272576,1.724515000395158,0.42157005880373183,0.909111664354187,0.82,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.889452617118896,0.5922213975408968,0.7988286239230257,-0.3977688081309026,0.6101272780073337,-0.3340070654088696,0.909111664354187,0.78,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.3322630208172874,-1.5523129111030172,-0.0766000050337147,-0.8949798182945309,1.167321139201246,-0.5019130930116695,0.909111664354187,0.76,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.41952842352701486,-1.2223845559270303,-0.952028633990455,-1.8894018386217877,0.052933416813421515,-1.1735372034228724,0.909111664354187,0.56,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.5003104360869879,1.4170422854808635,0.7988286239230257,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.78,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.6276564089897139,0.7571855751288902,0.7988286239230257,0.5966532121963541,-1.0614543055744028,-0.8377251482172725,0.909111664354187,0.72,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-1.0056311758200724,-1.0999748867047898,0.7,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.2785947981508043,-0.7274920231630502,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-1.5093492586284738,-1.0999748867047898,0.64,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.07046681268810527,-0.8924562007510436,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-2.013067341436875,-1.0999748867047898,0.64,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.6412440614631982,-1.3873487335150236,-0.952028633990455,0.5966532121963541,-1.618648166768315,-1.6772552862312753,-1.0999748867047898,0.46,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.4667132560437435,-1.3873487335150236,-1.8274572629471952,-0.3977688081309026,-1.618648166768315,-3.0205035070536796,0.909111664354187,0.36,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.5067938262367422,-0.5625278455750569,-0.952028633990455,-1.3921908284581592,-1.618648166768315,-0.5019130930116695,-1.0999748867047898,0.42,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.681324631656197,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.8377251482172725,-1.0999748867047898,0.48,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.8558554370756518,-1.057420378339037,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-0.6698191206144725,-1.0999748867047898,0.47,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.117651645204834,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.6698191206144725,0.909111664354187,0.54,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.15773221539783266,-0.06763531281107672,-0.952028633990455,0.5966532121963541,-0.5042604443804907,-0.1661010378060696,0.909111664354187,0.56,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.7149218116994412,0.5922213975408968,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.16971101739953035,-1.0999748867047898,0.52,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.09944220203272576,0.052933416813421515,0.5391042781256927,-1.0999748867047898,0.55,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.889452617118896,1.087113930304877,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.7070103057284927,-1.0999748867047898,0.61,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.07046681268810527,-0.06763531281107672,-0.952028633990455,0.09944220203272576,0.052933416813421515,0.06896740083785215,0.909111664354187,0.57,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.10406399273134952,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.6101272780073337,1.0428223609340956,0.909111664354187,0.68,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.9767180198286235,1.2520781078928702,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9420787443724145,0.909111664354187,0.78,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(1.3257796306675331,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.7480276768658578,0.909111664354187,0.94,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(1.6748412415064426,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,1.9495149099892173,0.909111664354187,0.96,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.36586020086053167,0.5922213975408968,1.674257252879766,1.5910752325236108,1.724515000395158,1.4290062244205346,0.909111664354187,0.93,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.24499761810756004,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.7405915112490521,0.909111664354187,0.84,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.24499761810756004,-0.2325994903990701,-0.0766000050337147,-0.3977688081309026,1.724515000395158,0.5055230726051333,-1.0999748867047898,0.74,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(1.0639834225383509,1.087113930304877,-0.952028633990455,-1.3921908284581592,0.6101272780073337,-0.06535742124438843,0.909111664354187,0.72,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.889452617118896,0.7571855751288902,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.20329222292009272,0.909111664354187,0.74,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.3794478533340162,-1.3873487335150236,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.6362379150939101,-1.0999748867047898,0.64,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.8157748668826532,-2.0472054438669973,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-1.777998902792955,0.909111664354187,0.44,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.990305672302108,-2.377133799042984,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-2.0802297524779956,-1.0999748867047898,0.46,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-0.972049970299513,0.909111664354187,0.5,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(2.023902852345352,2.076898995832837,0.7988286239230257,1.5910752325236108,1.724515000395158,1.5129592382219361,0.909111664354187,0.96,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.2785947981508043,0.4272572199529034,1.674257252879766,1.5910752325236108,1.167321139201246,1.0428223609340956,0.909111664354187,0.92,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.4531256035702591,1.2520781078928702,1.674257252879766,0.5966532121963541,1.167321139201246,1.2778907995780144,0.909111664354187,0.92,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(2.023902852345352,1.2520781078928702,1.674257252879766,1.0938642223599824,1.167321139201246,1.4290062244205346,0.909111664354187,0.94,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.1913293954410769,-0.7274920231630502,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.10254860635841155,-1.0999748867047898,0.76,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-0.15773221539783266,-0.2325994903990701,-0.0766000050337147,1.0938642223599824,0.052933416813421515,-0.30042585988831016,-1.0999748867047898,0.72,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.016798590021622126,-0.06763531281107672,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.535494298532232,-1.0999748867047898,0.66,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.24499761810756004,0.09732886477691666,-0.0766000050337147,1.0938642223599824,0.052933416813421515,-0.7705627371761508,-1.0999748867047898,0.64,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.07046681268810527,0.26229304236491,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.27045463396121155,0.909111664354187,0.74,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(0.10406399273134952,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.6101272780073337,-1.139955997902313,0.909111664354187,0.64,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.553978658753471,-1.7172770886910105,-0.0766000050337147,1.5910752325236108,0.052933416813421515,-1.5765116696695942,-1.0999748867047898,0.38,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.6412440614631982,-1.5523129111030172,-0.952028633990455,0.5966532121963541,-0.5042604443804907,-0.9552593675392334,-1.0999748867047898,0.34,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.3794478533340162,-1.7172770886910105,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-1.2071184089434333,0.909111664354187,0.44,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.2049170479145614,-1.3873487335150236,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898,0.36,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.117651645204834,-1.2223845559270303,0.7988286239230257,-1.8894018386217877,-1.0614543055744028,-1.2742808199845537,-1.0999748867047898,0.42,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.9431208397853792,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-1.0056311758200724,-1.0999748867047898,0.48,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(1.2385142279578056,2.076898995832837,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.6062666891668145,0.909111664354187,0.86,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(1.3257796306675331,1.9119348182448437,0.7988286239230257,1.5910752325236108,1.167321139201246,1.076403566454655,0.909111664354187,0.9,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(0.5403910062799865,0.9221497527168835,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.47194186708457386,0.909111664354187,0.79,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.4531256035702591,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.2332634488471884,0.909111664354187,0.71,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.8041439426967131,-1.0999748867047898,0.64,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.24499761810756004,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.052933416813421515,-0.585866106813071,-1.0999748867047898,0.62,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.016798590021622126,-0.5625278455750569,-0.952028633990455,1.0938642223599824,0.6101272780073337,-0.2164728460869087,-1.0999748867047898,0.57,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.8021872144091686,0.7571855751288902,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.7573821140093348,0.909111664354187,0.74,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.07046681268810527,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.30403583948177093,0.909111664354187,0.69,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,1.167321139201246,0.9756599498929738,0.909111664354187,0.87,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.8493720469258974,1.582006463068857,0.7988286239230257,0.09944220203272576,1.167321139201246,1.4457968271808173,0.909111664354187,0.91,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.2385142279578056,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.3114720050985766,0.909111664354187,0.93,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.117651645204834,-0.7274920231630502,1.674257252879766,1.5910752325236108,0.6101272780073337,0.06896740083785215,-1.0999748867047898,0.68,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.0303862424951067,0.09732886477691666,1.674257252879766,-0.3977688081309026,-0.5042604443804907,-0.199682243326629,-1.0999748867047898,0.61,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.36586020086053167,0.26229304236491,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.13612981187897094,0.909111664354187,0.69,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.3794478533340162,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.4347506819705508,0.909111664354187,0.62,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(0.2785947981508043,0.4272572199529034,-0.952028633990455,0.5966532121963541,0.052933416813421515,-0.06535742124438843,-1.0999748867047898,0.72,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5067938262367422,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.2500540516074711,0.909111664354187,0.59,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,0.7988286239230257,1.0938642223599824,1.167321139201246,0.7405915112490521,0.909111664354187,0.66,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.553978658753471,-0.8924562007510436,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.03538619531728977,-1.0999748867047898,0.56,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-2.3393672831410175,-0.5625278455750569,0.7988286239230257,-1.3921908284581592,-1.0614543055744028,-1.9123237248751956,-1.0999748867047898,0.45,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.8157748668826532,-1.3873487335150236,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-2.214554574560236,-1.0999748867047898,0.47,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(0.889452617118896,-0.5625278455750569,1.674257252879766,-0.3977688081309026,0.052933416813421515,0.4047794560434521,0.909111664354187,0.71,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,1.6137028547836172,0.909111664354187,0.94,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(1.5003104360869879,1.9119348182448437,1.674257252879766,1.0938642223599824,1.167321139201246,1.4793780327013768,0.909111664354187,0.94,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,0.7988286239230257,-1.8894018386217877,-1.0614543055744028,-0.40116947644999135,-1.0999748867047898,0.57,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.7685900343659244,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.6362379150939101,-1.0999748867047898,0.61,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.3794478533340162,-0.2325994903990701,0.7988286239230257,-0.8949798182945309,-0.5042604443804907,-0.2164728460869087,-1.0999748867047898,0.57,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.10254860635841155,0.909111664354187,0.64,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.5403910062799865,0.9221497527168835,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,1.2107283885368956,0.909111664354187,0.85,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.1913293954410769,0.7571855751288902,-0.0766000050337147,-0.8949798182945309,-1.618648166768315,0.18650162015981303,0.909111664354187,0.78,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.8021872144091686,0.7571855751288902,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.8413351278107333,0.909111664354187,0.84,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.4130450333772604,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.2611001968177347,0.909111664354187,0.92,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.9366374496356247,1.087113930304877,1.674257252879766,0.5966532121963541,1.167321139201246,1.9495149099892173,0.909111664354187,0.96,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-1.2049170479145614,-0.39756366798706344,1.674257252879766,1.5910752325236108,1.167321139201246,0.08575800359813185,-1.0999748867047898,0.77,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.681324631656197,-0.39756366798706344,1.674257252879766,0.09944220203272576,0.052933416813421515,-0.06535742124438843,-1.0999748867047898,0.71,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.5403910062799865,0.7571855751288902,1.674257252879766,0.5966532121963541,1.167321139201246,0.30403583948177093,-1.0999748867047898,0.79,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.4130450333772604,0.9221497527168835,1.674257252879766,0.5966532121963541,0.6101272780073337,1.1435659774957738,0.909111664354187,0.89,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.24499761810756004,0.26229304236491,0.7988286239230257,0.09944220203272576,0.6101272780073337,0.2872452367214912,0.909111664354187,0.82,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,1.5910752325236108,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.76,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(-0.07046681268810527,-1.2223845559270303,-0.952028633990455,-1.8894018386217877,-0.5042604443804907,-0.7369815316555913,0.909111664354187,0.71,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.8021872144091686,1.4170422854808635,-0.952028633990455,1.0938642223599824,-0.5042604443804907,0.8077539222901738,0.909111664354187,0.8,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.10406399273134952,0.26229304236491,-1.8274572629471952,0.09944220203272576,0.052933416813421515,0.8749163333312926,-1.0999748867047898,0.78,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.0639834225383509,0.4272572199529034,-0.952028633990455,0.5966532121963541,-0.5042604443804907,0.9252881416121347,0.909111664354187,0.84,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.3257796306675331,1.7469706406568504,-0.952028633990455,1.0938642223599824,0.052933416813421515,1.2778907995780144,0.909111664354187,0.9,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.2385142279578056,1.2520781078928702,1.674257252879766,0.5966532121963541,0.052933416813421515,1.412215621660255,0.909111664354187,0.92,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(2.023902852345352,2.076898995832837,0.7988286239230257,1.0938642223599824,0.6101272780073337,2.2181645541536983,0.909111664354187,0.97,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.7149218116994412,0.7571855751288902,-0.952028633990455,-0.3977688081309026,0.052933416813421515,0.6062666891668145,0.909111664354187,0.8,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.2785947981508043,0.9221497527168835,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,0.06896740083785215,0.909111664354187,0.81,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(-0.15773221539783266,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-0.199682243326629,-1.0999748867047898,0.75,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.8021872144091686,1.087113930304877,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.8581257305710129,0.909111664354187,0.83,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.9366374496356247,1.4170422854808635,0.7988286239230257,0.5966532121963541,0.052933416813421515,2.016677321030339,0.909111664354187,0.96,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.5067938262367422,-0.2325994903990701,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.5690755040527913,0.909111664354187,0.79,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(1.5003104360869879,1.087113930304877,0.7988286239230257,0.5966532121963541,0.6101272780073337,1.3954250188999753,0.909111664354187,0.93,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(1.3257796306675331,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.1435659774957738,0.909111664354187,0.94,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.36586020086053167,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,0.7741727167696144,0.909111664354187,0.86,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.6276564089897139,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.6101272780073337,0.25366403120093184,-1.0999748867047898,0.79,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.8021872144091686,0.09732886477691666,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.4887324698448536,-1.0999748867047898,0.8,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.41952842352701486,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.15292041463925066,-1.0999748867047898,0.77,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.15773221539783266,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-0.4347506819705508,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.681324631656197,-0.5625278455750569,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.5690755040527913,-1.0999748867047898,0.65,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.9431208397853792,-0.2325994903990701,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.7705627371761508,-1.0999748867047898,0.61,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-1.7285094641729257,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.1735372034228724,-1.0999748867047898,0.52,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.15773221539783266,-0.7274920231630502,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.57,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-1.6412440614631982,-1.3873487335150236,-1.8274572629471952,-1.8894018386217877,-0.5042604443804907,-1.9123237248751956,-1.0999748867047898,0.53,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.10406399273134952,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.1661010378060696,-1.0999748867047898,0.67,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.016798590021622126,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.06535742124438843,-1.0999748867047898,0.68,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.690219702968213,0.909111664354187,0.81,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,1.674257252879766,1.0938642223599824,0.6101272780073337,0.6230572919270941,-1.0999748867047898,0.78,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-1.2921824506242887,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,1.724515000395158,-0.45154128473083044,-1.0999748867047898,0.65,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-0.5522849012925116,-1.0999748867047898,0.64,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-2.0775710750118352,-1.7172770886910105,-0.952028633990455,-1.3921908284581592,0.6101272780073337,-1.3414432310256739,0.909111664354187,0.64,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.5067938262367422,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.0392123813406318,-1.0999748867047898,0.65,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.41952842352701486,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.9384687647789537,0.909111664354187,0.68,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(1.5003104360869879,1.582006463068857,1.674257252879766,0.5966532121963541,1.167321139201246,0.7909633195298942,0.909111664354187,0.89,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,0.7988286239230257,0.5966532121963541,1.724515000395158,0.8917069360915754,0.909111664354187,0.86,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.5403910062799865,0.9221497527168835,0.7988286239230257,0.5966532121963541,1.167321139201246,1.0596129636943752,0.909111664354187,0.89,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.36586020086053167,0.5922213975408968,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.6230572919270941,0.909111664354187,0.87,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.2785947981508043,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.4551512643242912,0.909111664354187,0.85,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(1.0639834225383509,1.9119348182448437,0.7988286239230257,1.0938642223599824,1.167321139201246,0.9420787443724145,0.909111664354187,0.9,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.1913293954410769,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,-1.0999748867047898,0.82,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.681324631656197,0.09732886477691666,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.8041439426967131,-1.0999748867047898,0.72,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.8558554370756518,-0.8924562007510436,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.5522849012925116,-1.0999748867047898,0.73,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.4667132560437435,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.7369815316555913,-1.0999748867047898,0.71,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.0303862424951067,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.30042585988831016,-1.0999748867047898,0.71,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-1.2071184089434333,-1.0999748867047898,0.68,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.24499761810756004,0.4272572199529034,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.3376170450023333,-1.0999748867047898,0.75,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.07046681268810527,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.46833188749111015,-1.0999748867047898,0.72,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.889452617118896,0.9221497527168835,0.7988286239230257,1.0938642223599824,1.167321139201246,0.8581257305710129,0.909111664354187,0.89,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.016798590021622126,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.13612981187897094,0.909111664354187,0.84,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.5875758387967152,1.7469706406568504,1.674257252879766,1.0938642223599824,0.052933416813421515,1.412215621660255,0.909111664354187,0.93,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.2385142279578056,1.2520781078928702,1.674257252879766,1.0938642223599824,0.052933416813421515,1.2778907995780144,0.909111664354187,0.93,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.6276564089897139,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,0.8077539222901738,0.909111664354187,0.88,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.6276564089897139,0.5922213975408968,1.674257252879766,1.0938642223599824,0.6101272780073337,0.9420787443724145,0.909111664354187,0.9,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.5403910062799865,0.4272572199529034,1.674257252879766,0.5966532121963541,1.724515000395158,0.6398478946873739,0.909111664354187,0.87,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.4531256035702591,1.087113930304877,1.674257252879766,1.0938642223599824,0.6101272780073337,0.572685483646252,0.909111664354187,0.86,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.6748412415064426,1.7469706406568504,1.674257252879766,1.0938642223599824,1.724515000395158,1.5633310465027752,0.909111664354187,0.94,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.07046681268810527,0.26229304236491,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.27045463396121155,-1.0999748867047898,0.77,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.8558554370756518,-0.06763531281107672,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.1325198322855102,0.909111664354187,0.78,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.9431208397853792,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,-0.5690755040527913,-1.0999748867047898,0.73,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,-0.952028633990455,0.09944220203272576,-1.0614543055744028,-0.45154128473083044,-1.0999748867047898,0.73,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.0766000050337147,1.0938642223599824,1.167321139201246,-0.2836352571280305,-1.0999748867047898,0.7,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.3322630208172874,-0.06763531281107672,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.15292041463925066,-1.0999748867047898,0.72,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(0.016798590021622126,-0.7274920231630502,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.0989386267649508,0.909111664354187,0.73,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.15773221539783266,0.4272572199529034,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.2332634488471884,0.909111664354187,0.72,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(2.023902852345352,2.076898995832837,1.674257252879766,1.0938642223599824,1.167321139201246,2.2013739513934185,0.909111664354187,0.97,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(1.5003104360869879,2.076898995832837,1.674257252879766,0.5966532121963541,1.724515000395158,2.1342115403522968,0.909111664354187,0.97,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.6412440614631982,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.0989386267649508,-1.0999748867047898,0.69,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.9030402695923805,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5933022724298738,-1.0999748867047898,0.57,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.15773221539783266,-1.3873487335150236,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-1.1903278061831537,-1.0999748867047898,0.63,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.5940592289464697,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.972049970299513,0.909111664354187,0.66,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.0303862424951067,-0.2325994903990701,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.7369815316555913,-1.0999748867047898,0.64,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.3794478533340162,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.8041439426967131,0.909111664354187,0.68,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(0.7149218116994412,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.7741727167696144,0.909111664354187,0.79,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.9767180198286235,0.4272572199529034,0.7988286239230257,1.5910752325236108,0.6101272780073337,0.908497538851855,0.909111664354187,0.82,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.8493720469258974,2.076898995832837,0.7988286239230257,1.5910752325236108,1.724515000395158,1.7816088823864173,0.909111664354187,0.95,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.4130450333772604,1.9119348182448437,1.674257252879766,1.5910752325236108,1.167321139201246,1.9830961155097766,0.909111664354187,0.96,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.2385142279578056,1.582006463068857,0.7988286239230257,1.0938642223599824,1.724515000395158,1.3786344161396955,0.909111664354187,0.94,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.1512488252480781,1.4170422854808635,1.674257252879766,1.5910752325236108,1.167321139201246,1.2778907995780144,0.909111664354187,0.93,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.4531256035702591,0.7571855751288902,0.7988286239230257,1.0938642223599824,1.167321139201246,1.1099847719752143,0.909111664354187,0.91,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.36586020086053167,0.26229304236491,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.8917069360915754,0.909111664354187,0.85,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.6276564089897139,0.4272572199529034,0.7988286239230257,-0.3977688081309026,0.052933416813421515,0.6230572919270941,0.909111664354187,0.84,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.41952842352701486,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.30042585988831016,-1.0999748867047898,0.74,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.3322630208172874,-0.7274920231630502,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.25366403120093184,-1.0999748867047898,0.76,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.07046681268810527,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.75,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.6276564089897139,0.9221497527168835,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.32082644224205065,-1.0999748867047898,0.76,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.7685900343659244,0.26229304236491,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.71,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.0303862424951067,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.6194473123336305,-1.0999748867047898,0.67,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.8157748668826532,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.9552593675392334,-1.0999748867047898,0.61,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.9431208397853792,0.4272572199529034,-0.952028633990455,0.09944220203272576,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.63,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.41952842352701486,0.4272572199529034,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.1157292295252305,-1.0999748867047898,0.64,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.10406399273134952,0.7571855751288902,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.11933920911869125,-1.0999748867047898,0.71,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.6276564089897139,0.5922213975408968,0.7988286239230257,-0.3977688081309026,-0.5042604443804907,0.690219702968213,0.909111664354187,0.82,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.3322630208172874,-0.5625278455750569,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.08575800359813185,-1.0999748867047898,0.73,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.1913293954410769,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.45154128473083044,0.909111664354187,0.74,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.41952842352701486,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.5522849012925116,-1.0999748867047898,0.69,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.117651645204834,-1.2223845559270303,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.8880969564981116,-1.0999748867047898,0.64,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(1.1512488252480781,0.9221497527168835,1.674257252879766,1.5910752325236108,0.6101272780073337,1.1939377857766158,0.909111664354187,0.91,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.8021872144091686,0.5922213975408968,1.674257252879766,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187,0.88,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.5966532121963541,1.167321139201246,0.9588693471326941,0.909111664354187,0.85,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(1.0639834225383509,1.087113930304877,1.674257252879766,1.0938642223599824,1.724515000395158,0.9924505526532535,0.909111664354187,0.86,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.5940592289464697,-0.5625278455750569,-0.0766000050337147,-1.3921908284581592,0.052933416813421515,-0.3843788736897117,-1.0999748867047898,0.7,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.1903278061831537,-1.0999748867047898,0.59,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-1.8157748668826532,-1.057420378339037,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-1.5429304641490347,-1.0999748867047898,0.6,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.016798590021622126,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.753772134415871,-1.0999748867047898,0.65,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.6276564089897139,1.2520781078928702,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.27045463396121155,0.909111664354187,0.7,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.7149218116994412,1.087113930304877,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.7405915112490521,0.909111664354187,0.76,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.24499761810756004,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.63,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.9767180198286235,0.4272572199529034,0.7988286239230257,0.5966532121963541,-1.0614543055744028,0.7070103057284927,0.909111664354187,0.81,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.07046681268810527,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.22008282568037243,-1.0999748867047898,0.72,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.199682243326629,-1.0999748867047898,0.71,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4551512643242912,0.909111664354187,0.8,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,0.5922213975408968,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.3879888532831724,0.909111664354187,0.77,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,-0.04856681848410872,0.909111664354187,0.74,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.07046681268810527,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.6734291002079332,-1.0999748867047898,0.7,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.10406399273134952,-1.2223845559270303,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.0989386267649508,0.909111664354187,0.71,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.5875758387967152,1.2520781078928702,0.7988286239230257,1.0938642223599824,1.167321139201246,1.8151900879069767,0.909111664354187,0.93,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,1.087113930304877,0.7988286239230257,0.5966532121963541,1.724515000395158,0.8749163333312926,-1.0999748867047898,0.85,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.8558554370756518,0.4272572199529034,0.7988286239230257,0.5966532121963541,1.167321139201246,-0.3843788736897117,-1.0999748867047898,0.79,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.681324631656197,-1.3873487335150236,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.76,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,-1.2223845559270303,-0.0766000050337147,0.5966532121963541,1.724515000395158,0.06896740083785215,0.909111664354187,0.78,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.8021872144091686,-0.8924562007510436,0.7988286239230257,1.5910752325236108,1.724515000395158,0.27045463396121155,0.909111664354187,0.77,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.2385142279578056,1.9119348182448437,0.7988286239230257,1.5910752325236108,1.167321139201246,1.244309594057455,0.909111664354187,0.9,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.889452617118896,0.09732886477691666,1.674257252879766,1.5910752325236108,0.052933416813421515,0.8917069360915754,0.909111664354187,0.87,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.41952842352701486,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.8545157509775522,-1.0999748867047898,0.71,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.7685900343659244,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.40116947644999135,0.909111664354187,0.7,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.6276564089897139,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-2.175842027962227,0.32082644224205065,0.909111664354187,0.7,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.7149218116994412,0.4272572199529034,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,0.27045463396121155,0.909111664354187,0.75,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,-0.8949798182945309,-1.0614543055744028,0.13612981187897094,-1.0999748867047898,0.71,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.2500540516074711,-1.0999748867047898,0.72,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.24499761810756004,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.7201909288953117,0.909111664354187,0.73,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.889452617118896,0.9221497527168835,0.7988286239230257,1.0938642223599824,1.724515000395158,0.908497538851855,-1.0999748867047898,0.83,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.7685900343659244,0.09732886477691666,0.7988286239230257,1.0938642223599824,1.724515000395158,-0.4347506819705508,-1.0999748867047898,0.77,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.9431208397853792,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.6362379150939101,0.909111664354187,0.72,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-1.553978658753471,-1.8822412662790038,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.54,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-1.990305672302108,-2.0472054438669973,-1.8274572629471952,-1.8894018386217877,-2.175842027962227,-1.610092875190155,-1.0999748867047898,0.49,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.41952842352701486,-1.3873487335150236,-1.8274572629471952,-2.386612848785416,-2.175842027962227,-0.9888405730597928,0.909111664354187,0.52,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.15773221539783266,-1.2223845559270303,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.0895841896214724,-1.0999748867047898,0.58,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.6062666891668145,0.909111664354187,0.78,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(1.0639834225383509,0.9221497527168835,1.674257252879766,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187,0.89,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.2785947981508043,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.03538619531728977,-1.0999748867047898,0.7,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.7685900343659244,-0.7274920231630502,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.1828916405663493,-1.0999748867047898,0.66,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-1.117651645204834,-0.8924562007510436,-0.952028633990455,-0.3977688081309026,0.6101272780073337,0.22008282568037243,-1.0999748867047898,0.67,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.5067938262367422,-0.8924562007510436,-0.0766000050337147,1.0938642223599824,0.6101272780073337,0.06896740083785215,0.909111664354187,0.68,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.016798590021622126,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.8581257305710129,0.909111664354187,0.8,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.41952842352701486,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.32082644224205065,0.909111664354187,0.81,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.36586020086053167,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,0.5055230726051333,0.909111664354187,0.8,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(2.023902852345352,0.7571855751288902,0.7988286239230257,1.5910752325236108,1.167321139201246,1.7816088823864173,0.909111664354187,0.94,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(1.2385142279578056,1.4170422854808635,1.674257252879766,0.5966532121963541,0.6101272780073337,1.1099847719752143,0.909111664354187,0.93,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(1.6748412415064426,1.7469706406568504,1.674257252879766,1.0938642223599824,0.6101272780073337,0.9924505526532535,0.909111664354187,0.92,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(0.6276564089897139,1.087113930304877,1.674257252879766,1.5910752325236108,1.167321139201246,0.8077539222901738,0.909111664354187,0.89,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.24499761810756004,-0.5625278455750569,0.7988286239230257,1.5910752325236108,1.724515000395158,0.7070103057284927,-1.0999748867047898,0.82,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.3322630208172874,0.26229304236491,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.6734291002079332,-1.0999748867047898,0.79,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5933022724298738,-1.0999748867047898,0.58,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-1.4667132560437435,-0.8924562007510436,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.223909011703713,-1.0999748867047898,0.56,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-1.2921824506242887,-1.3873487335150236,-0.952028633990455,-2.386612848785416,-1.618648166768315,-1.056002984100913,-1.0999748867047898,0.56,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.41952842352701486,-1.5523129111030172,-1.8274572629471952,0.09944220203272576,-0.5042604443804907,-0.7034003261350319,0.909111664354187,0.64,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.07046681268810527,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.46833188749111015,0.909111664354187,0.61,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(0.016798590021622126,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,-0.04856681848410872,-1.0999748867047898,0.68,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.5940592289464697,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.11933920911869125,-1.0999748867047898,0.76,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.2785947981508043,2.076898995832837,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.8581257305710129,-1.0999748867047898,0.86,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(1.1512488252480781,1.087113930304877,-0.0766000050337147,1.0938642223599824,1.167321139201246,1.076403566454655,0.909111664354187,0.9,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-1.0303862424951067,0.7571855751288902,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.08575800359813185,-1.0999748867047898,0.71,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.681324631656197,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-1.0056311758200724,-1.0999748867047898,0.62,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.1913293954410769,0.09732886477691666,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.27045463396121155,-1.0999748867047898,0.66,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.4531256035702591,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.2500540516074711,0.909111664354187,0.65,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.5403910062799865,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.08214802400466813,0.909111664354187,0.73,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.3322630208172874,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.2836352571280305,-1.0999748867047898,0.62,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.36586020086053167,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.3376170450023333,0.909111664354187,0.74,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.5403910062799865,0.4272572199529034,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.8413351278107333,0.909111664354187,0.79,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.6734291002079332,0.909111664354187,0.8,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.41952842352701486,0.09732886477691666,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.1157292295252305,-1.0999748867047898,0.69,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.7685900343659244,0.4272572199529034,0.7988286239230257,0.09944220203272576,-0.5042604443804907,0.0018049897967303734,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.23687342844065212,0.909111664354187,0.76,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.9767180198286235,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9756599498929738,0.909111664354187,0.84,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-0.5067938262367422,-0.06763531281107672,0.7988286239230257,1.0938642223599824,1.167321139201246,0.6734291002079332,0.909111664354187,0.78,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.3794478533340162,-1.2223845559270303,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.9384687647789537,-1.0999748867047898,0.67,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.0303862424951067,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-0.7873533399364304,-1.0999748867047898,0.66,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-0.7685900343659244,-0.5625278455750569,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.8880969564981116,-1.0999748867047898,0.65,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.6412440614631982,-1.057420378339037,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.54,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.4667132560437435,-1.3873487335150236,-1.8274572629471952,-2.386612848785416,-1.0614543055744028,-0.9888405730597928,-1.0999748867047898,0.58,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.6276564089897139,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-1.618648166768315,0.3376170450023333,0.909111664354187,0.79,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.889452617118896,0.9221497527168835,0.7988286239230257,0.09944220203272576,-0.5042604443804907,0.15292041463925066,0.909111664354187,0.8,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.016798590021622126,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,0.052933416813421515,-0.1661010378060696,0.909111664354187,0.75,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.5403910062799865,-0.5625278455750569,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.2668446543677508,0.909111664354187,0.73,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.24499761810756004,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.5522849012925116,-1.0999748867047898,0.72,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.0303862424951067,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.7034003261350319,-1.0999748867047898,0.62,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.15773221539783266,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,-0.45154128473083044,-1.0999748867047898,0.67,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.8021872144091686,1.4170422854808635,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.908497538851855,0.909111664354187,0.81,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-0.0766000050337147,-1.3921908284581592,-1.618648166768315,-0.972049970299513,-1.0999748867047898,0.63,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.9030402695923805,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.69,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.6276564089897139,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.2872452367214912,0.909111664354187,0.8,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-2.175842027962227,-1.1903278061831537,-1.0999748867047898,0.43,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.889452617118896,0.9221497527168835,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.10254860635841155,0.909111664354187,0.8,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.5067938262367422,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.8041439426967131,0.909111664354187,0.73,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.7685900343659244,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.6530285178541898,0.909111664354187,0.75,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.1913293954410769,0.09732886477691666,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.0989386267649508,0.909111664354187,0.71,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.08575800359813185,0.909111664354187,0.73,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.7149218116994412,0.5922213975408968,0.7988286239230257,0.5966532121963541,1.167321139201246,0.8581257305710129,0.909111664354187,0.83,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.1913293954410769,0.4272572199529034,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,0.32082644224205065,-1.0999748867047898,0.72,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(1.3257796306675331,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.462587429941097,0.909111664354187,0.94,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.5403910062799865,0.09732886477691666,1.674257252879766,0.5966532121963541,0.6101272780073337,0.23687342844065212,0.909111664354187,0.81,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.6276564089897139,-0.06763531281107672,1.674257252879766,0.09944220203272576,0.6101272780073337,0.10254860635841155,0.909111664354187,0.81,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.2332634488471884,0.909111664354187,0.75,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.8021872144091686,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.27045463396121155,0.909111664354187,0.79,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.7685900343659244,-0.2325994903990701,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.6026567095733507,-1.0999748867047898,0.58,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.0303862424951067,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.7873533399364304,-1.0999748867047898,0.59,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.9030402695923805,-1.8822412662790038,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-2.1138109579985565,-1.0999748867047898,0.47,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.07046681268810527,-1.5523129111030172,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.9626955331560363,-1.0999748867047898,0.49,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.117651645204834,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.610092875190155,-1.0999748867047898,0.47,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.553978658753471,-2.2121696214549904,-1.8274572629471952,-2.386612848785416,-2.7330358891561395,-2.1138109579985565,-1.0999748867047898,0.42,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.2921824506242887,-1.3873487335150236,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-2.2649263828410766,-1.0999748867047898,0.57,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-0.3322630208172874,-1.057420378339037,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.9384687647789537,-1.0999748867047898,0.62,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.10406399273134952,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5522849012925116,0.909111664354187,0.74,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.7149218116994412,0.4272572199529034,0.7988286239230257,0.09944220203272576,0.6101272780073337,0.11933920911869125,0.909111664354187,0.73,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.2049170479145614,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.9048875592583913,0.909111664354187,0.64,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.4667132560437435,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.7201909288953117,-1.0999748867047898,0.63,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.7285094641729257,-1.5523129111030172,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5597210669093144,-1.0999748867047898,0.59,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.016798590021622126,-0.2325994903990701,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8041439426967131,-1.0999748867047898,0.73,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.889452617118896,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.2872452367214912,0.909111664354187,0.79,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.3794478533340162,-0.5625278455750569,-0.952028633990455,0.09944220203272576,0.052933416813421515,-1.1903278061831537,0.909111664354187,0.68,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-0.24499761810756004,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.610092875190155,-1.0999748867047898,0.7,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.36586020086053167,-0.06763531281107672,-0.952028633990455,-1.3921908284581592,-2.175842027962227,-0.2668446543677508,-1.0999748867047898,0.81,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.724515000395158,0.06896740083785215,0.909111664354187,0.85,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.5003104360869879,1.4170422854808635,0.7988286239230257,0.5966532121963541,0.052933416813421515,1.580121649263055,0.909111664354187,0.93,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.8493720469258974,1.2520781078928702,1.674257252879766,1.0938642223599824,1.724515000395158,1.0596129636943752,0.909111664354187,0.91,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.9431208397853792,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.40116947644999135,-1.0999748867047898,0.69,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.5055230726051333,0.909111664354187,0.77,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.1512488252480781,1.087113930304877,0.7988286239230257,1.0938642223599824,-0.5042604443804907,0.9588693471326941,0.909111664354187,0.86,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,1.167321139201246,-0.4347506819705508,0.909111664354187,0.74,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.5067938262367422,-1.5523129111030172,-1.8274572629471952,-2.386612848785416,-1.0614543055744028,-1.9123237248751956,-1.0999748867047898,0.57,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-1.6412440614631982,-2.5420979766309775,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-1.2071184089434333,-1.0999748867047898,0.51,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-1.3794478533340162,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-0.5042604443804907,-0.9552593675392334,0.909111664354187,0.67,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187) +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 1.0)(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; +with (select state from test.model) as model select evalMLMethod(model, predict1, predict2, predict3, predict4, predict5, predict6, predict7) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.good_reference b/dbms/tests/queries/0_stateless/00953_ml_test.good_reference new file mode 100644 index 00000000000..ff9c61e403b --- /dev/null +++ b/dbms/tests/queries/0_stateless/00953_ml_test.good_reference @@ -0,0 +1,580 @@ +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +0.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 +1.0 diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.reference b/dbms/tests/queries/0_stateless/00953_ml_test.reference new file mode 100644 index 00000000000..e50cbdd6732 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00953_ml_test.reference @@ -0,0 +1,580 @@ +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.645206721297782 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.6694443959224505 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.4493293816391796 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.600720195229028 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.6762784661885577 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.559635760952823 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6353300559297663 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.6635807616996307 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.4615908676549731 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.6148954951112843 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.724525500316245 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.6814712987389229 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.39027824250652915 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.5406362537321668 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.6581480265671044 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.604770630344337 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.6124292530568871 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5652923919041697 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.5347192073584655 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 +0.6777439840889651 diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference b/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference new file mode 100644 index 00000000000..a760c5b44b6 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference @@ -0,0 +1 @@ +0.7692307692307693 diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.sql b/dbms/tests/queries/0_stateless/00953_ml_test.sql new file mode 100644 index 00000000000..d807bd0a043 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00953_ml_test.sql @@ -0,0 +1,25 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults +( + param1 Float64, + param2 Float64, + param3 Float64, + param4 Float64, + param5 Float64, + param6 Float64, + param7 Float64, + target Float64, + predict1 Float64, + predict2 Float64, + predict3 Float64, + predict4 Float64, + predict5 Float64, + predict6 Float64, + predict7 Float64 + +) ENGINE = Memory; +insert into test.defaults values (2.096042154435875,-1.430135166863733,0.552002055283785,5.530269265662427,-2.724119998880863,-2.727060497877947,-2.6521663150493935,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.156034808051058,-0.4519877395933891,0.34558837162895817,2.2798791370166707,-1.2600139205601857,-2.314726182739184,-0.9176776519268379,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.0227012823747095,0.7073993763424218,-2.526579837235766,2.8884210818462503,-0.04921172682949959,-0.9351603686160936,-0.5773308731642317,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.461704796035435,1.2400054513675245,1.3110456913590716,-1.22465515713176,-0.7935030458046264,-1.103533329941002,0.5919719712269023,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.3957050452186377,-1.9316918657725441,0.9190142057288935,7.155955775162267,-2.8869703029890026,-3.0234929608286194,-4.304748904849194,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.392556430407127,-1.7794168780763924,2.1181012869348086,-0.6814309766916051,2.00404915245683,-1.7928635680687615,-2.425109137822439,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.9685507597915972,0.8408759652866196,-1.2607782469598254,-1.5515619975922614,2.3915793036512913,-0.8003752729444923,0.3318055683772181,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.365215205131582,1.6421911754887804,-0.470904627839269,-2.195888125979813,0.9714278325597505,0.5976321868124256,1.1540464822511913,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.3351152167766934,0.9498577915117139,-0.879126536282473,-2.971335010973352,2.468544204807239,0.5553774318661323,1.093198284507689,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.03912510876000452,-1.3322341365102917,1.6434865408453003,2.7281117051531183,-2.719490284062717,-1.2856678156526198,-1.087994719221058,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.8110134301050786,0.10305735724313725,-0.019183566058287527,1.478933303100145,-0.8948542269544303,-0.7185915708657821,-0.5378349211144934,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.013571717295999042,-2.1401875522838942,1.5751388914372026,2.869365994906071,-2.263892397950471,-1.5905392928904198,-1.317250564711623,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-1.3815235147212976,-0.9616053368120304,2.8150588272277965,0.14759793530998425,-1.620992799677878,0.20786388505596268,-0.9816032789320823,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.11407654661743705,0.768404354463356,-0.3930175233254567,2.3015784648119375,-1.7211987426998967,0.45519975382978,-0.6156907430410832,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.8478239086918133,1.5409911767774376,1.6994582902088935,-0.941221552716078,-0.5161849474607861,-1.0836831033224825,-0.4295520072868204,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.05455524769902653,-0.44441732196125217,2.708301849219744,-4.119367835878758,1.145934474605499,-0.7195943706636994,0.790664128197853,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.1969604043817803,-0.32118839886233386,0.23529133982375638,2.0406253994414003,-0.9957550724767615,-2.2235912952793635,-0.8800043260355785,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.8220150519058342,-0.09416361439372012,-3.047770316012948,5.034883266354364,-2.0143105832194625,-1.5733009655638288,-0.0222530409439472,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.0161176246725091,2.6217682547175736,0.9626736958220774,-7.396443060155276,3.4854283180461727,1.4376798844052319,2.2403875697818205,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.5082554497694574,1.8467142393208946,1.6327843990728441,-3.2881109608057573,-0.4321005482505421,-1.0603588475156511,1.8575619836721444,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.42260650162006874,0.41155861800999316,0.7982889881884394,-0.7237985064171936,-0.8285415729659753,-0.5825003405465955,0.7630457046521066,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.4984953879098306,-1.1006932402217684,-0.4488170035755814,5.409789404959963,-2.734678167398622,-2.9680022720016557,-1.6313962465437406,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.9436912987053148,-1.9262688389287774,1.314850116820961,6.396062133529162,-2.842471758246596,-1.7716503301033386,-4.152218598373375,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.16349909844947885,-2.1701452208414933,2.568526586668546,3.397671556920363,-0.8976577440476563,-0.7471631706579982,-4.256758308439956,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.43511790495037683,0.5111546228572755,1.5168239103908907,1.604718301244254,-2.095124808747114,-0.4602828633136912,-1.1177938053615741,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.5413156314344527,0.09335263935887883,0.5612958143676673,-3.7986008152463135,1.8342221950246018,-0.5809729319600001,1.6392301667689284,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-1.4504814727811615,1.3493103008673883,-0.04616646907891209,1.3117933064479026,-0.7702114172619944,2.2759289480635956,-1.3306427086061552,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.5130854076349335,0.6888754268554591,-0.24046616537106735,1.5838074220098308,-1.6445748079667983,0.6567869990109363,-0.10911343377083105,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.24277413251186197,0.8473320183553533,0.13183067757383438,-1.285681114811781,0.8555624158828621,0.8394005656843551,-0.03496602415650052,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.8369385120882685,-1.341251823971342,0.9554668074045201,1.4270151216516322,1.3962946241553666,-0.7795883140931273,-3.1902671851058684,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.1583479751809334,0.517409603059198,-0.6999515579272186,2.051960782143681,-1.715430664432116,-0.9939038452652763,0.23845436310251533,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.8595203894117056,1.586295759104766,3.24464432451852,1.7792981720712642,-3.5599729812558625,1.0339349200010899,-2.0761447233122485,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.2187879306043835,0.785516320747686,-0.2648586496544352,-2.8228486010789404,1.128464932373549,0.09723332542813223,1.7886949807027714,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.5027908312527922,1.299795068598311,-2.247265548686248,0.3568369726515874,0.3094133364610945,0.4849256444073516,0.9882861752504595,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-2.323680245156419,1.74815453644885,1.3056727348077939,0.19720821301977268,-1.3307294071180997,2.961691552540972,-1.1567709696086979,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-3.4660709804341914,3.0020058328582584,1.5532651665598032,1.5583662913164948,-1.817494404470051,5.014323195426371,-3.0261871799657434,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.07263506966702105,-0.9786215483869296,1.9521065048378694,-0.5412416965904013,-0.7526123488568063,-0.9097656582671574,-0.11616596119861677,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-1.1101210747955936,0.45690435659743034,1.0024061194024203,3.151090618784407,-3.1293373639055435,0.9063184859725469,-1.4156004860432896,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(3.126163478788228,-1.3873077921754309,-1.6696389941434133,2.6802469210649256,-0.681228435146825,-3.632607072537458,0.5151315701276392,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.35121315158298516,3.269898801839016,-0.3139240954702248,-3.3982176643392235,1.5943902174769407,1.665406096965063,0.9632634643458649,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.7468935350733565,2.1854201988656303,-1.5921771449650985,-1.9866930130946439,2.2487176483490816,1.088338402207399,0.5136328198882177,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.8336689441755065,1.9918308776801352,2.2772332104920645,-4.087683288038629,-1.0325983001724792,0.8849166354769218,2.286910253692919,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.977801713559557,2.047290687529743,-1.892163531069095,0.023277725464046682,1.5086179535693676,-0.02241979904892156,-0.3153319898124409,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.0518424311627248,1.8501419588702324,0.8505610339256306,-6.405529783623052,2.0897521277071087,0.570135066692417,3.065661906503785,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-3.467126967504096,3.5784474447980568,-1.593527155162049,6.595207715742785,-3.872578649012629,5.606447409075812,-3.4752544483201677,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.49490773800501286,1.595739466407145,0.28740296306486357,-3.824557248992501,-0.005517967878073571,0.6713599863888331,3.0557952294935538,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.544193867668699,2.3262231384923844,2.750917624599606,-3.510182442015632,-1.2164244818530026,-0.12870618351275448,1.4921405703258661,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.51316443936564,-1.2270576118491379,-0.1511873771860477,5.077623200702221,-2.47128253159166,-2.071110370778194,-1.938581109844371,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.6113192323231587,1.6659128724858379,-0.26101192082957914,-4.320443128005412,1.661337251012963,0.17282617602319883,2.521205470842835,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.8198275616708954,1.3675138581932453,2.4905089781034886,-4.065703441137424,-0.7766613572278701,-1.9487231810266057,2.467596447852433,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-1.9560716071750701,1.8563089934671257,-1.089371283526789,0.45302651466747346,0.5754832357256494,3.377112037476161,-1.1078516930515567,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.5014679676763512,1.46456490318075,3.74940663345368,-0.5180207050201467,-0.9701148885455172,-0.7947236401223874,-2.385191842660675,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.316853101423458,1.2491089344703392,2.3725759643289566,-2.9342129359065137,-0.4183076327718859,-1.155701368032073,0.9779293936805153,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.1849117352329739,1.3925299588445736,1.5695966090587818,-2.1311823024234813,-0.9067969456142655,-0.9769402104776256,1.3185069398877736,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(2.373297959341027,2.775778233617674,-3.987898143897202,4.1703153450619785,0.47977169869012415,0.5341339903160455,-1.8868105390404768,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(2.3482349418405724,-3.1159637626200545,1.322069359815815,2.229373710192031,0.1833587373393235,-3.6718200269675574,-2.167407144040195,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.8243075201573921,1.3348585688363546,-2.0351861522550223,0.44274131356886665,0.7582729504076067,0.4043388560881777,0.26562738440084566,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.9481666208581829,0.22905400262922648,-1.2625401200379784,0.01891167448317009,-0.23629041979461762,-0.8959552087654045,1.483311569076668,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.06585868557878616,1.4576378617673251,0.7399321196221702,-5.557327993134892,2.0615711774643364,0.59937804443105,2.443312546568034,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.5617223747915407,-0.536515447514492,-0.9957168928986968,4.77783798052823,-3.0250516363531137,0.04763704320310812,-0.8503674789558922,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-3.34324723959496,4.3926424059948035,-0.0495291336313155,2.6333253919636106,-1.8973423593226126,5.962186949574377,-3.1074374428513205,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.49887278027307114,2.4772176483573447,0.8766144403424073,-4.412341348998718,-0.06544816902397033,0.17540887369438027,2.973618255958296,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.7781653022461528,1.6160279900558963,2.9043194289987406,-1.6138303698874787,-0.3568046596220451,1.4348863906315135,-1.472812006839362,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.0193028644873694,1.6299059681175168,0.7720871381731178,-6.526365022144807,3.602358868389331,0.05735615709042067,1.942603137953855,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.126058179631438,-0.08021399823747422,0.1845945629753224,0.17818816509562224,-0.738333890554967,-1.3667460232410276,0.6101098938191294,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.696410860620625,-0.6276802386587743,2.4836900187897752,-2.0850016187629534,0.24626466623836807,-1.3510098287109322,-0.044478444238072345,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-2.2180272120355253,2.4305553228334267,-1.5801744943687832,4.862275527923406,-2.2752200612907183,3.8805912201348205,-2.6384927064003305,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.7567743245952139,-0.34730069944053166,-0.8948025108160138,3.0380121675012406,-1.1828054695478198,-1.7157828402064659,-0.7250035618486275,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.8454701528107351,-1.4667747625694347,1.3994753234952881,0.14108982726971897,-1.4662061418653511,-2.2561833089066807,0.7712682192410636,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9311255806838445,0.30138652549697587,0.38513967479058675,1.3739433638375038,-1.148015783327944,-0.8064976661502308,-0.6120628161659272,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(3.364212163278218,-0.5777774492998544,-2.0960237073085235,2.7292130504797565,0.3929841930243696,-2.9133895273811254,-0.5391544963326877,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.0464711573814256,0.6301410336103881,0.6168596799831255,-1.032929924340855,-1.2787522510385279,-1.28640822590547,1.7388375253169488,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.422247332703442,1.3099920188712886,2.4073061721409297,2.1870630187898,-2.906653106438294,1.6982591159934275,-2.362573454685344,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(3.1695741682612937,-0.18516594373997697,-0.7713888778777602,3.1151308383183576,-3.0028825960507337,-3.641700075824226,1.1176723514330833,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.0201468439854502,2.0949741514552933,0.6385052523919061,1.8831849732743258,-2.2046121941585293,1.961396504470046,-1.341031552473416,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9381164870495406,0.7569235185409051,-0.04079716532568112,-1.0646216144008618,-2.1229314622801283,-1.4627720410887246,3.205645865534935,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9437251365046566,0.2476269059695898,0.04785469653893282,-3.162644357415593,1.5437021067561914,-0.853674727031123,1.7551166151989124,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7011087711254909,1.2035331930765993,-1.4398091375364501,-0.22767686518825167,0.8665559020317706,0.35056665369985957,0.3315069768001421,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7691595700548932,0.23226979363339084,-0.7524159985119943,-2.273159847018095,1.2051808874023429,-0.6613989835734112,1.904431917138825,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.9901267648253292,0.8314035869824183,0.9623028761759912,3.0463733919904152,-2.623962359372865,1.2107802811322752,-1.9252298613127752,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.5670331443146553,1.8504800423581038,-0.644940607788113,-2.7678230888952498,1.5881287762026992,0.6450884188501608,1.2333970014028715,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7215290147887311,-0.8847639920373926,0.4904341287870997,1.0732294179644357,-0.08407257982238703,-1.0427528377077504,-1.0423316359603254,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-3.0571866679643755,3.3801167219727093,0.7666061453475292,-1.4047601244502173,1.2542122493912302,5.360634400210411,-2.408846721295774,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.14458899707407,0.806558148488993,0.9258314968497899,1.6039908714694096,-1.8099931519413055,1.3287669410436236,-1.2183570331221776,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.0029511283094880714,0.7392527584182871,2.271615106839793,-0.4594423088240106,-1.302932906147438,-0.024854290186172693,-0.6305929459060517,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.0262556462492007,3.106727638660441,1.552666143363748,-3.579169866499337,-1.4623529808205205,1.7247030376250396,2.395785937012022,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9439810230045693,-0.03450351562051179,-1.8489916117037675,1.627016506901843,-0.2551150847440704,-0.7340241866844871,0.46366450521689084,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.8995507828338771,2.637194803741764,0.5281828736349332,-5.263580235229065,0.7097535677602926,1.7093409623873352,3.1199605290151666,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.2331543227352126,0.576960304218676,-0.676727171313593,1.0171538582152717,-2.82527488357647,-2.6461049785824264,2.6088913588467775,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.884286499274555,1.7159327959050787,3.786765950812899,-6.121056390326268,2.333369727673255,2.6168319013890295,-0.5366786842960347,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.1382122858746933,-0.14299633489223185,0.8327531435987057,1.298580815498469,-0.8627965605758569,0.988030584240615,-1.3967521076705827,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.6303393796237344,4.358235812284331,2.280888586413079,-8.838648817770522,2.239906490938857,2.4513045936352977,2.990325780977093,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.4442835629793667,-1.5595422106625365,-0.14785351526730506,2.4592541040486275,-0.0735148069297793,-2.8435659780281113,-1.3676274520194718,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.4143700456566066,0.8204418264435885,0.967997405875176,0.42646086353492046,-1.564532879987763,-1.275739590687965,0.1318313864473809,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.993790451964731,1.3774074310286606,3.280200674941446,-1.341646747143973,-0.7045036833894341,-1.426903501445604,-1.2265179636048882,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.25515995427833005,-0.4671088714062114,2.2153588526087598,2.313329282416284,-3.5569628024009674,-0.8261756134416534,-0.7263653091644615,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.6355961932522634,-1.0282770582100191,-3.2173580488490123,4.559935052970455,-1.1214958228117986,-1.7827022934914223,0.07193385989494827,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.3283277042612722,3.4105121001777348,3.2195651165101515,-5.324711721749864,-0.9682526335929017,0.5004787785615196,2.2337122442476227,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.754679079237366,1.2099552379791747,-0.4385913525503159,-3.1077997316498673,1.9318023043436465,0.10670563866580032,1.3334679355779948,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.0317090865947613,0.8572264240668982,2.4095086017705816,-4.663118509638804,0.16709538369449373,-2.261736697516116,2.4428573077545996,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.1693473062725674,0.28205162253200255,-1.9303762140352645,0.9887844009255294,0.9897729061853578,-1.3590499520050627,-0.010177228789967074,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.0801920463321826,-0.4298481415473505,-0.33436737741767897,0.8097326513818011,-1.310248231723286,-1.6559624358526785,1.164300884735815,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.04021181298242671,0.22389963328779605,1.9968767300385086,-0.019382197954940554,-1.4497486951865157,-0.29417522140873087,-0.47838412801942587,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.1239921256001624,-0.8638540030084805,-1.0178241055718993,-2.2937149162466777,2.565762757868864,-1.2141062999841048,1.274422252538015,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.7413970807889825,1.5875817859558181,0.8403835779082484,-0.06969468265303144,-2.0112826998053173,0.9991342650707755,0.5897487899339218,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.21012246579494498,0.7349291140125731,1.1564215797263593,3.067109745050948,-3.8072019508231905,-0.4458351151041659,-0.6775773369205058,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.2786193776514114,0.8391330674680333,-0.4026891923466751,-1.3731305159290677,-0.8305074905865648,0.169874931175302,2.3132805058219574,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.2328709703392624,2.7597725867233383,0.5684016239686696,-2.9566618506267175,-1.5157478752904878,1.7699608909022329,2.8392511093116637,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.6871398306249665,-1.4103987067510992,1.0274161223406697,-0.5072792317407046,0.16697719764934948,-1.5964973105562557,0.07247594534487489,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.988330670186111,-0.5258004908649867,0.857816493019688,2.905878095316476,-0.3238823556705246,-0.7203927872533037,-3.1935613280291166,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.4322721114721757,0.30561297616901784,-1.5190220731160726,1.3743262473426763,-0.37180525132367603,-2.018098080706224,0.6319351503875634,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.4632563423687737,0.5381126931941951,0.9013515836533991,-0.4868930388692965,-0.8036249563776104,-1.424272458154115,0.4989428610329456,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.9759142028783296,0.0963990665555634,1.080300923613975,-3.059378549550568,1.7637552314639664,-0.8307617709909302,0.5002521536297346,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.8451444217468322,2.675124983592143,1.8034394339920048,-6.24356070906137,-0.1404077934628427,-0.4290049368154296,4.083301092855288,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.7832957038087498,0.46583490546204087,-2.8377296298346213,1.7314321239250723,1.4637196588786066,-0.5551666584209051,-0.560342527910989,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.0305985048097615,-0.8136835491751737,-1.5375629006726204,0.23344540733313246,-0.38312070583511015,-2.6407899536879547,2.2682169302221693,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-4.450198579702571,3.8044895601982978,1.340371422770127,3.236568823054465,-2.7997133244581374,6.476201660322862,-4.069014914211333,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.4825506606818901,1.8932394950918274,-1.6402434007292597,-0.6438070488741744,1.5377697938617518,0.2190653369274579,0.10746474982298349,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.12865647469516983,-0.03277446362082159,0.3789672161429233,0.13234961251820676,0.10865846661989931,0.1899002744334014,-0.6210816810053859,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.7483525163782037,1.911632146474509,1.0237857931937804,-5.939983118898138,0.18095426014013039,0.7464913363725915,4.2349290686151395,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.4639789336512659,-1.487762211307613,1.2333792712082898,-0.5819847984553231,1.367105196681563,-1.9311626412059815,-1.1352946822318226,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-2.716437954263598,3.2172228184755456,2.486899575348391,-0.27826500422738343,-1.496858928573759,4.189036022930514,-2.271237075436395,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(2.0984679507408304,-0.39222671785000096,-0.00929742777138598,2.4355790415042984,-1.2773465142555198,-2.2069415614400536,-0.7601011284502681,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-2.3851061122725956,1.2652524519794195,1.2056559497342312,0.2301402557556724,-0.13853039522345567,3.166739303466531,-2.143757701306856,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.912501321700246,1.0668955351482894,0.031154669474161678,-0.2922639794504092,0.1586320914087691,1.5749108653175503,-0.4654455435433783,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.6897500753524755,-1.5877093887419145,-1.7611534048954183,2.033285149958932,-0.45562387935528914,-2.4572133028294783,0.9117001207364435,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.03279016425268144,-0.553487415980487,1.5178285275445653,-1.756383753660862,-1.6424327750282592,-1.3694706413196136,2.3514036487381236,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.58004120787043,-0.1972292963993476,-0.13424999439900343,0.0644658482737472,-0.5669375045425562,-0.8960436704764648,0.8194123344316495,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.3142690816498883,1.9522135610917537,1.3104586637571347,-3.120340694946515,-0.7990786213674381,0.031103936415356134,2.1367311835504337,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.2711769727288555,1.0981021590638618,-1.7957098361193409,0.11763102112672769,0.8889146120013874,-0.1919397644256007,0.4140737388483293,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.2753034616688934,0.5396168159983519,-0.25856295996037804,-0.8784121825809064,0.6222845940416049,0.6514517789151233,0.268334498274877,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.054143446852892296,-1.6609882776935554,1.6234667989235132,3.3387697001507917,-0.9389121245324956,-0.5846606129339186,-3.4424309279299794,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.26621832805226675,-0.18078638381031364,2.933879140489032,-0.46282747535339114,-1.7199780636897413,-1.01998740911614,-0.406866592293917,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.04897174356182843,-0.3676084862290635,0.9387028981245669,0.8918277660343057,-0.7366479777100163,-0.33317336104618817,-0.9185779389595495,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.21696194123607038,0.21555874139491749,-0.005133162761840726,4.209335205163436,-2.985056254482762,0.1462920409430946,-1.4879483835912106,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.1919697926532478,-0.06899302259156948,1.011479220945279,-2.6782330940108325,1.4957262168280048,-1.167204400077594,0.5412644793623882,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.797384096830145,-2.8858544823493006,1.4613598752639518,4.082334904310998,-0.48025789276661146,-1.8693084187642843,-3.9155728821524383,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.8513327899828025,0.7458930410858058,-0.7732225705417501,-1.4870005874864665,0.6145060572057287,-0.45127579686900166,1.5047009176226747,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.2510116832256535,0.2754714151780169,-2.265757658761317,1.229877962757745,0.7099703142373317,-0.5550915813556282,0.20254867074113803,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.02808083853107,-0.040629553520089345,0.8900206816703727,-1.3480875179776237,1.3442347323117394,-0.7538223926536042,-0.6342339871101205,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(2.695776681946838,-0.8864088092399576,-0.0789578748776445,2.0458434092506015,-0.970225560557315,-3.0770089140411643,-0.3020299079680173,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.1631434432249037,0.2854532336635398,-2.390500707033707,1.7344940763151517,0.6923406830495642,-0.36218796498051203,-0.21341989806423345,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-1.6503048195027281,0.5243299697796613,0.2251840345614935,3.781488078646145,-2.8118176812215054,1.6996229508611647,-1.7849702798837712,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.7841357579086083,1.4436543212940578,-4.6726465448085035,6.434459937635292,-0.5846417872195009,0.2849453543668835,-2.0775372719522043,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.0822211355799545,0.9994266546847871,1.0465138567217758,2.0558098640968043,-2.639498177967953,-0.8840583888113261,-0.6825001012379466,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.848338734345929,-1.4745072026687287,0.37318698837288045,6.0929889409953235,-2.860229206267653,-1.4979288865033067,-3.1150236297626157,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.2995339588833392,1.2407288550263273,2.640609187687466,-5.723460643589443,2.7512517947788786,1.946472506752308,-0.012081582228990029,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.9946726154312155,1.5401885333052683,3.32058260159335,-2.7680757902230586,-1.5330279328773837,-1.0093823869079046,0.8835422971914466,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.1653969392564758,1.8477252075676,1.5154492658344962,-1.5050500138182235,-0.4399475400838969,1.8901940665945647,-0.3337717224590103,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.3410474945205646,0.9406941157522144,-0.31346932922698456,-0.5250458393014832,-0.5348245647633945,-1.952646624466109,1.3913067179555951,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.4376595283129783,0.12884481167739992,-0.7153536782631447,2.2980804863380264,-4.310130247410337,-3.425970247693062,3.0425484210457308,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.4242822094686205,-0.6739175649059916,-1.6207631956139514,0.9215275442056382,-0.2255601728743668,-1.7552758751749484,1.3017469600205345,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.5634426551277789,-1.5471077082024784,2.4165088824982957,-0.07551896335863666,0.7259879191915617,-1.19324872205996,-2.252728223170336,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.4438980206249631,3.2154267346236893,4.344033519574632,-7.789482359991429,0.27392642950548796,0.2323729828915657,2.58660101167189,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.8266978944375327,2.764653149219914,0.44269893736952115,-1.448029334618218,-0.14573666828341858,3.209923834413559,-0.1568551995293309,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.49796742294949103,0.38611648047359515,0.947852631250811,1.921055938334201,-1.6442237026351973,-0.3807946252730803,-1.3171989797300596,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.2825028600006064,2.4079617426078688,1.3943677343584104,-5.068702752063692,0.3262485206507727,0.361686441352446,2.7646386524149182,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.22492901625026118,2.487212601897629,0.26524983577107275,-3.2366605539208284,-0.6423312073077014,0.4599935245385812,2.860371878492055,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.04824496005648782,-0.41434421911898167,3.2271022590248886,-1.7830389885935827,-1.0845055278057123,-0.9148118678714859,0.10175737670186669,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.2494445038361341,-1.2605077919460772,-0.5919596470609547,2.65848661076861,-1.137208814184975,-1.89192004138945,-0.36297989181266965,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.9368152698009182,1.4026143232862036,2.654968484232417,-0.48052468015489747,-1.4353801796778478,-1.471326764204455,-0.8054078742203845,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.1144180116920606,1.9104663145213592,2.66246604484307,-5.074755087317627,-0.19811341338412658,-0.9123477120908239,2.440556004826056,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.39453752442584944,-0.07366743472831994,1.9655786401195567,0.030511897442377315,-1.4873612106122647,-0.15769770005697964,-0.39586406801516416,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.13705225566650903,-1.066340745793812,2.247663742284547,-2.2163700069902466,1.650571100968139,-0.34030614914782426,-1.086715918625918,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.257058965850754,-0.4841613444620174,0.11928070954945669,5.903325224092789,-3.2500639441872186,-1.4374965938334754,-2.6101536572472206,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.3338018044957725,-0.25783497499040453,-1.912097518989901,1.7897855693470501,0.6967346574866409,-1.8049321045768083,-0.3259566366550859,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.1597881133675316,0.18269125188689506,0.8486870733972146,0.9187771036928764,-1.3457464656817628,-1.263601970316707,-0.28154047796298953,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.3007389767680182,0.46484767063945054,-0.4886824605041771,-2.4201895447056203,1.3963201084273231,-0.007673513374869891,1.4417809458190534,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.24963563676970935,2.146378372977968,0.7902446346235774,-5.6573637067026645,1.9861496459522696,0.7047213943168629,2.3463141909563427,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.5836918839436678,1.3008666070056107,0.598629993661711,-0.10362396303302328,-1.5961048239125133,-0.3129853796094125,0.7514037918744904,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.5229752172383009,0.24565782730994223,0.6095967557050924,0.688197893976115,-1.2881263450703708,0.3444699274985082,-0.15860735569730788,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.713159371718102,0.590874479989717,1.8556281124000433,-1.0879792739972094,-0.885690863908573,-0.8000805235607321,0.1725076813209897,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.8728203729298416,-0.8175386138217031,0.21256366729230014,1.4640205139258353,-1.175325702074738,-3.3996480522044146,0.24937101097686643,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.26386100804843426,-0.681937012093828,0.8719546263837685,0.6595807560020865,-1.0334232838287962,-0.9176670256552146,-0.13807803400017815,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.551767614016228,0.7109567026227261,-2.4802658442092,4.901977885732814,-3.066882464644468,-0.2414288804598717,0.13906877696470232,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.9756434098282215,1.5177936333128244,1.0475803709656935,1.4474573922263465,-1.7751753583320031,1.6220531518629306,-1.4700570193599187,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.47763046455062,0.7743296610978223,-2.5287652392342297,0.7391934469677471,2.226326518880974,0.02544798983127873,-0.7676730030660792,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.610702152006014,0.42910678217008225,3.0903157899137983,-5.390224952610268,1.3934337695947003,0.31851454704530224,1.054856662581439,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(3.0958554477794293,-1.4621148020869976,-0.5551243999064688,4.452619430630248,-1.379337013287443,-3.473330945653575,-1.677775172150648,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(3.362080810136683,-1.1400452123643188,0.6638526272830326,4.3778813924145785,-2.415943199028577,-3.8808958633487163,-1.7763856761782737,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9515114782428997,2.5786148051977067,-1.4363545275647995,-0.6681291822406065,1.442317050314664,1.1465667088200706,-0.3269300577214689,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-2.847938296751167,2.712497525564083,1.1348510423230198,-2.2420055180148903,1.4487652612218769,4.619765374911169,-1.766502892457076,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.8552096265177644,-0.12433378867180744,0.06127441497123598,0.13124974598382613,0.21864608825429177,0.8516308714702762,-0.507455045151372,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9413220120743674,-0.6671836871322345,1.1048795184969697,-0.251817589817712,-0.10041503067356516,-1.389149792100333,-0.26046842750699295,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.8515854524357955,-1.7456600581314028,-0.03925421048801203,1.5179974737998816,0.921332613668205,-2.223550296257367,-1.5207136810245006,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.8801336233511907,-0.4540198439328891,-0.07161754150108735,2.585913277189122,-2.060344360858858,-2.3122434286920814,-0.05721742141110542,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.1565930942796394,2.450186149747695,-0.36499519602591257,-2.6865164333840843,1.7817709621251276,0.5854922377125512,0.5256974003979489,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.285833909861166,0.28691651999098333,-1.099897735586095,0.9901853501724588,-0.6044670039367862,-2.050143304937507,0.8657679727222412,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.445814401245838,0.617451576980906,-3.6857076155185244,5.807368947766343,-0.7232837434835624,-1.0478351431241741,-1.7664121491248945,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.5724051967604904,1.043672733945267,-2.0466438205717346,1.4988175635419767,-0.022443970841448557,-0.5668460356271273,0.202681936318985,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.767326428923734,1.3282660371650246,0.6148708858259404,-5.476743033106995,0.10974913440714529,-1.9823302577814652,4.841465646867359,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.267326496231199,1.617557661552171,-0.15134447708394183,-3.488157628617435,0.05177221139688082,-0.9171772512777149,3.3253618318584692,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.0726650800289255,1.8463940170697746,-0.8554291334165234,0.2971150824858356,-0.9787305516015852,-0.15059128685897505,0.9251737194989748,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.6000678810964989,0.009464861555371407,0.32537504910087334,0.8785831725401735,-1.7720188770580114,-1.041503294055527,0.6853035439619124,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.31903474892623174,-1.9161472026304565,3.249115661818257,-2.064008784693295,2.2511539463109678,-0.4181721655528234,-2.50536511723279,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.27724311948888514,2.269876913502752,-1.0362588939415787,-0.4240851576553433,1.2557043908056547,2.115539216914462,-0.8397651617945024,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.6204471977858825,-0.7472757671052046,-0.44286591935948816,4.984083392550257,-3.765441418069141,-2.3924356302645933,-0.39967559303850064,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.4553901093631776,-1.401190635652457,-2.3384856201428965,2.7925686994223646,0.5230823350598678,-2.536900987998952,-0.31452413492174003,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9908721193084293,0.33504947512645533,-0.15004041559882886,1.9914202896753672,-2.15972930497663,-1.1173470973110544,0.2876627916908172,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.4268729371404919,0.0476100000649724,0.7234066075866292,0.9640920579044465,-0.8390128813007733,0.36362579291343516,-0.9290133023411948,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.7223130581227628,-1.5033618740143198,-1.0063691155313,3.7129996091186506,-0.18424839092347522,-1.9124490582287537,-1.9006188557753505,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.3863018949780674,-0.8118812038086545,-0.06824465995756457,2.3605677632827864,-1.9190940321241714,-2.074049594905443,0.10164582500649044,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.122137640295668,-0.7053791921624009,0.5001218626585733,2.202098650241533,-2.13406560335504,-1.846073420077453,-0.13442355611826817,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-2.612008274681875,2.9273962705582894,-0.6255802858328701,4.821435572962468,-3.6682637014042756,4.076926276736118,-2.3267975850725797,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.14722476209464985,0.7169962280383986,1.30877628107509,0.2902560870390723,-0.5278822077282794,0.2523150652935394,-1.279708896388758,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.7291366403013744,-0.5270029128179039,1.3646324243209347,0.22878411183186387,-0.6994553559333184,0.18645848628858827,-0.7164866293982425,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.3179603782898544,-1.8426294837876296,-2.0930634395627186,2.2618833621656558,0.4353521009755007,-2.8422362994637034,0.2651206458970319,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.16403922504683877,4.218117350808432,-1.464621892755238,0.4525429538867001,-1.1098371609469235,2.24664042651435,0.36048324675723487,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.3213609724022466,-0.025854561408853893,2.639880414243348,-2.0411613386965612,-0.2566331978960029,-0.15905221997635197,-0.12531363631323988,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.5267173926293351,-1.2061059553159688,1.0942381290703467,5.103189751648365,-3.4155924589635265,-0.4164954791259518,-2.502649328522689,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.4855645347515395,0.23735171533067967,-0.5003708194846357,1.7804232308433463,-0.7957779583467628,0.6944973953194824,-0.7601873835159783,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-2.3971333169627815,2.1868183332652453,3.3450712958825215,-4.719603701036977,1.4718198666990285,3.3830233233505638,-0.9827919370657879,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.11857678473749,-0.2366895620149072,1.2347293251374487,2.4546831756152896,-1.8039261811587064,-2.269262710480983,-1.4811644132395334,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.9259627347147839,-1.2059713052048235,1.6474462871354079,0.788474193584277,0.4987767692224161,-1.2387227304804325,-2.2836695458167746,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-3.000029275289839,2.924265303236554,1.5287904697666397,1.8091750655228505,-2.173785091949717,4.4352889084307785,-2.7944599158598593,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.509417258150962,0.9345200865941814,-1.2065038607091274,-0.7231863787024786,0.529992343413479,0.12208026281018039,1.064059623279838,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.843381208944096,-0.7839641420793553,1.1047338725131475,3.200498581509832,-3.6879624786217464,-1.9826767010553936,-0.17031233402775825,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.6996453363330898,1.834603462699156,-1.9563488472181594,-0.8078842985019533,1.603757579443418,0.9023581741197092,0.4157203160510998,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.8780698333418597,1.5711743895099697,-1.1532301645027747,-0.1279147199475934,0.3940852348745265,-0.6780554823489231,0.47599660994228743,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(4.074460008738832,-0.7586132247609974,-0.40680550183518793,2.80044141991812,-1.3520950083731564,-4.299897567538348,-0.23018611363621466,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.537343474263246,-2.346504411277027,1.0696587867609815,-0.09139515915291577,2.6976348801496677,-2.9037343661704513,-2.358064375853471,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.13810538048698184,0.4972293743727757,0.5170017632088637,3.8074275771962216,-3.441529620481504,-0.2520767485969924,-1.1460977221077522,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.3716927651804762,1.5264964546073356,1.4116615829468997,-3.2696400437607975,-0.44330241396466785,0.5126776429602927,1.8969558924443808,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-3.914146075904356,2.642868730715806,0.756953442096455,4.602054020453453,-3.1534100284140263,5.342012379341791,-4.033424004180775,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.6610025539601961,0.47098027882213267,0.09948302448982482,-3.936612690667609,2.4394531934109507,-0.2612419251520717,1.4621079847055367,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.7686849946406735,2.704509185058657,1.3450572364169955,-7.822928994397781,2.9044544260546163,1.9358105418972935,2.7734907448226678,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.080539638439189,-2.1322877957031263,1.6986178322913714,0.36371624049923845,1.429812500230177,-1.7326917232712606,-2.4425242014940247,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-1.167900481192102,0.1355097193610142,2.9097040430835177,-3.6404520903908724,0.9713474861844931,0.8816977448790321,-0.15831403216669404,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.45514503610371104,-1.9645298836180913,2.3714681761255285,2.487263886450227,-1.4334710076423254,-0.7560866446214036,-2.677795087997294,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.205533638434593,0.1522422005591213,-1.2695825588015412,2.5717611851063906,-2.15564597325238,-2.3135028542159386,1.0008109723209975,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.1514247059211036,-1.0644545346285557,0.889971896861668,-0.8027781017855179,0.612875597105246,-1.7103926464884456,-0.014562305063810954,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.9177035463916016,1.3689702950747875,-1.3645490052164024,0.12947308667161297,0.383804924036368,0.15022529478155294,0.3474568882561838,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.0510311481075103,1.6986541281639824,1.4298397013825055,-2.24828571804734,-0.6193865199766544,-0.5672340485010048,1.131261958671076,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.10475037404319854,1.9826630391809927,-0.4359458701822585,-1.9789206321994306,-0.5553707561694275,0.7295103208665263,2.2600055064016873,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.43499110833343724,1.5870101815511446,0.9402541543282176,-2.933159361296762,-0.5955365826478517,0.6100236545656817,2.1125115594475554,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(2.4357050136448253,-0.5731495595770033,0.16933618049977095,-1.7352638099045383,2.4501836994395925,-2.140306061138697,-0.24355599298923802,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.9152646709544332,-1.1044398743526131,0.7264309168930094,2.751047949593423,-1.2155360000324171,-2.376314205559085,-1.5965277293217528,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.563555126365538,1.5905399716363626,-2.054401768001512,0.12558226223380958,1.579243827915478,0.11405592777658333,-0.21982342334862204,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.730455784283673,0.6917046084758414,-0.7228104495687078,3.170055958828353,-1.447442840589877,1.2822906006373609,-1.5715790666666658,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.5567147832410433,-0.38074277886588925,-0.7250043310190759,2.9890681820702665,-1.7854730460169494,-0.8300350245815701,-0.38466093931103296,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.160113601533908,-2.0739287822796264,0.8656089350937013,2.5598075614900306,-0.4549159561400836,-2.039598659196028,-2.035308932344324,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.7301212300757651,1.7905058319133835,2.4785558633754987,-3.285854075731725,-0.2969054302783658,-1.2196278928218516,0.9665388396475895,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.15809910063242794,2.086280383850715,0.4267158940755982,-5.777388598503115,2.932621582965904,1.0770137767265244,1.8492278105417443,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.4346732485474898,0.6310734941541358,-1.404853676310947,-1.1002807120165736,1.4475439430359827,0.2545978186733911,0.8147445978455613,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.7111994909007124,-1.2485377736456615,0.00888551426993378,-2.6270035371594207,1.5232308527755958,-1.511116569724326,1.8232379971332986,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.7009681274533355,-2.098511498004252,0.49402451683802484,0.28198081101179506,1.092044026606271,-2.5049127881573976,-0.7737045360739153,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.350857441471699,-0.9080776890873943,0.4192135312704207,1.0335209980632558,0.5496545069678738,-1.424954540304835,-1.4810527974238206,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.6110098767879673,-0.19648138768779044,0.6976256713944607,0.7330099435441839,-0.4509443081740856,-0.6919587079193924,-0.7985836940346585,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.7120668607049034,1.9568572093714138,1.0113558871394959,1.03831694531311,-1.3192489094050812,1.7439853418610345,-1.6131748737045164,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.025810229759270387,-1.1821577183920273,1.3502904597295187,3.316741043641779,-2.023622604735853,-0.7820762681282083,-2.2180784244243403,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.4823313839367841,0.9550640446662372,0.7796517614669789,-6.113481580673545,3.141750466778539,0.037999576976416934,2.1678622639783702,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.3198057040263189,1.067353282335374,-0.03774758522041055,-4.276016524189581,2.3619524359005077,0.3465583522342412,1.734889684984254,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.3206279075878253,2.9104551041192077,2.29210751642639,-5.248625098223054,-0.558629284361523,-0.6422444653370927,2.973566459413637,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.2335520332662372,-1.3483862701781133,1.6523781388128378,2.032580021967608,-1.9769743403072197,-1.351134129026289,-1.0913704298839408,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.006197780146330656,1.5659161747636117,0.47428711078179253,-4.163105473654435,0.7532395776393404,0.41101356739081774,2.5389845366598145,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-1.653872981072018,2.150652366216212,-0.682391413932038,1.0683573143849745,0.1041132013079018,3.2579744909035644,-1.7333419946625157,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.1929822852229999,0.6893229432312034,3.666180819002058,-0.8739189672652259,-1.4699333333739455,-1.292656078547559,-1.1401278912126873,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.155136793407768,1.556608797804812,2.6765890234500116,-6.068904790037338,0.06903301027490838,-1.3072077729905347,3.3564000590548333,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.21045240367371898,2.426324089796932,2.0395576967297147,-5.872734043014707,-0.09982516278127862,0.12243072729230661,3.4253409716774006,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(3.17277330610435,-0.4559861433811748,-1.4534816279072529,5.475931755644249,-2.7552146063412866,-3.221196770695242,-0.8814034920122698,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.6588973963601246,0.8461887027217563,0.18477915861912242,-3.5310792828384088,0.25782571964298096,-1.7173208517757454,3.2150078520616185,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.17118349950674683,1.118995662564974,1.4568293787618913,-0.5051347078771523,-1.7022847156761762,-0.1348235263823884,0.47918217936316587,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.22222924383517895,0.11857662096295907,0.07650096299472098,2.0379158249219897,-1.471446181869702,0.1853732522038508,-0.7926848379983182,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.3949446302922746,1.370416982034507,-0.3726578951573005,-1.507865895566473,-0.619512343610795,-1.0233127750108155,2.253197907579775,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.1892991131649973,0.2446002905843807,1.5298718807562723,-2.099232339908538,-0.5056025526011423,-1.5804405058815307,1.378631760774571,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.9397609220772734,0.14612060976419405,0.003327490192374327,1.4823264748097986,-2.108057107017595,-2.2375080799048814,0.8543685258649079,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-1.9375716302148769,1.8574155817438662,2.006982221925343,-2.0459560007405906,0.6658052443469802,2.9620627786230567,-1.5001878399436688,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.2402192482549249,0.8729678849935101,2.1191043260999765,-1.8209285767011751,0.0702401507261432,0.5135562190468611,-0.5577240325203157,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.797645624903333,-1.5347261778272303,-1.4584107801210373,6.541970409599133,-2.25967473302527,-3.1433214379816197,-2.1371760232834607,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.2101207627001906,0.8178658070050348,1.345409305335169,-1.9521840925844323,-0.8292096750094382,-1.3207710619636854,1.5018732200296,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.6843456669089063,0.48885992756272634,-2.6849559269116936,4.369671523773933,-1.4771168062402,-0.9821022416444716,-0.4805026737266491,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.23784839921057732,1.3535111387210395,0.05320924751207967,-1.9541402009569646,-0.3500510709804364,0.5463348385111396,1.7919768604357116,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.13128543053550334,0.6798074445687711,-1.6368443198221256,4.528049001062067,-3.362666984877701,-0.02382357706983641,-0.014886019488387747,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.4538532345705868,-1.726862620300886,1.7759464630443889,0.9705528654666244,-0.49477289232990296,-1.4722744644269066,-1.4293619756392357,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.4801653855390309,-0.47453344733200986,-0.09260586995290043,2.687518390442803,-3.092103825000628,-2.3227047457368974,0.8704218574790192,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.5218708026806307,-0.06967317420230557,0.7596210580022738,1.4711668879037785,-2.2608212537809083,-1.0556984545567896,0.1697181766634217,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.4686426053930823,-0.6876980688572898,-2.318133723758386,4.0906358440061625,-2.2111071372497046,-1.888548462638197,0.6761113150287794,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.4655020791006943,-0.18262886630424446,1.9618533997695677,0.8126903231715692,-1.989649844992524,-0.17976489249510838,-0.6676474866827617,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.6720786039475946,0.30664618627008156,-1.7819670224326658,3.342376634237586,-2.127744178113725,-2.492973506799871,0.6527115800200574,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.7709544863051466,2.089208572308133,1.43733785954422,-3.1347865929904026,-0.7427482316186719,-0.29003767369798433,1.9880762501233427,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.004914193301878,0.8836225844754194,-2.8167544354447296,3.730548925991903,-0.14698284122574812,-0.6606442717965159,-1.1677908246516493,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.178670695122552,-0.37343176507494813,1.6102782889058491,-0.289668173735893,-0.5685426730499268,-2.544466773299166,-0.14330590112211938,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.450240693081766,-1.7077791947369563,-0.29053907727783956,3.1577977578818204,-1.574125943917932,-3.3781022323795638,-0.35494151519927786,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.7949700874472329,-0.6895749747428475,0.5374981044761692,3.165455372090398,-1.3991901354081273,-1.017110351525864,-2.011720496675317,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.9997776221443948,2.602928645773437,-0.6342952955734563,-2.148426258044219,1.4364180609082342,0.8128055918648491,0.4823811597366997,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.5142831732503337,0.39128528101053817,0.9008320554174565,2.720050611707023,-3.1508830104429366,0.18317686511736905,-0.7187511553625723,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.24024843070289092,-1.3426586516159533,1.698263715427241,4.97158422740088,-3.607946860074412,-0.8589087656970434,-2.6384582242582013,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.0649229275070042,-0.8691362909724218,0.06127110963748894,-2.4577692790862034,1.3553513321670838,-2.5767544706205916,1.8244096384210655,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.0388578224017484,1.569409049304232,1.55168058988638,-2.7338899094060074,-0.4317685880775276,0.28142214179950714,1.2299760646928444,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.083150208364903,1.0544201332588858,0.4849275584677891,0.030545098979075733,-0.9479940248019967,-0.675804210647968,0.2250820171268385,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.321939824236789,-1.7325735166420875,-0.1953762072802312,5.922742281805113,-3.438389085025568,-2.409237434210855,-1.6126418088678278,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.08186040177412857,-2.5585139391025904,3.3632598057046548,-0.37100416034089057,1.3575022880583072,-1.1842671469006207,-3.156866442574128,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6532751173456468,-0.1563829566175261,0.38904035718586505,-2.0827142213294705,-0.505080151941329,-1.3800157395745356,2.528797835185646,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.315159218931961,-0.09574244146296951,-2.870390868688257,5.331430959491889,-1.6278329123179232,-1.819930686484162,-0.8286246222285059,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.235231767737936,0.7854330832954342,-2.148601058467422,1.895492977094104,0.5666083244157072,-1.056258020890489,-0.5215948847904226,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(4.241292917178763,-0.9860709778639231,-2.0009845087092635,0.962148112338849,1.76426913823527,-3.885947965014016,0.1282356911817848,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.1263292028928795,-2.4050273682272323,2.9554910083536323,1.7828090923807403,0.9076886004084566,0.3679450599509102,-4.839058422078569,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.7101470672682688,2.847398191594129,-0.5856330427022973,2.8707227771069346,-2.014245686136327,3.3640164995655213,-1.8361445565243186,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.38581091755503416,0.5780440904400403,-0.5071088914742421,-0.6090146252730738,0.060807864136913636,-0.12211047185114299,0.8896074381060197,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.5231754402233766,1.9421603486454766,-1.7729788908428823,2.3753911110055963,-1.5997916313255445,-0.3262735124330241,0.2706188768556723,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.820843966643821,-0.10692047584327335,0.9321887238014344,1.719981242218561,-1.5089437086452422,-2.919276123151345,-0.6623159052278418,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6180585065606545,-1.7250090425434537,3.183283866457158,0.6566647784968032,-1.9066003341979854,-1.0063287837463553,-1.1432711661139228,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.8520873302590414,0.9591953810947647,0.12676127726500885,0.5343659255630722,-1.8092748172332644,-0.7540690279448913,0.9279444910129341,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.31530621506647705,0.12176928364261552,-1.2806898307327894,7.142595241207153,-3.5977212186784424,0.5510238558258297,-2.725111194146174,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.3886220250322657,1.8576914505484492,-0.43244838707799194,-4.044760393601628,2.2839267628076234,0.8096845168000543,1.6330072957261046,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6675726022935767,0.20087089318493057,0.6845200898058594,3.6937800329175112,-5.330865424937081,-1.706760651701588,0.9784018600546389,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6116081865842736,0.6341537797659369,2.8798713181168587,1.1828301568793216,-2.9571969765156374,0.24906758002449095,-1.2907026715079555,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6989473726151247,1.2498504500564895,0.2060774042696093,1.1690938756831124,-1.5014992194769494,-0.14794637691692877,-0.2834799610847376,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.5273671236385944,0.9999544767906874,2.7703496758203627,1.207722028899153,-2.501911705844986,1.5436946481674476,-1.9786310839177188,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.702511351487795,-0.34203109814603394,0.7835851548168504,-1.5405081514894055,0.2849694967382024,-2.0575090526779283,0.9992013412095553,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.9665214110949041,-0.19155552919216534,0.7199622529149727,2.9073996081407234,-1.9527120616051468,-1.1166708078512677,-1.5156463719764512,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.1972926334458771,0.28276647040138503,-0.5192444905278686,-2.5476955695233556,1.8593101847023514,0.12004744459504944,1.1846881329737942,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.0321665520706136,1.9966732155667404,-1.4686236794986778,2.3902186300815456,-4.092727086591983,-0.7734708607085561,2.4499981678087295,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.2698946255416441,-1.1605905587383079,0.4187489725358793,2.835484738320932,-0.68793046490086,-1.5864754446600542,-2.017976019601487,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.4416798285809602,0.24811827480851545,1.0654898348977437,-0.4024036574325009,-1.0692237349365254,-0.7179061516427682,0.48702102541566117,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.6907373915312665,0.5782488154633239,0.599945149500958,-0.2547283719058139,-1.1602651261549966,-1.7138182985715615,0.9289975810399699,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.21388172717674148,0.3670796032199588,1.8010065450197448,-1.5292034217343784,-0.10056573944930569,0.13923292684787758,-0.17493465232059124,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.8249165562810634,0.8118811935227044,2.3634010952575495,-8.883011395212582,2.455323134835944,0.3640943002357488,4.16121831002304,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.6123614832674,1.0270743358787555,2.4191824925784884,2.264244528945494,-2.9165944742592664,1.7064826406612614,-2.3591040913743972,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6856967207299276,1.7525897024574661,-1.1579023328670028,2.2589448355407176,-1.2312457357134239,1.8006792346334546,-0.8430752755923367,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.8165914912002683,0.8803866404425429,2.316672635369382,-1.1810808635080954,-0.7924349556466443,1.8423790039564922,-0.7807611895668487,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.5010244046779506,0.34523810497714713,1.3435520505455572,2.1639508161221426,-1.970858397807827,1.4462679112274643,-1.9102916382971258,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5635922598273722,1.4033442818530633,1.683062562422878,1.0596983259384716,-2.158976282461896,-0.1331177596503839,-0.9781682769599302,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.28304003232809394,0.7811221245610349,-1.3923039114076419,3.99712372860234,-3.032968329036988,-0.08346940774160802,-0.044461198603807706,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.173115613211947,-0.45623120871027734,2.175888858443627,2.470563591949725,-1.8629450889871788,-2.445235352837583,-2.2353945966210875,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-2.202431357080454,1.7546984246056434,1.1591425658354584,3.296837897884164,-2.99390938476279,2.901907693620618,-2.5643861199437623,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2507060234279137,2.247796821591938,1.6608145081255743,-4.7160328360136115,-0.29001991756211454,-0.8166791671531242,2.9931321130155855,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.15573258355460207,2.172215007412987,1.8398328672983983,-9.111886152079743,3.1988497003563268,0.5434197773241329,3.727484292533844,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.8328725961197609,-0.6837726198347411,2.9609894373395536,0.8541802329628736,-3.0704598054272783,-0.5282371583328125,-0.3954644151370479,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.2305590281166081,2.1714878997598683,1.7808987263571887,-9.091214440959869,4.142077261397787,1.2804508330843913,2.7234893852433366,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.8464950859920972,1.8457460443518234,-0.7052530209199774,-0.8099187003486551,-0.49123726501052833,0.00934840017523153,1.4156707278241676,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.7264984103515051,1.58762223148286,1.2543531688970304,-4.576041107988799,2.0471164338092316,1.556043827297222,0.7698900485966396,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.6310968833126964,-1.1557887631194408,1.8551643762629424,-1.3835655412181143,1.9814966914722598,-0.8322607453940875,-1.7817987572702223,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.1199173655735954,1.0316065570986357,-0.7388254953223654,-1.5610525631124597,1.5291161750630256,-1.1331188201036435,0.6838798263486152,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5793958654817044,1.1370197985890995,-0.42699818741119544,0.451226751321184,-1.1762866346999212,-0.17284061128496353,0.7719883664743177,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.8052991708512645,-1.1543441822283065,-0.3079753774879235,0.7547558056367234,-0.39720293791911077,-3.439804665164511,0.8189837917408398,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.4024940524681682,0.7830543837865398,-0.11283237135740953,-1.5985039318124916,-0.026048812102019037,-1.1984529193448816,1.7287177333060695,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(3.0147217767070127,-1.0200781629431939,-0.7724586754852318,-1.6645919990450377,1.9943933870089592,-3.191360642502209,1.3263216762617858,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.13531722708660943,1.9535028451727992,-0.04964794910170134,-4.546755747571752,1.8947915970446751,1.1248070457112436,2.0824716923788533,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5780057561867775,2.4389883284494083,-0.06177856070697829,-2.748621215287728,0.45812115038086476,0.6152223729044103,1.5886901010362529,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.0546518884657923,0.18234244286557466,0.11030325399538321,3.2191661811958934,-2.36593743964414,-1.0692768734441718,-0.976407733545978,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2933529177327734,-0.30513242091723924,-0.5615862663372806,1.3659303219726464,-1.362414397386018,-1.6806085153310848,0.8272333759272421,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2391823930807615,0.4859918391655791,-0.4928502195038118,3.3616731079156708,-4.091655429873027,-1.7086947303342366,1.1409546244149862,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.5054439327223408,-1.8924109686046506,2.5786138973436095,3.887056714146377,-1.6860332497357198,0.5234956471939621,-4.2927091788856995,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.3147049070042374,2.9550742125471636,2.0805292078567885,-9.458984787991394,2.8909817970255327,2.2781958951820305,3.6332132074095567,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.1283229732783333,-1.5808489621836723,0.8581958490255427,5.390836449848271,-2.2509658655011426,-0.782618186639205,-3.5335726851924387,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.3314464140423534,0.8129182143050286,-0.8520617594080788,-1.0575404326246254,0.7809407543778316,-0.7064459840496876,0.9995381008322716,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.880225665985992,-1.0411359815296204,0.0510449350726625,-0.3878704148669313,1.401121588230164,-2.981523988078325,-0.2104726020045955,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.1046212143302618,0.987236550938289,-0.42669185582239033,-4.241325872971698,3.3415739009279566,-0.08424468577629528,1.2092562055909368,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.973789947376512,0.8223402130701964,1.304490015055944,-0.8651390659470903,0.41682754650717646,2.4517085988221443,-1.4055044396931808,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.06981536179516334,-1.2065227695226142,2.2774676130672953,-1.1447098015872619,-0.7121456855990037,-1.304068586802913,0.28777483307132834,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.9795069078477965,-1.4473444569218747,0.8422773780928017,0.6313697742033327,1.7025648211172815,-2.0075492615530264,-2.333059370251311,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-2.0600652063829266,-0.6333837621853073,3.468536748603692,-0.8913322423271115,-1.757462156010717,0.812572213213716,-0.6022907633519164,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.98791867951561,3.031826514239644,-0.7924161436687038,0.12654610966629276,0.7081579465881396,4.176833422654864,-1.6699406256082212,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.8426115606298852,1.521152762657554,-0.1337230146189129,-1.4434995314881074,-0.2896581375563225,-0.2428413848621396,1.4665671078648115,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-0.7284609427171894,-0.0633581959686611,1.1837577791819778,1.4350302630784448,-1.685312280726362,0.3762055904421248,-0.9917669857292509,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.13284448420444384,0.48989059418620295,0.649707339140327,3.1534094899577343,-3.2386106987041243,-0.31590614582047116,-0.7870427657819528,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.2813990054292852,1.8372801264131764,-2.379643406798959,1.3652576471003457,0.8512744869758768,0.5316461788691897,-0.6156053305262073,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.2891125617289863,-1.034466590177339,-0.8528073168005216,0.25565750615528443,0.9498395616806752,-2.48113303573229,0.3410176709625573,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.1906881283588873,-1.056056540973113,1.3574824118581417,0.6476728621753428,-0.1322934876060734,-1.6819740111315091,-1.2235936957518294,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.3905684814071666,1.2466198898609266,2.259663679830063,-4.14763740755883,1.900848972347196,2.0483451909922756,-0.4555035477919126,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.007915404964254469,0.9420317471279528,0.294832519263326,2.582719495108136,-2.3945080639778853,0.28592816588339703,-0.9237809797403697,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.583521877945629,0.5331277730352217,-0.48721239763332447,-0.9498752906318381,0.346744013775807,-0.30613068397450366,0.9852227565956533,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.3038572775603694,1.8199226286216352,1.7209044780887788,-5.871244361704007,0.03082808989632535,-0.3313693128329034,3.8557824350560352,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.4668677560682444,0.615864357805121,1.7525182699336228,-0.8210346671163282,-0.06020757379664965,1.6749795990476146,-1.2205165325854055,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.6437634561464207,0.46869838369521777,0.2512633646181748,-4.172634394188566,1.8972887815402877,-0.5040107496571128,2.1281248265853847,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-2.566685802269739,1.3703937592515176,0.5522319795313368,4.714571322966261,-3.304529843224266,3.1700807408713936,-3.0669517754857556,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.4321320759545988,-0.5852717998212875,0.9344530828549473,2.2230574005646426,-3.0763883080523486,-2.405005631784908,0.40557678200484926,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.9641855971738517,1.5212499636636303,0.6152159628327369,-0.6607640817743697,-1.6102751585503117,-0.6616239847898601,1.3104820483943997,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.7048725942936547,1.6561110071176048,-1.6410777840461575,-0.021542409537615766,0.8497272700517364,-0.27637230275554314,0.29379908986403824,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.3877637394253206,-1.260106166916444,0.24240366155067983,3.254511285225256,-0.3359126390530982,-2.495451370201776,-2.4430734577527575,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.7159795394991253,2.058479403961047,-1.0298338285959132,3.8830429726396325,-1.9236847469944287,3.092667652752938,-2.2573319930263267,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.61157813457322,-2.4629468072718197,0.5947853311127764,2.611227042557338,1.956298392040809,-2.746393521796805,-3.94414512547543,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.100378156997694,-1.0254193606740454,-0.3383292598098695,3.2522179469555192,-0.9092591620666294,-2.3140923190362463,-1.4339917844306427,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.5793051540109753,1.6188751709051976,1.3848844184755469,1.166034226400195,-1.1259010183836429,2.4684572651406573,-2.3025016844857564,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-0.16989054765279876,3.48842017914546,1.9300555017851737,-4.960543036879973,-0.584002148725781,1.2038222628858277,2.568256118525951,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.3846175270079646,2.145798875875564,0.1748386720212266,-4.796962390806608,0.5073503830831803,-0.7852786914681317,3.731869923790979,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.463498091505543,-1.641948347672444,0.014419220996607973,1.2485427665891868,-0.4093101695125,-3.315069785949253,0.14698377443441846,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3015458148717531,2.4084218001678828,-1.9377479084764957,0.1461762550285925,1.181541855937334,0.7614544555573661,-0.3175290393124959,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1995047619542676,-0.5685997445105482,-0.7780001688368265,-0.4208529275293881,0.5408090529552546,-1.441434337645698,1.0491529750596622,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.2789267591912103,-0.24431600650961838,-1.7008831850097177,-0.3956028703382682,2.2778328150392717,-0.6617441978281935,-0.01943996576935536,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.4426854749839935,-0.4544872588795166,-1.5961072511292693,0.12966802768765306,1.393550473376669,-1.1771061322845136,0.352301270605195,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.3811254347865457,1.3090655871933126,-0.27688380534200907,-3.0070886914719375,1.064692283384284,0.222022515151732,1.8721838900322956,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1193434289666437,-0.6252656232912621,0.23118248743666925,2.685581337005184,-2.153833997930418,-1.6998262419123031,-0.4037349176707249,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.929529577814512,-1.7024107022914883,1.2488247870677989,1.2738796125012244,-0.5345104518047759,-1.8796928677805893,-1.1427878473451383,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.8362075518180005,1.1085707711145794,0.9854067590709947,-1.314041820148795,-0.7016240360391046,-0.5921632413160102,0.8578333456580334,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(3.5781343752139643,-1.756334316490143,-1.8913637043295912,3.8207236620641587,0.5041362860876586,-3.5985748597254386,-1.4898228334981138,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.3438720049323608,-0.24833525627533626,-0.8346231392283516,-1.5319164096905173,0.7676105738102315,-0.5790077722354865,1.78082722778547,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(3.0647342782436895,-1.0260134932323655,-1.2844635442292494,4.455520074360008,-0.33555784108704956,-2.780046271993584,-2.251683378416552,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.1706511098490927,1.427297039001016,0.16198610469672814,-4.678308717576381,1.9758795045738022,0.4947574282507664,2.2002784569922085,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.562622677878104,1.7307650405142323,0.30622820821123853,-2.7159606100756912,2.3010271547514884,2.9293712371855865,-0.7525506989141675,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3230332705184404,0.43074369107629307,-1.012178677869002,0.3764842669438245,-0.08467152822680513,-0.9691680411489616,0.6840966010729281,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-0.6935320192169789,0.7446618818491898,0.09665333347742111,2.668069679850536,-1.4079283621598315,1.2190489986881268,-1.877269359035067,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.6615988715176795,1.4283536020765286,1.1939007488960722,-0.8584576982487286,-0.9666534542260612,-1.1587443010384395,0.44873555048520886,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3850989235975144,-1.321996217461353,0.6533355400578518,3.765014097672636,-1.0657673636987341,-1.7288501469488284,-2.7515588732367537,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.679404226498682,0.4488111266798771,-0.09194107232644777,-0.1276070545791313,-0.6321422212401715,-1.5847461579670379,0.9576005483141299,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.04659758707243,-0.09637025410588262,-0.5301580315997092,2.3882076811218886,-1.1488798805266265,-1.9448358030407187,-0.4760994417763218,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.9502778204515043,1.560900513420219,2.6139226644509987,-0.17703081525604314,-1.3385353345210982,-0.31964658388963124,-1.4084087880151692,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.7064636980022851,0.7232269304349839,2.122895762364635,-0.16484613782968235,-0.5171650348762113,1.962539190063468,-1.877610385342741,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-0.27650843111684753,0.8824040605554635,-0.30196780207451157,-2.686121134883907,-0.17986243753961562,0.1554027845787418,2.9180254329681845,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.4055828873228918,-1.686704469180161,2.267279261928881,1.4120459259316966,0.32553090572843124,-0.9591177085579479,-3.2406871412917724,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.7528205900707885,-0.7838213498913917,0.42720475600569097,2.4810550424721343,-2.2722544267653983,-3.448555825513464,0.07050855537470957,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1680246800757323,-0.40872210452552404,-0.4508203946039193,1.8115932970624247,-1.3903370815714982,-1.5343584504031225,0.30070498273072843,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.641411139391031,0.13066169098555191,0.013403427494233067,1.5312226380139464,-1.797441178406297,-1.830627427150842,0.4303846195173422,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.955478907567246,-1.719506740185793,0.762082256889067,0.1866756780988265,-0.9744041434997593,-3.309776136185275,1.0986283866533104,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.029214776852436,-0.2878096697019167,0.4084705542378164,1.7382336286765805,-0.6833067762076729,-1.9810690593038442,-1.0883122722276921,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.560341449711872,1.5663634023069921,1.0471848595431368,0.1098488111202763,-0.7390036919795584,2.3112166370786724,-1.236752105743788,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.2089307327631884,1.9964256833116285,1.226378416624192,-2.4725235681126247,-0.8107018052923085,0.30001515631040365,1.5070634835647967,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.9128041176239442,1.8895100577112083,2.2886808335130913,-3.820954170467079,-0.6052835544037938,-0.623305490142599,1.866033800845503,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.993453919875277,-0.901133069473183,-0.0373521979721787,4.2922014798199974,-1.4822374048552227,-3.057711957842002,-2.1409987015165632,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.6766898453496916,-0.5261764912138024,0.7312972156077737,3.9581515737988227,-3.6502190772987513,-1.4820841451981968,-0.7891414274310181,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.14295833912761002,1.6231233113707968,0.18467857172572733,-5.3244744678874545,2.795954007446923,0.8238138676166966,1.929063833460194,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.7984907565135961,-0.08748991514172744,-1.908421605424304,1.0997506504768602,0.0193869641026021,-1.6007691098789487,0.9508597268855666,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.4795447177170868,1.558265108527901,2.9519444855092285,-1.7082112440267474,-1.5242435982351923,-1.2321506790399888,0.17024643186890942,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.1397560857395845,0.9929628562316919,0.5750597254679413,-5.175405133250185,1.9970886299361146,-0.8051594629268625,2.6421930794939943,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.2740780719977765,1.1197184976428955,0.651490056121677,-4.4266113109917935,0.15736308604688132,-1.390854468713751,3.651477122782289,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(-1.0402991953119143,-2.06533833303297,3.758708846819417,3.6643483716116036,-1.9836502961873896,-0.15018640286882878,-4.728987719679379,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.388042546834122,0.6351311476333177,0.3087393130542635,-0.9747105355778285,-1.2058573277731863,-1.5810825745871568,1.9467994460089018,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.6408026773429794,1.4879283180814786,1.547058272073475,-1.3451802114196914,-1.1447992224936614,-1.2638772850029756,0.7853236881637284,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.0708542922701993,1.2711484350719897,1.4339591134115544,-0.16035643681145156,-1.184129814417774,-1.5691360483142587,-0.16642233400730944,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.8610958818630077,-1.8798623440397844,0.017309940244927047,1.5547116910354313,-1.2884818488253607,-2.214675539259715,0.5772827870563995,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.31017681214048487,-0.5669909849550294,1.9488706008510093,0.8765489312330507,-1.1971421401945954,-0.8532090545239664,-1.265147944962231,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.18497775560572882,0.4850151901864863,-0.6551824564727529,4.63982714028508,-3.2551402962092797,-0.09431469092158731,-1.0924304335485553,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.4669444008351666,1.859760910530527,-0.10218608993775513,-2.7065907109099916,-1.0087009804989429,-2.1344551850779685,3.6376693906822846,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.8238485766287365,-0.3526798936194202,1.5512566546145274,-0.783457568001856,-0.609118220503116,-1.3676361438381344,0.25775920670818486,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.4279886506498394,-1.318933410675522,1.786893864552341,2.319001466307592,-1.3636960802506595,-1.2080158126691145,-2.140891357760963,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.3245577743791705,-1.655861652943644,-0.5357071043474062,3.763999930078965,-0.8970789230750165,-2.833502507806386,-1.5072610448030646,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.285195766833195,1.6783115876604113,1.513434891521249,-2.2682980117838745,-0.45638868017239276,-0.7418730885738332,0.9488865767818059,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.3481586273438384,0.5174277441556074,0.8785338801961253,2.8147248395427154,-1.9625677135620347,-1.0292085195161238,-1.7895813340376878,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.6954065675726984,-1.3664621081516608,1.5476108546333234,2.180283590956567,-1.293895789561963,-1.5096513815855221,-1.7765071005868003,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.38827399019045394,-0.49792022753587073,1.0198058264078862,-1.5037569154998438,0.6543768219469193,-0.7437803404718291,0.2098285257737864,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(-0.3404731340559216,1.2427923266757308,-0.16300461061876503,0.2831612899496902,-0.34457609890571084,1.0720599628234369,-0.3514992450509097,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.3161748863138345,0.997351948912386,-1.0801295751777644,0.7571521026186296,0.0016508799060777068,0.48479285742246886,-0.13508160168753358,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.12681720829445697,0.11855714969664732,-0.9104184710851837,-1.085292209788002,-0.36232862899070417,-0.46951670408525054,2.366122573967455,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.7054632977954634,1.2572176853681154,0.860029635692299,-2.674401827682585,-0.6939897336698935,-0.6804162818791725,2.3309482151237217,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.07976657146411,-1.4207183531564556,2.0010660824353304,-3.194648928592429,3.2399872347286767,-1.3523756841739691,-1.1253482654531937,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.23610519315312728,-1.7449703241490164,1.6819741303788158,-0.10873160707117276,0.05416324589686572,-1.3123804509649377,-0.7907457427267194,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(3.0428333674190866,-1.0841060957114639,0.17243967022211515,-2.377637313997145,4.364469885879871,-2.4605659936454316,-1.2447560474503905,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.6701855712395437,0.2928301757559636,-1.5428673307968002,1.287330415870048,0.2727252075767579,-1.0692518489650513,-0.035616454995755165,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-3.4800819804037824,2.977389692948332,1.8517753132543673,-0.19008504775532553,-0.7707879065175474,5.033813816903953,-2.5333706554638304,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.140202012142074,2.378634968895875,2.7556348176530534,-5.2834702463746215,-0.3652107320195507,-0.7350150171567257,2.5581641229084484,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.0981169615204438,-1.0119127261725325,2.2820770387227434,-1.9614013769844154,-0.5644666042090782,-2.284934214852611,1.078012639576424,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.8517786531323737,3.6302113892867838,-2.0029871207282746,0.2619852928861331,0.17390567848052974,1.6325105715744603,0.09423329683760107,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.4165800771742705,1.1149308340527142,-2.271387795418956,0.24518100275596663,1.6930308923123703,0.0011584811148082907,-0.08553747108993615,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-2.0053022769813875,1.9109759825293087,2.773376480448724,-4.517202660362165,1.395196983263658,2.817448384076263,-0.39825181111140695,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.5355188940690749,0.6018680914829695,0.7541924354853773,1.0775908586661713,-1.0907319838063005,0.7639886786882052,-1.0624390472003777,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6595797552374167,-0.294809475541403,-0.9630206945978195,-1.5012079340321822,1.0098225390572804,-0.8157334681048121,1.6881542023624867,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.720237261284876,0.11277874103206109,1.844572508290903,3.1533623636012984,-3.9104997386815334,0.9943897606151588,-1.3654061835218285,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6922463463083346,-0.35073899252145635,1.9626145160108819,0.08179158347355334,-0.9530812260330679,-1.159859309462594,-0.7170911906049338,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6413378935676259,0.1773899280357525,2.490383604140318,-3.8237997263323082,0.3863233217240887,-1.1052859279962846,1.309165949800489,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.918763813284105,1.203162397621166,2.561321396321196,-0.3779626409007189,-2.283467449993765,0.8127359401206152,-0.31172201669053634,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.41808616994891934,0.6297437830552794,-0.43519990266235187,0.8152590429422543,-0.4861773114380574,0.7939395653553468,-0.2700384949502228,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.0589503046935691,1.1096474018520084,0.8430477162065145,1.017463543138896,-1.8449195206430737,0.23001103979814566,-0.41668386521379497,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.7035305093965771,1.852386714172002,-0.8581310953858379,-2.7047073013316734,1.7544323773483619,0.5857189112040242,1.2179049628159166,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-2.404521999474064,1.956856261585237,2.743662957828813,-3.763120660309916,1.2341598733468144,3.336518429323325,-1.0843551531070281,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.5787514548491495,0.9043297397824689,0.3647966016141414,1.5615325941265177,-1.2949689138659002,1.9742065688305668,-1.2806827013749367,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.0235078222978835,3.0475095656963602,1.4758089211909295,-8.183689162345186,2.311408931029436,2.0996841788530536,3.4655603211752783,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.4171153313833007,1.5601837547522388,-1.788047063738159,0.6536070698420184,0.03991294542935109,-0.23285562477977859,0.5515980511199634,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.5943012663247385,0.768939524488533,-4.7102725616072085,6.878524574598383,-0.5433735742893244,-0.8204559726610645,-2.151320262569758,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.095928691139254,-1.5364598955767699,-3.539396767334079,9.353427912472746,-5.3917492321240745,-3.143207068564544,0.002434375177712278,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.1733973608839687,-0.4779398907232715,-0.8222573364108066,0.5741388087269558,-0.8233349828146013,-1.6623616225589888,1.4089015715206914,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.5968720217016728,-1.561183647496414,-0.5368548320897575,4.563481344641381,-1.1935320996872132,-2.9643545782562257,-2.0430397264366764,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.714041736048137,0.026319558085377337,2.358390982988962,1.3832961478997392,-1.1938325736946396,-2.6210410239146587,-2.0630733441327145,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.0224268255603193,-0.3251567068096688,-0.3890143766789398,4.248774781294234,-1.7156272804262211,-0.9098747934249555,-2.0634504893495587,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.2466469802152655,-0.6104373122047839,0.013869093684521272,1.4174148121004353,-0.9299675669968678,-2.588397575094862,0.05056310478616921,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-3.734598766339932,4.357711910775082,1.8063222011726097,0.5647484734204162,-1.2668904831697467,6.168350149687059,-3.383175902767071,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.5075416946835463,2.826260938878084,1.6757291381825439,-7.312162195113464,0.5879313407461273,0.9973913776640214,4.309180001467237,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.46423411343145,-0.6005198090658379,0.9652261368365875,2.779552976547825,-2.60911189484479,-2.1363879310601983,-0.68726399922343,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-2.1740091482509643,1.7158438812483352,1.207751628708825,2.1653318489129973,-1.9385559871567524,3.0041298293453407,-2.4842256171560244,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.7576001841832798,-0.007594954223985706,1.0139997501431828,3.0324645799871592,-2.8287853572848425,0.352236350020044,-1.3663697410958096,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.22682005310878983,0.17882393778738837,0.6852239252823532,0.6996858648832547,-1.1005329373372745,-0.33694671576753815,-0.2923121947217511,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.6420808677485317,-1.567375548263394,1.3596455396410332,-3.18643779804509,2.6618463434153123,-2.2371667201597454,0.22533544015338114,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-2.4762355913130216,2.18020271868241,1.3238107587214825,3.0782376854873186,-3.2670188241062785,3.2966864834016447,-2.424026089867702,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.4681164581671533,2.7802016066061546,2.4377514573974084,-3.504681185661089,-0.33038317365035264,0.576740491675048,0.6678482697206392,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5911030428508862,-0.16060250554086664,-0.01306065642624099,3.934006680488941,-2.120769002361267,-0.6016009232082299,-1.8031712223115948,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.174745604954626,-0.4965423351198456,0.5943755851379704,-1.1052321260476299,0.2661649679666236,-1.5726083173913104,0.718004049467069,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.7412751177208392,2.1327090440707304,1.194964453595523,-8.044195522762877,2.831742609518064,1.4456391207259371,3.4658128935875947,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.4728274623052195,-1.4446871431555646,-1.473077006061342,4.962183982602092,-0.877344961449386,-2.5959492339011856,-1.96852347020304,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.4964109038216507,0.20917901186206578,0.033859363997187364,-0.5696525703041693,-1.37076844681051,-1.950833571036897,2.1420942100235636,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.45583852223057186,0.9139217880820522,-0.503312639124806,0.5499114765531566,-1.2222692214056665,-0.20147776675726137,0.8599714517914723,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.2737373806536043,1.27270826072556,0.4760375405877796,-1.801901825509861,-0.692130105318383,0.44709954001227903,1.6095875372621724,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-1.347794187900541,0.2524553675565264,2.1003710485812177,-2.9225590783504978,1.4128230662455974,1.4304610174764638,-0.6822127662589081,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5871361479153822,-0.8417339321943338,1.1995718501271524,0.8202523967506464,-2.301137318093607,-1.774115856891251,0.8098563835220876,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.21508659002268615,1.569888963274912,0.03986115298828641,-3.9601982606129926,0.9380243205292723,0.7121236564430702,2.5119291735464375,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.7941481129839723,-1.0798806957539784,0.025240123668783254,2.633977218875101,1.0284753931360715,-2.3842856430416517,-3.002641820170753,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.21207162097481735,0.4647940297522595,0.46295798512172415,0.3232524421339397,-1.6159135710807149,-0.42882666161264194,0.7335086616487765,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.4929756391749678,-1.155157311134643,-3.4806846906158686,4.0693214517288965,0.35597074350303237,-1.2793994744342176,-0.6586972623541594,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.6854581171681562,0.1834002919426212,2.0365519468046482,3.858832265773903,-2.607252553631471,-1.5355541412174958,-3.1426914316979495,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.8327800893646486,-1.7343614197962078,-0.38324008318772385,4.214850202134405,-0.7612512185075357,-3.2089289677127355,-2.1597330449132066,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.07122882463582014,-0.6138287383249159,2.384026551347024,-1.7146604393110776,0.6628743724080095,-0.5031775744589227,-0.8780321112073121,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5714623898190813,1.8499637809618559,-1.6528766898390757,0.7922648746756872,0.009123352945717644,0.7920546495067624,0.05588645257506697,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-3.2633273539187027,1.911289368256512,2.065182047264482,1.922313389116063,-1.9358969584812344,4.156853974629493,-3.297822591979971,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-1.0527594231003512,0.11046706857150712,-0.17034216295607751,2.002056902252602,-1.3909207669150798,0.9854200330466844,-0.729769914147927,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.9857432393597216,-0.797559664346102,-1.8628229075290526,0.7912416658605166,1.1189706285668513,-1.890957287869455,0.41557152949411214,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.504762737846811,2.1769977714122506,2.57992693306698,-1.8747939851770445,0.46865410489106774,3.7026137438952347,-2.2438143549852185,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.41886628561756134,1.997961493652824,0.45098865921149955,-3.9240951571422404,0.6720821012238447,1.1131211300973887,2.1496317763658626,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-1.269058850471455,0.9113128779485802,-0.987609614890711,5.17453944944951,-2.792635641455655,1.8633254768112497,-2.225434601190937,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.60221516530219,0.8573873954567277,-1.2532323321502234,1.4586670560212756,-1.2872866648841212,-1.184906097673008,0.88142213963169,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.664945717778535,1.7074410216455105,-0.9164942360480002,-1.7328352122931063,1.042439944629323,0.4681254075262177,1.034268339879112,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-1.0229129860675013,-2.780448032379326,3.2847626195180495,2.509568320419263,-0.8239377084416294,-0.47304522543584926,-3.9581559499963603,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.357349140742531,-2.30529006767782,0.09791220462993844,5.626021471718858,-1.5946347715827764,-2.1607839211751037,-3.248371527799422,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.19008566471204968,0.9075514438212983,-1.8650607875027787,-0.8680513536341087,0.7997443732584267,0.45238678503301627,1.526885288707088,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.9254711696053395,2.1750597750267042,2.1933277965486973,-2.4693963476817404,0.3973459599348179,3.9233999600808573,-1.2357640687177518,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.233619763358607,0.9913146965561134,2.3973693810536236,-0.8070564887140679,-1.45741017327986,-1.1664320360973062,-0.13201085846744465,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.3161303390254758,0.3276995534451512,-0.02889035651373595,-0.8230808482804979,-0.5319352491047409,-0.47967360079060634,1.36719581140463,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.5317287425894308,1.208735839267825,0.08407141955287045,-2.4813609730490715,-0.8888470073318796,-0.6122551141011588,3.060645109675252,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.07298769165290997,0.819808188036161,2.0384919882650516,-7.748399227191985,2.2435939891188377,-0.18719747936307643,3.6016374001334093,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.7901852621466418,0.5145825360308702,4.637957908386738,-6.150836801745065,1.3912229090534307,0.440132724867259,0.3252310211529108,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.831671718235779,0.5977438753380795,-2.321886357828979,2.9104235559256404,-1.017343884238508,-1.1877468146597532,0.22300620292739104,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.1539924701669846,1.883675370067507,-1.7680881855073274,5.807546701204832,-2.7646119804927913,3.473472133586789,-2.7200321903160463,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.756348176804372,1.7615764405819676,-1.5388289669836195,0.07080621692501461,0.6426698929723338,-0.3106612170666746,0.277797622658288,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.2487545187544351,2.609229589371483,1.8882144277890807,-6.154774232631951,-0.5638199006934052,0.43112941318589476,4.2027303973580565,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.10955533675333518,0.9087196837335013,0.1136664013383859,-4.1472494266956055,2.014924031822069,0.3431702042196298,1.8459002928252932,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.6652930532149404,1.197530864301426,0.9169919325624285,-5.961473613444594,1.8351066038331625,0.8272159997488158,2.950791256392912,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(2.9316838982943185,-0.6964392952831678,-1.1502529215081365,1.4921077726597665,-0.5780146627368032,-3.196356469849491,0.85907655235715,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(2.600077692763368,-1.2623740481307253,-0.8962595005959539,1.9679383389242255,1.2790953056015506,-2.4139441686510956,-1.6329167452667077,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.452791564760785,0.41146795445009166,0.14392806279219328,0.17108543131200796,-1.029600784845083,-1.469443131098191,0.8077470058618661,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.727098084005239,-2.5546937777149403,1.5105485872014457,-0.29443260630992396,1.1439390403078158,-1.9439707234539425,-1.1506513582879956,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.7021391905991415,2.4414499286754787,0.8074093066989305,-6.070712605446909,3.5191034192402006,0.9707334993431298,1.1288619039998729,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.9308026588402101,2.57928079368376,1.0748311675888704,-8.529095009719802,3.699706292413457,2.1444358957249268,2.9816820943899875,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.2360219692964298,-0.8921138259532037,1.324707218340896,-0.13529792443717042,0.03483533664127236,-1.7310071987282634,-0.5952741360978552,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.9580721326511403,1.515267173693862,0.9547831554732867,-3.792366629532976,0.14805240219415627,-0.6733000064089022,2.4871576141650023,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.11224442995910122,1.6882722404753472,1.7161782543665778,-2.9486619700579975,-0.6165883797519401,0.3909989063485372,1.4200766219929295,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4004498564816448,-0.5483306586274586,0.6884992629346187,1.6860799533920177,-2.4028921057076675,-2.221265193101131,0.4912576499341499,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.239942383240145,-1.5480563981269437,1.8577874744757454,0.7272933808052509,-0.9344450764118416,-2.3269279460451013,-0.7435854860482998,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4542570156828636,-0.27176912816457977,-0.3618604064197557,-1.502224358768631,0.9678737333818738,-1.5496348751441344,1.2748010290281975,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.1468076270806558,1.2322052468347184,-1.7602650358096363,0.7212280541208039,0.024643216826090497,-0.1814752483470614,0.561492706792226,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.5077003347535025,1.088513118264028,1.7551210104319521,-0.736441038595527,-1.3056362875092131,-1.3166156974158438,0.2511173359195177,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.288389962747996,0.36332653636764256,1.6656089747619136,-0.571105661353323,-1.1612868506911342,-0.5432082064452731,0.11792111797788773,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.9995296056005114,1.3529339664784819,-2.3981864910916855,2.9849134331502665,-0.7407438786500962,-0.7264517691858112,-0.3538463287395124,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.08579858389687023,1.7161890418770884,-0.06656951353461293,-4.105281638118306,1.5285630478172285,0.8775192894752291,2.1152291309916,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.9661724849567914,-0.40445855460769375,-0.8984041426116092,-0.036985924898836356,-0.8750620577241204,-1.5780799558007883,2.1207161932972505,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.8699336332979304,0.6851162561092408,-0.9012433467548683,-1.8635864465365037,1.9301898676639888,-0.0891783038473156,0.689996751808305,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-3.390371025284407,4.3362614916709905,1.1553623702701241,-0.5402753273558951,-0.7164467112290367,5.759960343500196,-2.098251841172708,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.3121549519106877,-0.49079106810872064,1.0874868101059274,1.8775100736563255,-1.832698844916588,-2.771227001345358,-0.5639729980991646,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.5317909834339799,-0.31402050735813103,1.5222379228128546,1.1028560181554226,-2.2574716049926096,-1.2763341078397625,-0.0682234152133977,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.3489372887473756,-1.902965890195,-1.1058115737668315,6.444396538850495,-1.3013307250524164,-2.59335014865392,-3.2826286389085126,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.10352282484992748,1.7763521706893264,-0.98957323888984,-3.092145229794725,2.3159326671997436,1.2326770331559804,1.1091309782040397,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.6781201591090096,-1.2017056619726723,3.1386436103718722,-1.4826197651366986,0.7413994646513105,-0.061222556588136814,-1.8011807696190751,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.3088071867454587,-0.9058060170486686,-1.533795865471077,4.443254383671029,-2.2143075168348214,-1.767491483116837,-0.3779098725243084,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.42758387794542607,1.3840546035724883,-0.10889830402413547,-3.1754775666120802,1.2232929860961135,0.25803202005775294,1.7027079999027905,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.1914622420587,1.6808636178618053,0.5565573242166482,-1.954492290078305,-0.9510650933441838,0.14161140375081846,1.868522343287696,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.327521800555288,1.707072587638922,-0.3408892551572401,-0.7841366540150495,-0.30706125962166064,-1.403400095559777,1.139293148033613,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-1.6870712174917015,1.691651631532742,-2.288473035077086,4.52043452758501,-1.8935449916089768,2.9237857364797977,-1.609566360393679,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-1.733708401198054,1.3041639797022042,1.400544122440466,-1.9741481668869392,0.4617729940086308,2.3114245726840337,-0.5274602470044196,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.7575715367081157,0.3753135909060661,-1.2693308636208644,0.5371878918731451,0.5384575757585188,-1.153326220541941,0.20366235231148166,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4883842771922242,1.7515504950397989,1.038220064787369,-1.3034051909539248,-1.3740421429605687,-1.0453541069418544,1.3316370102880164,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.816707826258376,0.9334850907564992,-2.7235167200741737,2.561614634752468,0.5749390983559122,-0.42892177674740073,-0.8151907044116287,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.922399180978037,-0.47398744746047616,-1.086455344591692,0.5421631590354696,-0.17489100087797138,-2.141675253309839,1.1382797565150389,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.4370945240496815,0.7406706373308528,2.3817851052918986,-1.5970867983837052,-0.5383146950358882,0.43966344292078025,-0.39121212011259565,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.5227791882404937,0.032628064555142666,-2.7346852692959223,3.6243268586724393,-0.4338687119554254,-0.8963076772737661,-0.5620760681630759,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.6925555904243851,2.2660402104433004,0.571879255854077,-5.136520159556465,0.23388977994347782,-0.21095746484974373,3.839104184046647,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.6170807446057736,1.1618050798356736,-0.3318054593493467,6.307458106404423,-4.152242368795466,1.164412152487124,-2.6433851880918566,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.09933841297654922,-1.3009113230097453,2.3763024813118814,4.843663490637228,-2.7335802864430874,-0.8152959702787319,-4.019613642468096,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.29723257606972664,1.534048303390355,-0.9278630836202846,4.548220911132926,-2.2312916467625055,1.4265140750671224,-2.3032786031118535,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.8723473627536515,0.9717287860436329,2.3847715433643724,0.7344463319711535,-1.8629044282929315,1.9783943683566731,-1.8140411081153947,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.3005647919287311,0.3806355736171525,-0.27869848922330487,-0.8799959881301632,0.3995051923334578,-0.09156717805815423,0.6758278798998893,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.5955050165131914,1.450567042185088,-0.9897943065169226,2.737681953113439,-0.7663788673735875,1.811148094805718,-1.854983423784701,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(2.9669296357978334,-1.3324159367684048,-3.104836225416732,5.208190995197741,-0.8202049866634673,-2.9861699841871703,-0.7016133155919906,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.228016828510732,1.1216551175944176,-0.8558209427875334,4.258437071067928,-2.7976936142573496,1.759131670682027,-1.4539872453038518,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.2339963699690584,-0.2804755708218589,1.4715087228456836,-2.9261144609808616,0.355595728180802,-1.8268629783014674,1.6411674193628243,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.9659087122503214,-0.2548687699578174,2.104950827672197,-6.076161419668977,2.9878426404779534,-1.2192738796045464,1.5970699410759703,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.22061418917082676,1.7175054727901158,-0.5033501522353456,-3.8353548758394256,2.331439472843757,0.9401634108615404,1.4604187484921587,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.309907365358922,-0.12990852843173584,1.0737239270579344,0.7337127225434502,-1.246715098799017,-1.6078875928365746,-0.25052374133607436,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.36721164916342697,-1.7079119599701718,3.0068461711549523,0.14826986026046768,-0.8186880144087275,-0.9349454628893296,-1.5313812357768914,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.6398796287916704,-0.2454439388782933,-0.3454790010819664,2.792239227481451,0.15344573827886987,-1.0493634503221692,-2.4336157756640855,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7847363960073463,0.7363916664271204,-1.0119432855225785,-1.9544812667283535,1.277543003992446,-0.2529346594821023,1.5342034566540081,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.2232936134800012,-1.163429305152226,1.8203348565681234,-1.2313360448785429,1.1074565407265085,-1.7093423514569264,-0.9078154994566392,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7585110515783027,1.565377477710182,2.027749458360845,-5.369019478696252,-0.3380358319830341,-0.9500514254177758,3.588791253857626,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7362390304804842,-1.2017843711210685,0.8926545968864157,1.2399265238688837,-0.050827310016290705,-1.198605392602416,-1.5046056364379843,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.6451221517395296,-2.0484424552178737,0.6171428263446541,6.422100778753815,-2.577636468051222,-1.4890401115179508,-3.785907231054817,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.765086441069906,0.3886895405231462,2.731661900411207,-1.3069068417000809,-0.19766973479399452,1.6879242979289697,-1.449585901495793,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.18985291006333638,-1.0740273879437814,1.2843531782256652,2.9867201516109323,-2.853724333474166,-1.267483825267256,-0.9631441174041762,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.9871628788591412,1.8534178483912092,-1.2805384917990295,-1.092147064487189,1.0822665318842248,0.4024378429492361,0.6510218029229897,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.3717600489367091,0.7167856864650772,-0.7499821639105004,-2.1169534465406232,-0.870825637391141,-0.7319917041438911,3.6275089929559368,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.34781014325513526,-0.42631045215441477,2.276403265265107,-1.7872802807090558,0.6460091472975253,-0.6707279710261537,-0.7145197261034959,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.6978341324237667,0.44583514954616277,2.5487409237553997,-3.883754805256149,-0.5331862190361614,-1.3497349443383184,2.16910621644326,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.42196177110466704,2.16561337972615,1.3262059312894516,-5.6286300261936,-0.08711234527451972,0.5828901807272211,3.841164934415239,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.16389008844843,1.2429168032114994,1.1288227844364782,-0.8914746299219967,-0.12326393212364906,1.7336169885979524,-0.6957687675851021,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.97426704102067,-0.06480324801411252,1.2488895732194991,1.6784228029603945,-2.2987446544566623,0.42970828101052566,-0.7140097535913854,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706) +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LogisticRegressionState(400, 2, 2.0)(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; +with (select state from test.model) as model select evalMLMethod(model, predict1, predict2, predict3, predict4, predict5, predict6, predict7) from test.defaults; From e708983e9bed0efe260fe0ace365e1e9fbe64d73 Mon Sep 17 00:00:00 2001 From: Masha Date: Fri, 15 Feb 2019 23:38:13 +0000 Subject: [PATCH 018/194] Changed Linear Regression and test --- .../AggregateFunctionMLMethod.h | 6 +- .../0_stateless/00953_ml_test.reference | 1160 ++++++++--------- .../00953_ml_test.rock_auc_reference | 2 +- .../queries/0_stateless/00953_ml_test.sql | 2 +- 4 files changed, 585 insertions(+), 585 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 286e19eee50..4394d508846 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -150,12 +150,12 @@ public: derivative += weights[i] * static_cast &>(*columns[i]).getData()[row_num];; } derivative *= target; - derivative = learning_rate * exp(derivative); + derivative = exp(derivative); - batch_gradient[weights.size()] += target / (derivative + 1);; + batch_gradient[weights.size()] += learning_rate * target / (derivative + 1);; for (size_t i = 0; i < weights.size(); ++i) { - batch_gradient[i] += target / (derivative + 1) * static_cast &>(*columns[i]).getData()[row_num]; + batch_gradient[i] += learning_rate * target / (derivative + 1) * static_cast &>(*columns[i]).getData()[row_num]; } } Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const override diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.reference b/dbms/tests/queries/0_stateless/00953_ml_test.reference index e50cbdd6732..993fa484869 100644 --- a/dbms/tests/queries/0_stateless/00953_ml_test.reference +++ b/dbms/tests/queries/0_stateless/00953_ml_test.reference @@ -1,580 +1,580 @@ -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.645206721297782 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.6694443959224505 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.4493293816391796 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.600720195229028 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.6762784661885577 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.559635760952823 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6353300559297663 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.6635807616996307 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.4615908676549731 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.6148954951112843 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.724525500316245 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.6814712987389229 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.39027824250652915 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.5406362537321668 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.6581480265671044 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.604770630344337 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.6124292530568871 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5652923919041697 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.5347192073584655 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 -0.6777439840889651 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6411012851604063 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.6882314202562039 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.4364572659523192 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6093243100848463 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.6997646999628921 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.5422581250564131 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6508734063103988 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.6985513111559237 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.45244725477787 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.6261675112820656 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7461838992404664 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.7018563514656831 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.36013871027066185 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.5238855727602139 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6804249705341022 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6050764770369429 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.6440334745784803 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5716205957425191 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.5311888217657855 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 +0.6986271931040996 diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference b/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference index a760c5b44b6..edd49736ac8 100644 --- a/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference +++ b/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference @@ -1 +1 @@ -0.7692307692307693 +0.6703296703296704 diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.sql b/dbms/tests/queries/0_stateless/00953_ml_test.sql index d807bd0a043..8da2a81fb5c 100644 --- a/dbms/tests/queries/0_stateless/00953_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00953_ml_test.sql @@ -21,5 +21,5 @@ CREATE TABLE IF NOT EXISTS test.defaults ) ENGINE = Memory; insert into test.defaults values (2.096042154435875,-1.430135166863733,0.552002055283785,5.530269265662427,-2.724119998880863,-2.727060497877947,-2.6521663150493935,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.156034808051058,-0.4519877395933891,0.34558837162895817,2.2798791370166707,-1.2600139205601857,-2.314726182739184,-0.9176776519268379,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.0227012823747095,0.7073993763424218,-2.526579837235766,2.8884210818462503,-0.04921172682949959,-0.9351603686160936,-0.5773308731642317,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.461704796035435,1.2400054513675245,1.3110456913590716,-1.22465515713176,-0.7935030458046264,-1.103533329941002,0.5919719712269023,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.3957050452186377,-1.9316918657725441,0.9190142057288935,7.155955775162267,-2.8869703029890026,-3.0234929608286194,-4.304748904849194,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.392556430407127,-1.7794168780763924,2.1181012869348086,-0.6814309766916051,2.00404915245683,-1.7928635680687615,-2.425109137822439,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.9685507597915972,0.8408759652866196,-1.2607782469598254,-1.5515619975922614,2.3915793036512913,-0.8003752729444923,0.3318055683772181,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.365215205131582,1.6421911754887804,-0.470904627839269,-2.195888125979813,0.9714278325597505,0.5976321868124256,1.1540464822511913,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.3351152167766934,0.9498577915117139,-0.879126536282473,-2.971335010973352,2.468544204807239,0.5553774318661323,1.093198284507689,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.03912510876000452,-1.3322341365102917,1.6434865408453003,2.7281117051531183,-2.719490284062717,-1.2856678156526198,-1.087994719221058,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.8110134301050786,0.10305735724313725,-0.019183566058287527,1.478933303100145,-0.8948542269544303,-0.7185915708657821,-0.5378349211144934,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.013571717295999042,-2.1401875522838942,1.5751388914372026,2.869365994906071,-2.263892397950471,-1.5905392928904198,-1.317250564711623,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-1.3815235147212976,-0.9616053368120304,2.8150588272277965,0.14759793530998425,-1.620992799677878,0.20786388505596268,-0.9816032789320823,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.11407654661743705,0.768404354463356,-0.3930175233254567,2.3015784648119375,-1.7211987426998967,0.45519975382978,-0.6156907430410832,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.8478239086918133,1.5409911767774376,1.6994582902088935,-0.941221552716078,-0.5161849474607861,-1.0836831033224825,-0.4295520072868204,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.05455524769902653,-0.44441732196125217,2.708301849219744,-4.119367835878758,1.145934474605499,-0.7195943706636994,0.790664128197853,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.1969604043817803,-0.32118839886233386,0.23529133982375638,2.0406253994414003,-0.9957550724767615,-2.2235912952793635,-0.8800043260355785,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.8220150519058342,-0.09416361439372012,-3.047770316012948,5.034883266354364,-2.0143105832194625,-1.5733009655638288,-0.0222530409439472,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.0161176246725091,2.6217682547175736,0.9626736958220774,-7.396443060155276,3.4854283180461727,1.4376798844052319,2.2403875697818205,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.5082554497694574,1.8467142393208946,1.6327843990728441,-3.2881109608057573,-0.4321005482505421,-1.0603588475156511,1.8575619836721444,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.42260650162006874,0.41155861800999316,0.7982889881884394,-0.7237985064171936,-0.8285415729659753,-0.5825003405465955,0.7630457046521066,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.4984953879098306,-1.1006932402217684,-0.4488170035755814,5.409789404959963,-2.734678167398622,-2.9680022720016557,-1.6313962465437406,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.9436912987053148,-1.9262688389287774,1.314850116820961,6.396062133529162,-2.842471758246596,-1.7716503301033386,-4.152218598373375,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.16349909844947885,-2.1701452208414933,2.568526586668546,3.397671556920363,-0.8976577440476563,-0.7471631706579982,-4.256758308439956,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.43511790495037683,0.5111546228572755,1.5168239103908907,1.604718301244254,-2.095124808747114,-0.4602828633136912,-1.1177938053615741,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.5413156314344527,0.09335263935887883,0.5612958143676673,-3.7986008152463135,1.8342221950246018,-0.5809729319600001,1.6392301667689284,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-1.4504814727811615,1.3493103008673883,-0.04616646907891209,1.3117933064479026,-0.7702114172619944,2.2759289480635956,-1.3306427086061552,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.5130854076349335,0.6888754268554591,-0.24046616537106735,1.5838074220098308,-1.6445748079667983,0.6567869990109363,-0.10911343377083105,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.24277413251186197,0.8473320183553533,0.13183067757383438,-1.285681114811781,0.8555624158828621,0.8394005656843551,-0.03496602415650052,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.8369385120882685,-1.341251823971342,0.9554668074045201,1.4270151216516322,1.3962946241553666,-0.7795883140931273,-3.1902671851058684,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.1583479751809334,0.517409603059198,-0.6999515579272186,2.051960782143681,-1.715430664432116,-0.9939038452652763,0.23845436310251533,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.8595203894117056,1.586295759104766,3.24464432451852,1.7792981720712642,-3.5599729812558625,1.0339349200010899,-2.0761447233122485,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.2187879306043835,0.785516320747686,-0.2648586496544352,-2.8228486010789404,1.128464932373549,0.09723332542813223,1.7886949807027714,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.5027908312527922,1.299795068598311,-2.247265548686248,0.3568369726515874,0.3094133364610945,0.4849256444073516,0.9882861752504595,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-2.323680245156419,1.74815453644885,1.3056727348077939,0.19720821301977268,-1.3307294071180997,2.961691552540972,-1.1567709696086979,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-3.4660709804341914,3.0020058328582584,1.5532651665598032,1.5583662913164948,-1.817494404470051,5.014323195426371,-3.0261871799657434,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.07263506966702105,-0.9786215483869296,1.9521065048378694,-0.5412416965904013,-0.7526123488568063,-0.9097656582671574,-0.11616596119861677,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-1.1101210747955936,0.45690435659743034,1.0024061194024203,3.151090618784407,-3.1293373639055435,0.9063184859725469,-1.4156004860432896,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(3.126163478788228,-1.3873077921754309,-1.6696389941434133,2.6802469210649256,-0.681228435146825,-3.632607072537458,0.5151315701276392,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.35121315158298516,3.269898801839016,-0.3139240954702248,-3.3982176643392235,1.5943902174769407,1.665406096965063,0.9632634643458649,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.7468935350733565,2.1854201988656303,-1.5921771449650985,-1.9866930130946439,2.2487176483490816,1.088338402207399,0.5136328198882177,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.8336689441755065,1.9918308776801352,2.2772332104920645,-4.087683288038629,-1.0325983001724792,0.8849166354769218,2.286910253692919,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.977801713559557,2.047290687529743,-1.892163531069095,0.023277725464046682,1.5086179535693676,-0.02241979904892156,-0.3153319898124409,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.0518424311627248,1.8501419588702324,0.8505610339256306,-6.405529783623052,2.0897521277071087,0.570135066692417,3.065661906503785,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-3.467126967504096,3.5784474447980568,-1.593527155162049,6.595207715742785,-3.872578649012629,5.606447409075812,-3.4752544483201677,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.49490773800501286,1.595739466407145,0.28740296306486357,-3.824557248992501,-0.005517967878073571,0.6713599863888331,3.0557952294935538,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.544193867668699,2.3262231384923844,2.750917624599606,-3.510182442015632,-1.2164244818530026,-0.12870618351275448,1.4921405703258661,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.51316443936564,-1.2270576118491379,-0.1511873771860477,5.077623200702221,-2.47128253159166,-2.071110370778194,-1.938581109844371,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.6113192323231587,1.6659128724858379,-0.26101192082957914,-4.320443128005412,1.661337251012963,0.17282617602319883,2.521205470842835,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.8198275616708954,1.3675138581932453,2.4905089781034886,-4.065703441137424,-0.7766613572278701,-1.9487231810266057,2.467596447852433,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-1.9560716071750701,1.8563089934671257,-1.089371283526789,0.45302651466747346,0.5754832357256494,3.377112037476161,-1.1078516930515567,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.5014679676763512,1.46456490318075,3.74940663345368,-0.5180207050201467,-0.9701148885455172,-0.7947236401223874,-2.385191842660675,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.316853101423458,1.2491089344703392,2.3725759643289566,-2.9342129359065137,-0.4183076327718859,-1.155701368032073,0.9779293936805153,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.1849117352329739,1.3925299588445736,1.5695966090587818,-2.1311823024234813,-0.9067969456142655,-0.9769402104776256,1.3185069398877736,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(2.373297959341027,2.775778233617674,-3.987898143897202,4.1703153450619785,0.47977169869012415,0.5341339903160455,-1.8868105390404768,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(2.3482349418405724,-3.1159637626200545,1.322069359815815,2.229373710192031,0.1833587373393235,-3.6718200269675574,-2.167407144040195,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.8243075201573921,1.3348585688363546,-2.0351861522550223,0.44274131356886665,0.7582729504076067,0.4043388560881777,0.26562738440084566,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.9481666208581829,0.22905400262922648,-1.2625401200379784,0.01891167448317009,-0.23629041979461762,-0.8959552087654045,1.483311569076668,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.06585868557878616,1.4576378617673251,0.7399321196221702,-5.557327993134892,2.0615711774643364,0.59937804443105,2.443312546568034,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.5617223747915407,-0.536515447514492,-0.9957168928986968,4.77783798052823,-3.0250516363531137,0.04763704320310812,-0.8503674789558922,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-3.34324723959496,4.3926424059948035,-0.0495291336313155,2.6333253919636106,-1.8973423593226126,5.962186949574377,-3.1074374428513205,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.49887278027307114,2.4772176483573447,0.8766144403424073,-4.412341348998718,-0.06544816902397033,0.17540887369438027,2.973618255958296,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.7781653022461528,1.6160279900558963,2.9043194289987406,-1.6138303698874787,-0.3568046596220451,1.4348863906315135,-1.472812006839362,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.0193028644873694,1.6299059681175168,0.7720871381731178,-6.526365022144807,3.602358868389331,0.05735615709042067,1.942603137953855,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.126058179631438,-0.08021399823747422,0.1845945629753224,0.17818816509562224,-0.738333890554967,-1.3667460232410276,0.6101098938191294,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.696410860620625,-0.6276802386587743,2.4836900187897752,-2.0850016187629534,0.24626466623836807,-1.3510098287109322,-0.044478444238072345,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-2.2180272120355253,2.4305553228334267,-1.5801744943687832,4.862275527923406,-2.2752200612907183,3.8805912201348205,-2.6384927064003305,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.7567743245952139,-0.34730069944053166,-0.8948025108160138,3.0380121675012406,-1.1828054695478198,-1.7157828402064659,-0.7250035618486275,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.8454701528107351,-1.4667747625694347,1.3994753234952881,0.14108982726971897,-1.4662061418653511,-2.2561833089066807,0.7712682192410636,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9311255806838445,0.30138652549697587,0.38513967479058675,1.3739433638375038,-1.148015783327944,-0.8064976661502308,-0.6120628161659272,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(3.364212163278218,-0.5777774492998544,-2.0960237073085235,2.7292130504797565,0.3929841930243696,-2.9133895273811254,-0.5391544963326877,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.0464711573814256,0.6301410336103881,0.6168596799831255,-1.032929924340855,-1.2787522510385279,-1.28640822590547,1.7388375253169488,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.422247332703442,1.3099920188712886,2.4073061721409297,2.1870630187898,-2.906653106438294,1.6982591159934275,-2.362573454685344,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(3.1695741682612937,-0.18516594373997697,-0.7713888778777602,3.1151308383183576,-3.0028825960507337,-3.641700075824226,1.1176723514330833,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.0201468439854502,2.0949741514552933,0.6385052523919061,1.8831849732743258,-2.2046121941585293,1.961396504470046,-1.341031552473416,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9381164870495406,0.7569235185409051,-0.04079716532568112,-1.0646216144008618,-2.1229314622801283,-1.4627720410887246,3.205645865534935,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9437251365046566,0.2476269059695898,0.04785469653893282,-3.162644357415593,1.5437021067561914,-0.853674727031123,1.7551166151989124,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7011087711254909,1.2035331930765993,-1.4398091375364501,-0.22767686518825167,0.8665559020317706,0.35056665369985957,0.3315069768001421,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7691595700548932,0.23226979363339084,-0.7524159985119943,-2.273159847018095,1.2051808874023429,-0.6613989835734112,1.904431917138825,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.9901267648253292,0.8314035869824183,0.9623028761759912,3.0463733919904152,-2.623962359372865,1.2107802811322752,-1.9252298613127752,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.5670331443146553,1.8504800423581038,-0.644940607788113,-2.7678230888952498,1.5881287762026992,0.6450884188501608,1.2333970014028715,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7215290147887311,-0.8847639920373926,0.4904341287870997,1.0732294179644357,-0.08407257982238703,-1.0427528377077504,-1.0423316359603254,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-3.0571866679643755,3.3801167219727093,0.7666061453475292,-1.4047601244502173,1.2542122493912302,5.360634400210411,-2.408846721295774,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.14458899707407,0.806558148488993,0.9258314968497899,1.6039908714694096,-1.8099931519413055,1.3287669410436236,-1.2183570331221776,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.0029511283094880714,0.7392527584182871,2.271615106839793,-0.4594423088240106,-1.302932906147438,-0.024854290186172693,-0.6305929459060517,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.0262556462492007,3.106727638660441,1.552666143363748,-3.579169866499337,-1.4623529808205205,1.7247030376250396,2.395785937012022,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9439810230045693,-0.03450351562051179,-1.8489916117037675,1.627016506901843,-0.2551150847440704,-0.7340241866844871,0.46366450521689084,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.8995507828338771,2.637194803741764,0.5281828736349332,-5.263580235229065,0.7097535677602926,1.7093409623873352,3.1199605290151666,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.2331543227352126,0.576960304218676,-0.676727171313593,1.0171538582152717,-2.82527488357647,-2.6461049785824264,2.6088913588467775,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.884286499274555,1.7159327959050787,3.786765950812899,-6.121056390326268,2.333369727673255,2.6168319013890295,-0.5366786842960347,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.1382122858746933,-0.14299633489223185,0.8327531435987057,1.298580815498469,-0.8627965605758569,0.988030584240615,-1.3967521076705827,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.6303393796237344,4.358235812284331,2.280888586413079,-8.838648817770522,2.239906490938857,2.4513045936352977,2.990325780977093,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.4442835629793667,-1.5595422106625365,-0.14785351526730506,2.4592541040486275,-0.0735148069297793,-2.8435659780281113,-1.3676274520194718,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.4143700456566066,0.8204418264435885,0.967997405875176,0.42646086353492046,-1.564532879987763,-1.275739590687965,0.1318313864473809,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.993790451964731,1.3774074310286606,3.280200674941446,-1.341646747143973,-0.7045036833894341,-1.426903501445604,-1.2265179636048882,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.25515995427833005,-0.4671088714062114,2.2153588526087598,2.313329282416284,-3.5569628024009674,-0.8261756134416534,-0.7263653091644615,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.6355961932522634,-1.0282770582100191,-3.2173580488490123,4.559935052970455,-1.1214958228117986,-1.7827022934914223,0.07193385989494827,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.3283277042612722,3.4105121001777348,3.2195651165101515,-5.324711721749864,-0.9682526335929017,0.5004787785615196,2.2337122442476227,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.754679079237366,1.2099552379791747,-0.4385913525503159,-3.1077997316498673,1.9318023043436465,0.10670563866580032,1.3334679355779948,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.0317090865947613,0.8572264240668982,2.4095086017705816,-4.663118509638804,0.16709538369449373,-2.261736697516116,2.4428573077545996,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.1693473062725674,0.28205162253200255,-1.9303762140352645,0.9887844009255294,0.9897729061853578,-1.3590499520050627,-0.010177228789967074,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.0801920463321826,-0.4298481415473505,-0.33436737741767897,0.8097326513818011,-1.310248231723286,-1.6559624358526785,1.164300884735815,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.04021181298242671,0.22389963328779605,1.9968767300385086,-0.019382197954940554,-1.4497486951865157,-0.29417522140873087,-0.47838412801942587,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.1239921256001624,-0.8638540030084805,-1.0178241055718993,-2.2937149162466777,2.565762757868864,-1.2141062999841048,1.274422252538015,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.7413970807889825,1.5875817859558181,0.8403835779082484,-0.06969468265303144,-2.0112826998053173,0.9991342650707755,0.5897487899339218,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.21012246579494498,0.7349291140125731,1.1564215797263593,3.067109745050948,-3.8072019508231905,-0.4458351151041659,-0.6775773369205058,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.2786193776514114,0.8391330674680333,-0.4026891923466751,-1.3731305159290677,-0.8305074905865648,0.169874931175302,2.3132805058219574,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.2328709703392624,2.7597725867233383,0.5684016239686696,-2.9566618506267175,-1.5157478752904878,1.7699608909022329,2.8392511093116637,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.6871398306249665,-1.4103987067510992,1.0274161223406697,-0.5072792317407046,0.16697719764934948,-1.5964973105562557,0.07247594534487489,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.988330670186111,-0.5258004908649867,0.857816493019688,2.905878095316476,-0.3238823556705246,-0.7203927872533037,-3.1935613280291166,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.4322721114721757,0.30561297616901784,-1.5190220731160726,1.3743262473426763,-0.37180525132367603,-2.018098080706224,0.6319351503875634,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.4632563423687737,0.5381126931941951,0.9013515836533991,-0.4868930388692965,-0.8036249563776104,-1.424272458154115,0.4989428610329456,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.9759142028783296,0.0963990665555634,1.080300923613975,-3.059378549550568,1.7637552314639664,-0.8307617709909302,0.5002521536297346,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.8451444217468322,2.675124983592143,1.8034394339920048,-6.24356070906137,-0.1404077934628427,-0.4290049368154296,4.083301092855288,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.7832957038087498,0.46583490546204087,-2.8377296298346213,1.7314321239250723,1.4637196588786066,-0.5551666584209051,-0.560342527910989,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.0305985048097615,-0.8136835491751737,-1.5375629006726204,0.23344540733313246,-0.38312070583511015,-2.6407899536879547,2.2682169302221693,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-4.450198579702571,3.8044895601982978,1.340371422770127,3.236568823054465,-2.7997133244581374,6.476201660322862,-4.069014914211333,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.4825506606818901,1.8932394950918274,-1.6402434007292597,-0.6438070488741744,1.5377697938617518,0.2190653369274579,0.10746474982298349,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.12865647469516983,-0.03277446362082159,0.3789672161429233,0.13234961251820676,0.10865846661989931,0.1899002744334014,-0.6210816810053859,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.7483525163782037,1.911632146474509,1.0237857931937804,-5.939983118898138,0.18095426014013039,0.7464913363725915,4.2349290686151395,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.4639789336512659,-1.487762211307613,1.2333792712082898,-0.5819847984553231,1.367105196681563,-1.9311626412059815,-1.1352946822318226,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-2.716437954263598,3.2172228184755456,2.486899575348391,-0.27826500422738343,-1.496858928573759,4.189036022930514,-2.271237075436395,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(2.0984679507408304,-0.39222671785000096,-0.00929742777138598,2.4355790415042984,-1.2773465142555198,-2.2069415614400536,-0.7601011284502681,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-2.3851061122725956,1.2652524519794195,1.2056559497342312,0.2301402557556724,-0.13853039522345567,3.166739303466531,-2.143757701306856,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.912501321700246,1.0668955351482894,0.031154669474161678,-0.2922639794504092,0.1586320914087691,1.5749108653175503,-0.4654455435433783,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.6897500753524755,-1.5877093887419145,-1.7611534048954183,2.033285149958932,-0.45562387935528914,-2.4572133028294783,0.9117001207364435,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.03279016425268144,-0.553487415980487,1.5178285275445653,-1.756383753660862,-1.6424327750282592,-1.3694706413196136,2.3514036487381236,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.58004120787043,-0.1972292963993476,-0.13424999439900343,0.0644658482737472,-0.5669375045425562,-0.8960436704764648,0.8194123344316495,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.3142690816498883,1.9522135610917537,1.3104586637571347,-3.120340694946515,-0.7990786213674381,0.031103936415356134,2.1367311835504337,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.2711769727288555,1.0981021590638618,-1.7957098361193409,0.11763102112672769,0.8889146120013874,-0.1919397644256007,0.4140737388483293,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.2753034616688934,0.5396168159983519,-0.25856295996037804,-0.8784121825809064,0.6222845940416049,0.6514517789151233,0.268334498274877,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.054143446852892296,-1.6609882776935554,1.6234667989235132,3.3387697001507917,-0.9389121245324956,-0.5846606129339186,-3.4424309279299794,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.26621832805226675,-0.18078638381031364,2.933879140489032,-0.46282747535339114,-1.7199780636897413,-1.01998740911614,-0.406866592293917,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.04897174356182843,-0.3676084862290635,0.9387028981245669,0.8918277660343057,-0.7366479777100163,-0.33317336104618817,-0.9185779389595495,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.21696194123607038,0.21555874139491749,-0.005133162761840726,4.209335205163436,-2.985056254482762,0.1462920409430946,-1.4879483835912106,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.1919697926532478,-0.06899302259156948,1.011479220945279,-2.6782330940108325,1.4957262168280048,-1.167204400077594,0.5412644793623882,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.797384096830145,-2.8858544823493006,1.4613598752639518,4.082334904310998,-0.48025789276661146,-1.8693084187642843,-3.9155728821524383,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.8513327899828025,0.7458930410858058,-0.7732225705417501,-1.4870005874864665,0.6145060572057287,-0.45127579686900166,1.5047009176226747,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.2510116832256535,0.2754714151780169,-2.265757658761317,1.229877962757745,0.7099703142373317,-0.5550915813556282,0.20254867074113803,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.02808083853107,-0.040629553520089345,0.8900206816703727,-1.3480875179776237,1.3442347323117394,-0.7538223926536042,-0.6342339871101205,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(2.695776681946838,-0.8864088092399576,-0.0789578748776445,2.0458434092506015,-0.970225560557315,-3.0770089140411643,-0.3020299079680173,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.1631434432249037,0.2854532336635398,-2.390500707033707,1.7344940763151517,0.6923406830495642,-0.36218796498051203,-0.21341989806423345,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-1.6503048195027281,0.5243299697796613,0.2251840345614935,3.781488078646145,-2.8118176812215054,1.6996229508611647,-1.7849702798837712,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.7841357579086083,1.4436543212940578,-4.6726465448085035,6.434459937635292,-0.5846417872195009,0.2849453543668835,-2.0775372719522043,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.0822211355799545,0.9994266546847871,1.0465138567217758,2.0558098640968043,-2.639498177967953,-0.8840583888113261,-0.6825001012379466,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.848338734345929,-1.4745072026687287,0.37318698837288045,6.0929889409953235,-2.860229206267653,-1.4979288865033067,-3.1150236297626157,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.2995339588833392,1.2407288550263273,2.640609187687466,-5.723460643589443,2.7512517947788786,1.946472506752308,-0.012081582228990029,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.9946726154312155,1.5401885333052683,3.32058260159335,-2.7680757902230586,-1.5330279328773837,-1.0093823869079046,0.8835422971914466,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.1653969392564758,1.8477252075676,1.5154492658344962,-1.5050500138182235,-0.4399475400838969,1.8901940665945647,-0.3337717224590103,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.3410474945205646,0.9406941157522144,-0.31346932922698456,-0.5250458393014832,-0.5348245647633945,-1.952646624466109,1.3913067179555951,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.4376595283129783,0.12884481167739992,-0.7153536782631447,2.2980804863380264,-4.310130247410337,-3.425970247693062,3.0425484210457308,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.4242822094686205,-0.6739175649059916,-1.6207631956139514,0.9215275442056382,-0.2255601728743668,-1.7552758751749484,1.3017469600205345,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.5634426551277789,-1.5471077082024784,2.4165088824982957,-0.07551896335863666,0.7259879191915617,-1.19324872205996,-2.252728223170336,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.4438980206249631,3.2154267346236893,4.344033519574632,-7.789482359991429,0.27392642950548796,0.2323729828915657,2.58660101167189,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.8266978944375327,2.764653149219914,0.44269893736952115,-1.448029334618218,-0.14573666828341858,3.209923834413559,-0.1568551995293309,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.49796742294949103,0.38611648047359515,0.947852631250811,1.921055938334201,-1.6442237026351973,-0.3807946252730803,-1.3171989797300596,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.2825028600006064,2.4079617426078688,1.3943677343584104,-5.068702752063692,0.3262485206507727,0.361686441352446,2.7646386524149182,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.22492901625026118,2.487212601897629,0.26524983577107275,-3.2366605539208284,-0.6423312073077014,0.4599935245385812,2.860371878492055,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.04824496005648782,-0.41434421911898167,3.2271022590248886,-1.7830389885935827,-1.0845055278057123,-0.9148118678714859,0.10175737670186669,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.2494445038361341,-1.2605077919460772,-0.5919596470609547,2.65848661076861,-1.137208814184975,-1.89192004138945,-0.36297989181266965,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.9368152698009182,1.4026143232862036,2.654968484232417,-0.48052468015489747,-1.4353801796778478,-1.471326764204455,-0.8054078742203845,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.1144180116920606,1.9104663145213592,2.66246604484307,-5.074755087317627,-0.19811341338412658,-0.9123477120908239,2.440556004826056,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.39453752442584944,-0.07366743472831994,1.9655786401195567,0.030511897442377315,-1.4873612106122647,-0.15769770005697964,-0.39586406801516416,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.13705225566650903,-1.066340745793812,2.247663742284547,-2.2163700069902466,1.650571100968139,-0.34030614914782426,-1.086715918625918,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.257058965850754,-0.4841613444620174,0.11928070954945669,5.903325224092789,-3.2500639441872186,-1.4374965938334754,-2.6101536572472206,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.3338018044957725,-0.25783497499040453,-1.912097518989901,1.7897855693470501,0.6967346574866409,-1.8049321045768083,-0.3259566366550859,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.1597881133675316,0.18269125188689506,0.8486870733972146,0.9187771036928764,-1.3457464656817628,-1.263601970316707,-0.28154047796298953,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.3007389767680182,0.46484767063945054,-0.4886824605041771,-2.4201895447056203,1.3963201084273231,-0.007673513374869891,1.4417809458190534,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.24963563676970935,2.146378372977968,0.7902446346235774,-5.6573637067026645,1.9861496459522696,0.7047213943168629,2.3463141909563427,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.5836918839436678,1.3008666070056107,0.598629993661711,-0.10362396303302328,-1.5961048239125133,-0.3129853796094125,0.7514037918744904,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.5229752172383009,0.24565782730994223,0.6095967557050924,0.688197893976115,-1.2881263450703708,0.3444699274985082,-0.15860735569730788,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.713159371718102,0.590874479989717,1.8556281124000433,-1.0879792739972094,-0.885690863908573,-0.8000805235607321,0.1725076813209897,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.8728203729298416,-0.8175386138217031,0.21256366729230014,1.4640205139258353,-1.175325702074738,-3.3996480522044146,0.24937101097686643,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.26386100804843426,-0.681937012093828,0.8719546263837685,0.6595807560020865,-1.0334232838287962,-0.9176670256552146,-0.13807803400017815,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.551767614016228,0.7109567026227261,-2.4802658442092,4.901977885732814,-3.066882464644468,-0.2414288804598717,0.13906877696470232,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.9756434098282215,1.5177936333128244,1.0475803709656935,1.4474573922263465,-1.7751753583320031,1.6220531518629306,-1.4700570193599187,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.47763046455062,0.7743296610978223,-2.5287652392342297,0.7391934469677471,2.226326518880974,0.02544798983127873,-0.7676730030660792,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.610702152006014,0.42910678217008225,3.0903157899137983,-5.390224952610268,1.3934337695947003,0.31851454704530224,1.054856662581439,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(3.0958554477794293,-1.4621148020869976,-0.5551243999064688,4.452619430630248,-1.379337013287443,-3.473330945653575,-1.677775172150648,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(3.362080810136683,-1.1400452123643188,0.6638526272830326,4.3778813924145785,-2.415943199028577,-3.8808958633487163,-1.7763856761782737,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9515114782428997,2.5786148051977067,-1.4363545275647995,-0.6681291822406065,1.442317050314664,1.1465667088200706,-0.3269300577214689,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-2.847938296751167,2.712497525564083,1.1348510423230198,-2.2420055180148903,1.4487652612218769,4.619765374911169,-1.766502892457076,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.8552096265177644,-0.12433378867180744,0.06127441497123598,0.13124974598382613,0.21864608825429177,0.8516308714702762,-0.507455045151372,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9413220120743674,-0.6671836871322345,1.1048795184969697,-0.251817589817712,-0.10041503067356516,-1.389149792100333,-0.26046842750699295,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.8515854524357955,-1.7456600581314028,-0.03925421048801203,1.5179974737998816,0.921332613668205,-2.223550296257367,-1.5207136810245006,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.8801336233511907,-0.4540198439328891,-0.07161754150108735,2.585913277189122,-2.060344360858858,-2.3122434286920814,-0.05721742141110542,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.1565930942796394,2.450186149747695,-0.36499519602591257,-2.6865164333840843,1.7817709621251276,0.5854922377125512,0.5256974003979489,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.285833909861166,0.28691651999098333,-1.099897735586095,0.9901853501724588,-0.6044670039367862,-2.050143304937507,0.8657679727222412,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.445814401245838,0.617451576980906,-3.6857076155185244,5.807368947766343,-0.7232837434835624,-1.0478351431241741,-1.7664121491248945,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.5724051967604904,1.043672733945267,-2.0466438205717346,1.4988175635419767,-0.022443970841448557,-0.5668460356271273,0.202681936318985,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.767326428923734,1.3282660371650246,0.6148708858259404,-5.476743033106995,0.10974913440714529,-1.9823302577814652,4.841465646867359,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.267326496231199,1.617557661552171,-0.15134447708394183,-3.488157628617435,0.05177221139688082,-0.9171772512777149,3.3253618318584692,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.0726650800289255,1.8463940170697746,-0.8554291334165234,0.2971150824858356,-0.9787305516015852,-0.15059128685897505,0.9251737194989748,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.6000678810964989,0.009464861555371407,0.32537504910087334,0.8785831725401735,-1.7720188770580114,-1.041503294055527,0.6853035439619124,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.31903474892623174,-1.9161472026304565,3.249115661818257,-2.064008784693295,2.2511539463109678,-0.4181721655528234,-2.50536511723279,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.27724311948888514,2.269876913502752,-1.0362588939415787,-0.4240851576553433,1.2557043908056547,2.115539216914462,-0.8397651617945024,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.6204471977858825,-0.7472757671052046,-0.44286591935948816,4.984083392550257,-3.765441418069141,-2.3924356302645933,-0.39967559303850064,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.4553901093631776,-1.401190635652457,-2.3384856201428965,2.7925686994223646,0.5230823350598678,-2.536900987998952,-0.31452413492174003,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9908721193084293,0.33504947512645533,-0.15004041559882886,1.9914202896753672,-2.15972930497663,-1.1173470973110544,0.2876627916908172,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.4268729371404919,0.0476100000649724,0.7234066075866292,0.9640920579044465,-0.8390128813007733,0.36362579291343516,-0.9290133023411948,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.7223130581227628,-1.5033618740143198,-1.0063691155313,3.7129996091186506,-0.18424839092347522,-1.9124490582287537,-1.9006188557753505,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.3863018949780674,-0.8118812038086545,-0.06824465995756457,2.3605677632827864,-1.9190940321241714,-2.074049594905443,0.10164582500649044,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.122137640295668,-0.7053791921624009,0.5001218626585733,2.202098650241533,-2.13406560335504,-1.846073420077453,-0.13442355611826817,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-2.612008274681875,2.9273962705582894,-0.6255802858328701,4.821435572962468,-3.6682637014042756,4.076926276736118,-2.3267975850725797,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.14722476209464985,0.7169962280383986,1.30877628107509,0.2902560870390723,-0.5278822077282794,0.2523150652935394,-1.279708896388758,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.7291366403013744,-0.5270029128179039,1.3646324243209347,0.22878411183186387,-0.6994553559333184,0.18645848628858827,-0.7164866293982425,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.3179603782898544,-1.8426294837876296,-2.0930634395627186,2.2618833621656558,0.4353521009755007,-2.8422362994637034,0.2651206458970319,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.16403922504683877,4.218117350808432,-1.464621892755238,0.4525429538867001,-1.1098371609469235,2.24664042651435,0.36048324675723487,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.3213609724022466,-0.025854561408853893,2.639880414243348,-2.0411613386965612,-0.2566331978960029,-0.15905221997635197,-0.12531363631323988,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.5267173926293351,-1.2061059553159688,1.0942381290703467,5.103189751648365,-3.4155924589635265,-0.4164954791259518,-2.502649328522689,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.4855645347515395,0.23735171533067967,-0.5003708194846357,1.7804232308433463,-0.7957779583467628,0.6944973953194824,-0.7601873835159783,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-2.3971333169627815,2.1868183332652453,3.3450712958825215,-4.719603701036977,1.4718198666990285,3.3830233233505638,-0.9827919370657879,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.11857678473749,-0.2366895620149072,1.2347293251374487,2.4546831756152896,-1.8039261811587064,-2.269262710480983,-1.4811644132395334,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.9259627347147839,-1.2059713052048235,1.6474462871354079,0.788474193584277,0.4987767692224161,-1.2387227304804325,-2.2836695458167746,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-3.000029275289839,2.924265303236554,1.5287904697666397,1.8091750655228505,-2.173785091949717,4.4352889084307785,-2.7944599158598593,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.509417258150962,0.9345200865941814,-1.2065038607091274,-0.7231863787024786,0.529992343413479,0.12208026281018039,1.064059623279838,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.843381208944096,-0.7839641420793553,1.1047338725131475,3.200498581509832,-3.6879624786217464,-1.9826767010553936,-0.17031233402775825,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.6996453363330898,1.834603462699156,-1.9563488472181594,-0.8078842985019533,1.603757579443418,0.9023581741197092,0.4157203160510998,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.8780698333418597,1.5711743895099697,-1.1532301645027747,-0.1279147199475934,0.3940852348745265,-0.6780554823489231,0.47599660994228743,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(4.074460008738832,-0.7586132247609974,-0.40680550183518793,2.80044141991812,-1.3520950083731564,-4.299897567538348,-0.23018611363621466,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.537343474263246,-2.346504411277027,1.0696587867609815,-0.09139515915291577,2.6976348801496677,-2.9037343661704513,-2.358064375853471,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.13810538048698184,0.4972293743727757,0.5170017632088637,3.8074275771962216,-3.441529620481504,-0.2520767485969924,-1.1460977221077522,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.3716927651804762,1.5264964546073356,1.4116615829468997,-3.2696400437607975,-0.44330241396466785,0.5126776429602927,1.8969558924443808,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-3.914146075904356,2.642868730715806,0.756953442096455,4.602054020453453,-3.1534100284140263,5.342012379341791,-4.033424004180775,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.6610025539601961,0.47098027882213267,0.09948302448982482,-3.936612690667609,2.4394531934109507,-0.2612419251520717,1.4621079847055367,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.7686849946406735,2.704509185058657,1.3450572364169955,-7.822928994397781,2.9044544260546163,1.9358105418972935,2.7734907448226678,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.080539638439189,-2.1322877957031263,1.6986178322913714,0.36371624049923845,1.429812500230177,-1.7326917232712606,-2.4425242014940247,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-1.167900481192102,0.1355097193610142,2.9097040430835177,-3.6404520903908724,0.9713474861844931,0.8816977448790321,-0.15831403216669404,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.45514503610371104,-1.9645298836180913,2.3714681761255285,2.487263886450227,-1.4334710076423254,-0.7560866446214036,-2.677795087997294,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.205533638434593,0.1522422005591213,-1.2695825588015412,2.5717611851063906,-2.15564597325238,-2.3135028542159386,1.0008109723209975,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.1514247059211036,-1.0644545346285557,0.889971896861668,-0.8027781017855179,0.612875597105246,-1.7103926464884456,-0.014562305063810954,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.9177035463916016,1.3689702950747875,-1.3645490052164024,0.12947308667161297,0.383804924036368,0.15022529478155294,0.3474568882561838,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.0510311481075103,1.6986541281639824,1.4298397013825055,-2.24828571804734,-0.6193865199766544,-0.5672340485010048,1.131261958671076,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.10475037404319854,1.9826630391809927,-0.4359458701822585,-1.9789206321994306,-0.5553707561694275,0.7295103208665263,2.2600055064016873,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.43499110833343724,1.5870101815511446,0.9402541543282176,-2.933159361296762,-0.5955365826478517,0.6100236545656817,2.1125115594475554,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(2.4357050136448253,-0.5731495595770033,0.16933618049977095,-1.7352638099045383,2.4501836994395925,-2.140306061138697,-0.24355599298923802,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.9152646709544332,-1.1044398743526131,0.7264309168930094,2.751047949593423,-1.2155360000324171,-2.376314205559085,-1.5965277293217528,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.563555126365538,1.5905399716363626,-2.054401768001512,0.12558226223380958,1.579243827915478,0.11405592777658333,-0.21982342334862204,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.730455784283673,0.6917046084758414,-0.7228104495687078,3.170055958828353,-1.447442840589877,1.2822906006373609,-1.5715790666666658,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.5567147832410433,-0.38074277886588925,-0.7250043310190759,2.9890681820702665,-1.7854730460169494,-0.8300350245815701,-0.38466093931103296,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.160113601533908,-2.0739287822796264,0.8656089350937013,2.5598075614900306,-0.4549159561400836,-2.039598659196028,-2.035308932344324,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.7301212300757651,1.7905058319133835,2.4785558633754987,-3.285854075731725,-0.2969054302783658,-1.2196278928218516,0.9665388396475895,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.15809910063242794,2.086280383850715,0.4267158940755982,-5.777388598503115,2.932621582965904,1.0770137767265244,1.8492278105417443,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.4346732485474898,0.6310734941541358,-1.404853676310947,-1.1002807120165736,1.4475439430359827,0.2545978186733911,0.8147445978455613,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.7111994909007124,-1.2485377736456615,0.00888551426993378,-2.6270035371594207,1.5232308527755958,-1.511116569724326,1.8232379971332986,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.7009681274533355,-2.098511498004252,0.49402451683802484,0.28198081101179506,1.092044026606271,-2.5049127881573976,-0.7737045360739153,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.350857441471699,-0.9080776890873943,0.4192135312704207,1.0335209980632558,0.5496545069678738,-1.424954540304835,-1.4810527974238206,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.6110098767879673,-0.19648138768779044,0.6976256713944607,0.7330099435441839,-0.4509443081740856,-0.6919587079193924,-0.7985836940346585,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.7120668607049034,1.9568572093714138,1.0113558871394959,1.03831694531311,-1.3192489094050812,1.7439853418610345,-1.6131748737045164,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.025810229759270387,-1.1821577183920273,1.3502904597295187,3.316741043641779,-2.023622604735853,-0.7820762681282083,-2.2180784244243403,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.4823313839367841,0.9550640446662372,0.7796517614669789,-6.113481580673545,3.141750466778539,0.037999576976416934,2.1678622639783702,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.3198057040263189,1.067353282335374,-0.03774758522041055,-4.276016524189581,2.3619524359005077,0.3465583522342412,1.734889684984254,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.3206279075878253,2.9104551041192077,2.29210751642639,-5.248625098223054,-0.558629284361523,-0.6422444653370927,2.973566459413637,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.2335520332662372,-1.3483862701781133,1.6523781388128378,2.032580021967608,-1.9769743403072197,-1.351134129026289,-1.0913704298839408,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.006197780146330656,1.5659161747636117,0.47428711078179253,-4.163105473654435,0.7532395776393404,0.41101356739081774,2.5389845366598145,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-1.653872981072018,2.150652366216212,-0.682391413932038,1.0683573143849745,0.1041132013079018,3.2579744909035644,-1.7333419946625157,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.1929822852229999,0.6893229432312034,3.666180819002058,-0.8739189672652259,-1.4699333333739455,-1.292656078547559,-1.1401278912126873,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.155136793407768,1.556608797804812,2.6765890234500116,-6.068904790037338,0.06903301027490838,-1.3072077729905347,3.3564000590548333,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.21045240367371898,2.426324089796932,2.0395576967297147,-5.872734043014707,-0.09982516278127862,0.12243072729230661,3.4253409716774006,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(3.17277330610435,-0.4559861433811748,-1.4534816279072529,5.475931755644249,-2.7552146063412866,-3.221196770695242,-0.8814034920122698,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.6588973963601246,0.8461887027217563,0.18477915861912242,-3.5310792828384088,0.25782571964298096,-1.7173208517757454,3.2150078520616185,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.17118349950674683,1.118995662564974,1.4568293787618913,-0.5051347078771523,-1.7022847156761762,-0.1348235263823884,0.47918217936316587,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.22222924383517895,0.11857662096295907,0.07650096299472098,2.0379158249219897,-1.471446181869702,0.1853732522038508,-0.7926848379983182,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.3949446302922746,1.370416982034507,-0.3726578951573005,-1.507865895566473,-0.619512343610795,-1.0233127750108155,2.253197907579775,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.1892991131649973,0.2446002905843807,1.5298718807562723,-2.099232339908538,-0.5056025526011423,-1.5804405058815307,1.378631760774571,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.9397609220772734,0.14612060976419405,0.003327490192374327,1.4823264748097986,-2.108057107017595,-2.2375080799048814,0.8543685258649079,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-1.9375716302148769,1.8574155817438662,2.006982221925343,-2.0459560007405906,0.6658052443469802,2.9620627786230567,-1.5001878399436688,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.2402192482549249,0.8729678849935101,2.1191043260999765,-1.8209285767011751,0.0702401507261432,0.5135562190468611,-0.5577240325203157,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.797645624903333,-1.5347261778272303,-1.4584107801210373,6.541970409599133,-2.25967473302527,-3.1433214379816197,-2.1371760232834607,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.2101207627001906,0.8178658070050348,1.345409305335169,-1.9521840925844323,-0.8292096750094382,-1.3207710619636854,1.5018732200296,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.6843456669089063,0.48885992756272634,-2.6849559269116936,4.369671523773933,-1.4771168062402,-0.9821022416444716,-0.4805026737266491,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.23784839921057732,1.3535111387210395,0.05320924751207967,-1.9541402009569646,-0.3500510709804364,0.5463348385111396,1.7919768604357116,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.13128543053550334,0.6798074445687711,-1.6368443198221256,4.528049001062067,-3.362666984877701,-0.02382357706983641,-0.014886019488387747,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.4538532345705868,-1.726862620300886,1.7759464630443889,0.9705528654666244,-0.49477289232990296,-1.4722744644269066,-1.4293619756392357,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.4801653855390309,-0.47453344733200986,-0.09260586995290043,2.687518390442803,-3.092103825000628,-2.3227047457368974,0.8704218574790192,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.5218708026806307,-0.06967317420230557,0.7596210580022738,1.4711668879037785,-2.2608212537809083,-1.0556984545567896,0.1697181766634217,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.4686426053930823,-0.6876980688572898,-2.318133723758386,4.0906358440061625,-2.2111071372497046,-1.888548462638197,0.6761113150287794,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.4655020791006943,-0.18262886630424446,1.9618533997695677,0.8126903231715692,-1.989649844992524,-0.17976489249510838,-0.6676474866827617,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.6720786039475946,0.30664618627008156,-1.7819670224326658,3.342376634237586,-2.127744178113725,-2.492973506799871,0.6527115800200574,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.7709544863051466,2.089208572308133,1.43733785954422,-3.1347865929904026,-0.7427482316186719,-0.29003767369798433,1.9880762501233427,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.004914193301878,0.8836225844754194,-2.8167544354447296,3.730548925991903,-0.14698284122574812,-0.6606442717965159,-1.1677908246516493,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.178670695122552,-0.37343176507494813,1.6102782889058491,-0.289668173735893,-0.5685426730499268,-2.544466773299166,-0.14330590112211938,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.450240693081766,-1.7077791947369563,-0.29053907727783956,3.1577977578818204,-1.574125943917932,-3.3781022323795638,-0.35494151519927786,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.7949700874472329,-0.6895749747428475,0.5374981044761692,3.165455372090398,-1.3991901354081273,-1.017110351525864,-2.011720496675317,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.9997776221443948,2.602928645773437,-0.6342952955734563,-2.148426258044219,1.4364180609082342,0.8128055918648491,0.4823811597366997,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.5142831732503337,0.39128528101053817,0.9008320554174565,2.720050611707023,-3.1508830104429366,0.18317686511736905,-0.7187511553625723,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.24024843070289092,-1.3426586516159533,1.698263715427241,4.97158422740088,-3.607946860074412,-0.8589087656970434,-2.6384582242582013,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.0649229275070042,-0.8691362909724218,0.06127110963748894,-2.4577692790862034,1.3553513321670838,-2.5767544706205916,1.8244096384210655,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.0388578224017484,1.569409049304232,1.55168058988638,-2.7338899094060074,-0.4317685880775276,0.28142214179950714,1.2299760646928444,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.083150208364903,1.0544201332588858,0.4849275584677891,0.030545098979075733,-0.9479940248019967,-0.675804210647968,0.2250820171268385,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.321939824236789,-1.7325735166420875,-0.1953762072802312,5.922742281805113,-3.438389085025568,-2.409237434210855,-1.6126418088678278,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.08186040177412857,-2.5585139391025904,3.3632598057046548,-0.37100416034089057,1.3575022880583072,-1.1842671469006207,-3.156866442574128,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6532751173456468,-0.1563829566175261,0.38904035718586505,-2.0827142213294705,-0.505080151941329,-1.3800157395745356,2.528797835185646,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.315159218931961,-0.09574244146296951,-2.870390868688257,5.331430959491889,-1.6278329123179232,-1.819930686484162,-0.8286246222285059,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.235231767737936,0.7854330832954342,-2.148601058467422,1.895492977094104,0.5666083244157072,-1.056258020890489,-0.5215948847904226,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(4.241292917178763,-0.9860709778639231,-2.0009845087092635,0.962148112338849,1.76426913823527,-3.885947965014016,0.1282356911817848,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.1263292028928795,-2.4050273682272323,2.9554910083536323,1.7828090923807403,0.9076886004084566,0.3679450599509102,-4.839058422078569,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.7101470672682688,2.847398191594129,-0.5856330427022973,2.8707227771069346,-2.014245686136327,3.3640164995655213,-1.8361445565243186,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.38581091755503416,0.5780440904400403,-0.5071088914742421,-0.6090146252730738,0.060807864136913636,-0.12211047185114299,0.8896074381060197,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.5231754402233766,1.9421603486454766,-1.7729788908428823,2.3753911110055963,-1.5997916313255445,-0.3262735124330241,0.2706188768556723,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.820843966643821,-0.10692047584327335,0.9321887238014344,1.719981242218561,-1.5089437086452422,-2.919276123151345,-0.6623159052278418,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6180585065606545,-1.7250090425434537,3.183283866457158,0.6566647784968032,-1.9066003341979854,-1.0063287837463553,-1.1432711661139228,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.8520873302590414,0.9591953810947647,0.12676127726500885,0.5343659255630722,-1.8092748172332644,-0.7540690279448913,0.9279444910129341,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.31530621506647705,0.12176928364261552,-1.2806898307327894,7.142595241207153,-3.5977212186784424,0.5510238558258297,-2.725111194146174,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.3886220250322657,1.8576914505484492,-0.43244838707799194,-4.044760393601628,2.2839267628076234,0.8096845168000543,1.6330072957261046,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6675726022935767,0.20087089318493057,0.6845200898058594,3.6937800329175112,-5.330865424937081,-1.706760651701588,0.9784018600546389,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6116081865842736,0.6341537797659369,2.8798713181168587,1.1828301568793216,-2.9571969765156374,0.24906758002449095,-1.2907026715079555,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6989473726151247,1.2498504500564895,0.2060774042696093,1.1690938756831124,-1.5014992194769494,-0.14794637691692877,-0.2834799610847376,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.5273671236385944,0.9999544767906874,2.7703496758203627,1.207722028899153,-2.501911705844986,1.5436946481674476,-1.9786310839177188,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.702511351487795,-0.34203109814603394,0.7835851548168504,-1.5405081514894055,0.2849694967382024,-2.0575090526779283,0.9992013412095553,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.9665214110949041,-0.19155552919216534,0.7199622529149727,2.9073996081407234,-1.9527120616051468,-1.1166708078512677,-1.5156463719764512,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.1972926334458771,0.28276647040138503,-0.5192444905278686,-2.5476955695233556,1.8593101847023514,0.12004744459504944,1.1846881329737942,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.0321665520706136,1.9966732155667404,-1.4686236794986778,2.3902186300815456,-4.092727086591983,-0.7734708607085561,2.4499981678087295,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.2698946255416441,-1.1605905587383079,0.4187489725358793,2.835484738320932,-0.68793046490086,-1.5864754446600542,-2.017976019601487,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.4416798285809602,0.24811827480851545,1.0654898348977437,-0.4024036574325009,-1.0692237349365254,-0.7179061516427682,0.48702102541566117,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.6907373915312665,0.5782488154633239,0.599945149500958,-0.2547283719058139,-1.1602651261549966,-1.7138182985715615,0.9289975810399699,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.21388172717674148,0.3670796032199588,1.8010065450197448,-1.5292034217343784,-0.10056573944930569,0.13923292684787758,-0.17493465232059124,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.8249165562810634,0.8118811935227044,2.3634010952575495,-8.883011395212582,2.455323134835944,0.3640943002357488,4.16121831002304,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.6123614832674,1.0270743358787555,2.4191824925784884,2.264244528945494,-2.9165944742592664,1.7064826406612614,-2.3591040913743972,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6856967207299276,1.7525897024574661,-1.1579023328670028,2.2589448355407176,-1.2312457357134239,1.8006792346334546,-0.8430752755923367,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.8165914912002683,0.8803866404425429,2.316672635369382,-1.1810808635080954,-0.7924349556466443,1.8423790039564922,-0.7807611895668487,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.5010244046779506,0.34523810497714713,1.3435520505455572,2.1639508161221426,-1.970858397807827,1.4462679112274643,-1.9102916382971258,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5635922598273722,1.4033442818530633,1.683062562422878,1.0596983259384716,-2.158976282461896,-0.1331177596503839,-0.9781682769599302,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.28304003232809394,0.7811221245610349,-1.3923039114076419,3.99712372860234,-3.032968329036988,-0.08346940774160802,-0.044461198603807706,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.173115613211947,-0.45623120871027734,2.175888858443627,2.470563591949725,-1.8629450889871788,-2.445235352837583,-2.2353945966210875,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-2.202431357080454,1.7546984246056434,1.1591425658354584,3.296837897884164,-2.99390938476279,2.901907693620618,-2.5643861199437623,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2507060234279137,2.247796821591938,1.6608145081255743,-4.7160328360136115,-0.29001991756211454,-0.8166791671531242,2.9931321130155855,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.15573258355460207,2.172215007412987,1.8398328672983983,-9.111886152079743,3.1988497003563268,0.5434197773241329,3.727484292533844,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.8328725961197609,-0.6837726198347411,2.9609894373395536,0.8541802329628736,-3.0704598054272783,-0.5282371583328125,-0.3954644151370479,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.2305590281166081,2.1714878997598683,1.7808987263571887,-9.091214440959869,4.142077261397787,1.2804508330843913,2.7234893852433366,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.8464950859920972,1.8457460443518234,-0.7052530209199774,-0.8099187003486551,-0.49123726501052833,0.00934840017523153,1.4156707278241676,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.7264984103515051,1.58762223148286,1.2543531688970304,-4.576041107988799,2.0471164338092316,1.556043827297222,0.7698900485966396,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.6310968833126964,-1.1557887631194408,1.8551643762629424,-1.3835655412181143,1.9814966914722598,-0.8322607453940875,-1.7817987572702223,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.1199173655735954,1.0316065570986357,-0.7388254953223654,-1.5610525631124597,1.5291161750630256,-1.1331188201036435,0.6838798263486152,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5793958654817044,1.1370197985890995,-0.42699818741119544,0.451226751321184,-1.1762866346999212,-0.17284061128496353,0.7719883664743177,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.8052991708512645,-1.1543441822283065,-0.3079753774879235,0.7547558056367234,-0.39720293791911077,-3.439804665164511,0.8189837917408398,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.4024940524681682,0.7830543837865398,-0.11283237135740953,-1.5985039318124916,-0.026048812102019037,-1.1984529193448816,1.7287177333060695,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(3.0147217767070127,-1.0200781629431939,-0.7724586754852318,-1.6645919990450377,1.9943933870089592,-3.191360642502209,1.3263216762617858,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.13531722708660943,1.9535028451727992,-0.04964794910170134,-4.546755747571752,1.8947915970446751,1.1248070457112436,2.0824716923788533,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5780057561867775,2.4389883284494083,-0.06177856070697829,-2.748621215287728,0.45812115038086476,0.6152223729044103,1.5886901010362529,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.0546518884657923,0.18234244286557466,0.11030325399538321,3.2191661811958934,-2.36593743964414,-1.0692768734441718,-0.976407733545978,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2933529177327734,-0.30513242091723924,-0.5615862663372806,1.3659303219726464,-1.362414397386018,-1.6806085153310848,0.8272333759272421,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2391823930807615,0.4859918391655791,-0.4928502195038118,3.3616731079156708,-4.091655429873027,-1.7086947303342366,1.1409546244149862,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.5054439327223408,-1.8924109686046506,2.5786138973436095,3.887056714146377,-1.6860332497357198,0.5234956471939621,-4.2927091788856995,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.3147049070042374,2.9550742125471636,2.0805292078567885,-9.458984787991394,2.8909817970255327,2.2781958951820305,3.6332132074095567,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.1283229732783333,-1.5808489621836723,0.8581958490255427,5.390836449848271,-2.2509658655011426,-0.782618186639205,-3.5335726851924387,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.3314464140423534,0.8129182143050286,-0.8520617594080788,-1.0575404326246254,0.7809407543778316,-0.7064459840496876,0.9995381008322716,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.880225665985992,-1.0411359815296204,0.0510449350726625,-0.3878704148669313,1.401121588230164,-2.981523988078325,-0.2104726020045955,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.1046212143302618,0.987236550938289,-0.42669185582239033,-4.241325872971698,3.3415739009279566,-0.08424468577629528,1.2092562055909368,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.973789947376512,0.8223402130701964,1.304490015055944,-0.8651390659470903,0.41682754650717646,2.4517085988221443,-1.4055044396931808,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.06981536179516334,-1.2065227695226142,2.2774676130672953,-1.1447098015872619,-0.7121456855990037,-1.304068586802913,0.28777483307132834,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.9795069078477965,-1.4473444569218747,0.8422773780928017,0.6313697742033327,1.7025648211172815,-2.0075492615530264,-2.333059370251311,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-2.0600652063829266,-0.6333837621853073,3.468536748603692,-0.8913322423271115,-1.757462156010717,0.812572213213716,-0.6022907633519164,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.98791867951561,3.031826514239644,-0.7924161436687038,0.12654610966629276,0.7081579465881396,4.176833422654864,-1.6699406256082212,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.8426115606298852,1.521152762657554,-0.1337230146189129,-1.4434995314881074,-0.2896581375563225,-0.2428413848621396,1.4665671078648115,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-0.7284609427171894,-0.0633581959686611,1.1837577791819778,1.4350302630784448,-1.685312280726362,0.3762055904421248,-0.9917669857292509,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.13284448420444384,0.48989059418620295,0.649707339140327,3.1534094899577343,-3.2386106987041243,-0.31590614582047116,-0.7870427657819528,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.2813990054292852,1.8372801264131764,-2.379643406798959,1.3652576471003457,0.8512744869758768,0.5316461788691897,-0.6156053305262073,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.2891125617289863,-1.034466590177339,-0.8528073168005216,0.25565750615528443,0.9498395616806752,-2.48113303573229,0.3410176709625573,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.1906881283588873,-1.056056540973113,1.3574824118581417,0.6476728621753428,-0.1322934876060734,-1.6819740111315091,-1.2235936957518294,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.3905684814071666,1.2466198898609266,2.259663679830063,-4.14763740755883,1.900848972347196,2.0483451909922756,-0.4555035477919126,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.007915404964254469,0.9420317471279528,0.294832519263326,2.582719495108136,-2.3945080639778853,0.28592816588339703,-0.9237809797403697,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.583521877945629,0.5331277730352217,-0.48721239763332447,-0.9498752906318381,0.346744013775807,-0.30613068397450366,0.9852227565956533,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.3038572775603694,1.8199226286216352,1.7209044780887788,-5.871244361704007,0.03082808989632535,-0.3313693128329034,3.8557824350560352,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.4668677560682444,0.615864357805121,1.7525182699336228,-0.8210346671163282,-0.06020757379664965,1.6749795990476146,-1.2205165325854055,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.6437634561464207,0.46869838369521777,0.2512633646181748,-4.172634394188566,1.8972887815402877,-0.5040107496571128,2.1281248265853847,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-2.566685802269739,1.3703937592515176,0.5522319795313368,4.714571322966261,-3.304529843224266,3.1700807408713936,-3.0669517754857556,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.4321320759545988,-0.5852717998212875,0.9344530828549473,2.2230574005646426,-3.0763883080523486,-2.405005631784908,0.40557678200484926,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.9641855971738517,1.5212499636636303,0.6152159628327369,-0.6607640817743697,-1.6102751585503117,-0.6616239847898601,1.3104820483943997,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.7048725942936547,1.6561110071176048,-1.6410777840461575,-0.021542409537615766,0.8497272700517364,-0.27637230275554314,0.29379908986403824,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.3877637394253206,-1.260106166916444,0.24240366155067983,3.254511285225256,-0.3359126390530982,-2.495451370201776,-2.4430734577527575,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.7159795394991253,2.058479403961047,-1.0298338285959132,3.8830429726396325,-1.9236847469944287,3.092667652752938,-2.2573319930263267,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.61157813457322,-2.4629468072718197,0.5947853311127764,2.611227042557338,1.956298392040809,-2.746393521796805,-3.94414512547543,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.100378156997694,-1.0254193606740454,-0.3383292598098695,3.2522179469555192,-0.9092591620666294,-2.3140923190362463,-1.4339917844306427,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.5793051540109753,1.6188751709051976,1.3848844184755469,1.166034226400195,-1.1259010183836429,2.4684572651406573,-2.3025016844857564,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-0.16989054765279876,3.48842017914546,1.9300555017851737,-4.960543036879973,-0.584002148725781,1.2038222628858277,2.568256118525951,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.3846175270079646,2.145798875875564,0.1748386720212266,-4.796962390806608,0.5073503830831803,-0.7852786914681317,3.731869923790979,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.463498091505543,-1.641948347672444,0.014419220996607973,1.2485427665891868,-0.4093101695125,-3.315069785949253,0.14698377443441846,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3015458148717531,2.4084218001678828,-1.9377479084764957,0.1461762550285925,1.181541855937334,0.7614544555573661,-0.3175290393124959,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1995047619542676,-0.5685997445105482,-0.7780001688368265,-0.4208529275293881,0.5408090529552546,-1.441434337645698,1.0491529750596622,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.2789267591912103,-0.24431600650961838,-1.7008831850097177,-0.3956028703382682,2.2778328150392717,-0.6617441978281935,-0.01943996576935536,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.4426854749839935,-0.4544872588795166,-1.5961072511292693,0.12966802768765306,1.393550473376669,-1.1771061322845136,0.352301270605195,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.3811254347865457,1.3090655871933126,-0.27688380534200907,-3.0070886914719375,1.064692283384284,0.222022515151732,1.8721838900322956,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1193434289666437,-0.6252656232912621,0.23118248743666925,2.685581337005184,-2.153833997930418,-1.6998262419123031,-0.4037349176707249,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.929529577814512,-1.7024107022914883,1.2488247870677989,1.2738796125012244,-0.5345104518047759,-1.8796928677805893,-1.1427878473451383,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.8362075518180005,1.1085707711145794,0.9854067590709947,-1.314041820148795,-0.7016240360391046,-0.5921632413160102,0.8578333456580334,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(3.5781343752139643,-1.756334316490143,-1.8913637043295912,3.8207236620641587,0.5041362860876586,-3.5985748597254386,-1.4898228334981138,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.3438720049323608,-0.24833525627533626,-0.8346231392283516,-1.5319164096905173,0.7676105738102315,-0.5790077722354865,1.78082722778547,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(3.0647342782436895,-1.0260134932323655,-1.2844635442292494,4.455520074360008,-0.33555784108704956,-2.780046271993584,-2.251683378416552,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.1706511098490927,1.427297039001016,0.16198610469672814,-4.678308717576381,1.9758795045738022,0.4947574282507664,2.2002784569922085,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.562622677878104,1.7307650405142323,0.30622820821123853,-2.7159606100756912,2.3010271547514884,2.9293712371855865,-0.7525506989141675,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3230332705184404,0.43074369107629307,-1.012178677869002,0.3764842669438245,-0.08467152822680513,-0.9691680411489616,0.6840966010729281,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-0.6935320192169789,0.7446618818491898,0.09665333347742111,2.668069679850536,-1.4079283621598315,1.2190489986881268,-1.877269359035067,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.6615988715176795,1.4283536020765286,1.1939007488960722,-0.8584576982487286,-0.9666534542260612,-1.1587443010384395,0.44873555048520886,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3850989235975144,-1.321996217461353,0.6533355400578518,3.765014097672636,-1.0657673636987341,-1.7288501469488284,-2.7515588732367537,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.679404226498682,0.4488111266798771,-0.09194107232644777,-0.1276070545791313,-0.6321422212401715,-1.5847461579670379,0.9576005483141299,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.04659758707243,-0.09637025410588262,-0.5301580315997092,2.3882076811218886,-1.1488798805266265,-1.9448358030407187,-0.4760994417763218,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.9502778204515043,1.560900513420219,2.6139226644509987,-0.17703081525604314,-1.3385353345210982,-0.31964658388963124,-1.4084087880151692,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.7064636980022851,0.7232269304349839,2.122895762364635,-0.16484613782968235,-0.5171650348762113,1.962539190063468,-1.877610385342741,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-0.27650843111684753,0.8824040605554635,-0.30196780207451157,-2.686121134883907,-0.17986243753961562,0.1554027845787418,2.9180254329681845,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.4055828873228918,-1.686704469180161,2.267279261928881,1.4120459259316966,0.32553090572843124,-0.9591177085579479,-3.2406871412917724,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.7528205900707885,-0.7838213498913917,0.42720475600569097,2.4810550424721343,-2.2722544267653983,-3.448555825513464,0.07050855537470957,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1680246800757323,-0.40872210452552404,-0.4508203946039193,1.8115932970624247,-1.3903370815714982,-1.5343584504031225,0.30070498273072843,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.641411139391031,0.13066169098555191,0.013403427494233067,1.5312226380139464,-1.797441178406297,-1.830627427150842,0.4303846195173422,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.955478907567246,-1.719506740185793,0.762082256889067,0.1866756780988265,-0.9744041434997593,-3.309776136185275,1.0986283866533104,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.029214776852436,-0.2878096697019167,0.4084705542378164,1.7382336286765805,-0.6833067762076729,-1.9810690593038442,-1.0883122722276921,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.560341449711872,1.5663634023069921,1.0471848595431368,0.1098488111202763,-0.7390036919795584,2.3112166370786724,-1.236752105743788,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.2089307327631884,1.9964256833116285,1.226378416624192,-2.4725235681126247,-0.8107018052923085,0.30001515631040365,1.5070634835647967,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.9128041176239442,1.8895100577112083,2.2886808335130913,-3.820954170467079,-0.6052835544037938,-0.623305490142599,1.866033800845503,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.993453919875277,-0.901133069473183,-0.0373521979721787,4.2922014798199974,-1.4822374048552227,-3.057711957842002,-2.1409987015165632,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.6766898453496916,-0.5261764912138024,0.7312972156077737,3.9581515737988227,-3.6502190772987513,-1.4820841451981968,-0.7891414274310181,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.14295833912761002,1.6231233113707968,0.18467857172572733,-5.3244744678874545,2.795954007446923,0.8238138676166966,1.929063833460194,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.7984907565135961,-0.08748991514172744,-1.908421605424304,1.0997506504768602,0.0193869641026021,-1.6007691098789487,0.9508597268855666,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.4795447177170868,1.558265108527901,2.9519444855092285,-1.7082112440267474,-1.5242435982351923,-1.2321506790399888,0.17024643186890942,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.1397560857395845,0.9929628562316919,0.5750597254679413,-5.175405133250185,1.9970886299361146,-0.8051594629268625,2.6421930794939943,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.2740780719977765,1.1197184976428955,0.651490056121677,-4.4266113109917935,0.15736308604688132,-1.390854468713751,3.651477122782289,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(-1.0402991953119143,-2.06533833303297,3.758708846819417,3.6643483716116036,-1.9836502961873896,-0.15018640286882878,-4.728987719679379,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.388042546834122,0.6351311476333177,0.3087393130542635,-0.9747105355778285,-1.2058573277731863,-1.5810825745871568,1.9467994460089018,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.6408026773429794,1.4879283180814786,1.547058272073475,-1.3451802114196914,-1.1447992224936614,-1.2638772850029756,0.7853236881637284,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.0708542922701993,1.2711484350719897,1.4339591134115544,-0.16035643681145156,-1.184129814417774,-1.5691360483142587,-0.16642233400730944,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.8610958818630077,-1.8798623440397844,0.017309940244927047,1.5547116910354313,-1.2884818488253607,-2.214675539259715,0.5772827870563995,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.31017681214048487,-0.5669909849550294,1.9488706008510093,0.8765489312330507,-1.1971421401945954,-0.8532090545239664,-1.265147944962231,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.18497775560572882,0.4850151901864863,-0.6551824564727529,4.63982714028508,-3.2551402962092797,-0.09431469092158731,-1.0924304335485553,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.4669444008351666,1.859760910530527,-0.10218608993775513,-2.7065907109099916,-1.0087009804989429,-2.1344551850779685,3.6376693906822846,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.8238485766287365,-0.3526798936194202,1.5512566546145274,-0.783457568001856,-0.609118220503116,-1.3676361438381344,0.25775920670818486,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.4279886506498394,-1.318933410675522,1.786893864552341,2.319001466307592,-1.3636960802506595,-1.2080158126691145,-2.140891357760963,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.3245577743791705,-1.655861652943644,-0.5357071043474062,3.763999930078965,-0.8970789230750165,-2.833502507806386,-1.5072610448030646,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.285195766833195,1.6783115876604113,1.513434891521249,-2.2682980117838745,-0.45638868017239276,-0.7418730885738332,0.9488865767818059,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.3481586273438384,0.5174277441556074,0.8785338801961253,2.8147248395427154,-1.9625677135620347,-1.0292085195161238,-1.7895813340376878,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.6954065675726984,-1.3664621081516608,1.5476108546333234,2.180283590956567,-1.293895789561963,-1.5096513815855221,-1.7765071005868003,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.38827399019045394,-0.49792022753587073,1.0198058264078862,-1.5037569154998438,0.6543768219469193,-0.7437803404718291,0.2098285257737864,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(-0.3404731340559216,1.2427923266757308,-0.16300461061876503,0.2831612899496902,-0.34457609890571084,1.0720599628234369,-0.3514992450509097,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.3161748863138345,0.997351948912386,-1.0801295751777644,0.7571521026186296,0.0016508799060777068,0.48479285742246886,-0.13508160168753358,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.12681720829445697,0.11855714969664732,-0.9104184710851837,-1.085292209788002,-0.36232862899070417,-0.46951670408525054,2.366122573967455,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.7054632977954634,1.2572176853681154,0.860029635692299,-2.674401827682585,-0.6939897336698935,-0.6804162818791725,2.3309482151237217,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.07976657146411,-1.4207183531564556,2.0010660824353304,-3.194648928592429,3.2399872347286767,-1.3523756841739691,-1.1253482654531937,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.23610519315312728,-1.7449703241490164,1.6819741303788158,-0.10873160707117276,0.05416324589686572,-1.3123804509649377,-0.7907457427267194,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(3.0428333674190866,-1.0841060957114639,0.17243967022211515,-2.377637313997145,4.364469885879871,-2.4605659936454316,-1.2447560474503905,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.6701855712395437,0.2928301757559636,-1.5428673307968002,1.287330415870048,0.2727252075767579,-1.0692518489650513,-0.035616454995755165,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-3.4800819804037824,2.977389692948332,1.8517753132543673,-0.19008504775532553,-0.7707879065175474,5.033813816903953,-2.5333706554638304,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.140202012142074,2.378634968895875,2.7556348176530534,-5.2834702463746215,-0.3652107320195507,-0.7350150171567257,2.5581641229084484,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.0981169615204438,-1.0119127261725325,2.2820770387227434,-1.9614013769844154,-0.5644666042090782,-2.284934214852611,1.078012639576424,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.8517786531323737,3.6302113892867838,-2.0029871207282746,0.2619852928861331,0.17390567848052974,1.6325105715744603,0.09423329683760107,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.4165800771742705,1.1149308340527142,-2.271387795418956,0.24518100275596663,1.6930308923123703,0.0011584811148082907,-0.08553747108993615,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-2.0053022769813875,1.9109759825293087,2.773376480448724,-4.517202660362165,1.395196983263658,2.817448384076263,-0.39825181111140695,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.5355188940690749,0.6018680914829695,0.7541924354853773,1.0775908586661713,-1.0907319838063005,0.7639886786882052,-1.0624390472003777,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6595797552374167,-0.294809475541403,-0.9630206945978195,-1.5012079340321822,1.0098225390572804,-0.8157334681048121,1.6881542023624867,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.720237261284876,0.11277874103206109,1.844572508290903,3.1533623636012984,-3.9104997386815334,0.9943897606151588,-1.3654061835218285,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6922463463083346,-0.35073899252145635,1.9626145160108819,0.08179158347355334,-0.9530812260330679,-1.159859309462594,-0.7170911906049338,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6413378935676259,0.1773899280357525,2.490383604140318,-3.8237997263323082,0.3863233217240887,-1.1052859279962846,1.309165949800489,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.918763813284105,1.203162397621166,2.561321396321196,-0.3779626409007189,-2.283467449993765,0.8127359401206152,-0.31172201669053634,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.41808616994891934,0.6297437830552794,-0.43519990266235187,0.8152590429422543,-0.4861773114380574,0.7939395653553468,-0.2700384949502228,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.0589503046935691,1.1096474018520084,0.8430477162065145,1.017463543138896,-1.8449195206430737,0.23001103979814566,-0.41668386521379497,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.7035305093965771,1.852386714172002,-0.8581310953858379,-2.7047073013316734,1.7544323773483619,0.5857189112040242,1.2179049628159166,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-2.404521999474064,1.956856261585237,2.743662957828813,-3.763120660309916,1.2341598733468144,3.336518429323325,-1.0843551531070281,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.5787514548491495,0.9043297397824689,0.3647966016141414,1.5615325941265177,-1.2949689138659002,1.9742065688305668,-1.2806827013749367,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.0235078222978835,3.0475095656963602,1.4758089211909295,-8.183689162345186,2.311408931029436,2.0996841788530536,3.4655603211752783,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.4171153313833007,1.5601837547522388,-1.788047063738159,0.6536070698420184,0.03991294542935109,-0.23285562477977859,0.5515980511199634,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.5943012663247385,0.768939524488533,-4.7102725616072085,6.878524574598383,-0.5433735742893244,-0.8204559726610645,-2.151320262569758,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.095928691139254,-1.5364598955767699,-3.539396767334079,9.353427912472746,-5.3917492321240745,-3.143207068564544,0.002434375177712278,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.1733973608839687,-0.4779398907232715,-0.8222573364108066,0.5741388087269558,-0.8233349828146013,-1.6623616225589888,1.4089015715206914,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.5968720217016728,-1.561183647496414,-0.5368548320897575,4.563481344641381,-1.1935320996872132,-2.9643545782562257,-2.0430397264366764,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.714041736048137,0.026319558085377337,2.358390982988962,1.3832961478997392,-1.1938325736946396,-2.6210410239146587,-2.0630733441327145,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.0224268255603193,-0.3251567068096688,-0.3890143766789398,4.248774781294234,-1.7156272804262211,-0.9098747934249555,-2.0634504893495587,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.2466469802152655,-0.6104373122047839,0.013869093684521272,1.4174148121004353,-0.9299675669968678,-2.588397575094862,0.05056310478616921,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-3.734598766339932,4.357711910775082,1.8063222011726097,0.5647484734204162,-1.2668904831697467,6.168350149687059,-3.383175902767071,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.5075416946835463,2.826260938878084,1.6757291381825439,-7.312162195113464,0.5879313407461273,0.9973913776640214,4.309180001467237,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.46423411343145,-0.6005198090658379,0.9652261368365875,2.779552976547825,-2.60911189484479,-2.1363879310601983,-0.68726399922343,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-2.1740091482509643,1.7158438812483352,1.207751628708825,2.1653318489129973,-1.9385559871567524,3.0041298293453407,-2.4842256171560244,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.7576001841832798,-0.007594954223985706,1.0139997501431828,3.0324645799871592,-2.8287853572848425,0.352236350020044,-1.3663697410958096,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.22682005310878983,0.17882393778738837,0.6852239252823532,0.6996858648832547,-1.1005329373372745,-0.33694671576753815,-0.2923121947217511,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.6420808677485317,-1.567375548263394,1.3596455396410332,-3.18643779804509,2.6618463434153123,-2.2371667201597454,0.22533544015338114,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-2.4762355913130216,2.18020271868241,1.3238107587214825,3.0782376854873186,-3.2670188241062785,3.2966864834016447,-2.424026089867702,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.4681164581671533,2.7802016066061546,2.4377514573974084,-3.504681185661089,-0.33038317365035264,0.576740491675048,0.6678482697206392,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5911030428508862,-0.16060250554086664,-0.01306065642624099,3.934006680488941,-2.120769002361267,-0.6016009232082299,-1.8031712223115948,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.174745604954626,-0.4965423351198456,0.5943755851379704,-1.1052321260476299,0.2661649679666236,-1.5726083173913104,0.718004049467069,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.7412751177208392,2.1327090440707304,1.194964453595523,-8.044195522762877,2.831742609518064,1.4456391207259371,3.4658128935875947,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.4728274623052195,-1.4446871431555646,-1.473077006061342,4.962183982602092,-0.877344961449386,-2.5959492339011856,-1.96852347020304,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.4964109038216507,0.20917901186206578,0.033859363997187364,-0.5696525703041693,-1.37076844681051,-1.950833571036897,2.1420942100235636,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.45583852223057186,0.9139217880820522,-0.503312639124806,0.5499114765531566,-1.2222692214056665,-0.20147776675726137,0.8599714517914723,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.2737373806536043,1.27270826072556,0.4760375405877796,-1.801901825509861,-0.692130105318383,0.44709954001227903,1.6095875372621724,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-1.347794187900541,0.2524553675565264,2.1003710485812177,-2.9225590783504978,1.4128230662455974,1.4304610174764638,-0.6822127662589081,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5871361479153822,-0.8417339321943338,1.1995718501271524,0.8202523967506464,-2.301137318093607,-1.774115856891251,0.8098563835220876,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.21508659002268615,1.569888963274912,0.03986115298828641,-3.9601982606129926,0.9380243205292723,0.7121236564430702,2.5119291735464375,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.7941481129839723,-1.0798806957539784,0.025240123668783254,2.633977218875101,1.0284753931360715,-2.3842856430416517,-3.002641820170753,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.21207162097481735,0.4647940297522595,0.46295798512172415,0.3232524421339397,-1.6159135710807149,-0.42882666161264194,0.7335086616487765,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.4929756391749678,-1.155157311134643,-3.4806846906158686,4.0693214517288965,0.35597074350303237,-1.2793994744342176,-0.6586972623541594,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.6854581171681562,0.1834002919426212,2.0365519468046482,3.858832265773903,-2.607252553631471,-1.5355541412174958,-3.1426914316979495,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.8327800893646486,-1.7343614197962078,-0.38324008318772385,4.214850202134405,-0.7612512185075357,-3.2089289677127355,-2.1597330449132066,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.07122882463582014,-0.6138287383249159,2.384026551347024,-1.7146604393110776,0.6628743724080095,-0.5031775744589227,-0.8780321112073121,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5714623898190813,1.8499637809618559,-1.6528766898390757,0.7922648746756872,0.009123352945717644,0.7920546495067624,0.05588645257506697,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-3.2633273539187027,1.911289368256512,2.065182047264482,1.922313389116063,-1.9358969584812344,4.156853974629493,-3.297822591979971,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-1.0527594231003512,0.11046706857150712,-0.17034216295607751,2.002056902252602,-1.3909207669150798,0.9854200330466844,-0.729769914147927,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.9857432393597216,-0.797559664346102,-1.8628229075290526,0.7912416658605166,1.1189706285668513,-1.890957287869455,0.41557152949411214,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.504762737846811,2.1769977714122506,2.57992693306698,-1.8747939851770445,0.46865410489106774,3.7026137438952347,-2.2438143549852185,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.41886628561756134,1.997961493652824,0.45098865921149955,-3.9240951571422404,0.6720821012238447,1.1131211300973887,2.1496317763658626,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-1.269058850471455,0.9113128779485802,-0.987609614890711,5.17453944944951,-2.792635641455655,1.8633254768112497,-2.225434601190937,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.60221516530219,0.8573873954567277,-1.2532323321502234,1.4586670560212756,-1.2872866648841212,-1.184906097673008,0.88142213963169,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.664945717778535,1.7074410216455105,-0.9164942360480002,-1.7328352122931063,1.042439944629323,0.4681254075262177,1.034268339879112,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-1.0229129860675013,-2.780448032379326,3.2847626195180495,2.509568320419263,-0.8239377084416294,-0.47304522543584926,-3.9581559499963603,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.357349140742531,-2.30529006767782,0.09791220462993844,5.626021471718858,-1.5946347715827764,-2.1607839211751037,-3.248371527799422,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.19008566471204968,0.9075514438212983,-1.8650607875027787,-0.8680513536341087,0.7997443732584267,0.45238678503301627,1.526885288707088,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.9254711696053395,2.1750597750267042,2.1933277965486973,-2.4693963476817404,0.3973459599348179,3.9233999600808573,-1.2357640687177518,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.233619763358607,0.9913146965561134,2.3973693810536236,-0.8070564887140679,-1.45741017327986,-1.1664320360973062,-0.13201085846744465,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.3161303390254758,0.3276995534451512,-0.02889035651373595,-0.8230808482804979,-0.5319352491047409,-0.47967360079060634,1.36719581140463,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.5317287425894308,1.208735839267825,0.08407141955287045,-2.4813609730490715,-0.8888470073318796,-0.6122551141011588,3.060645109675252,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.07298769165290997,0.819808188036161,2.0384919882650516,-7.748399227191985,2.2435939891188377,-0.18719747936307643,3.6016374001334093,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.7901852621466418,0.5145825360308702,4.637957908386738,-6.150836801745065,1.3912229090534307,0.440132724867259,0.3252310211529108,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.831671718235779,0.5977438753380795,-2.321886357828979,2.9104235559256404,-1.017343884238508,-1.1877468146597532,0.22300620292739104,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.1539924701669846,1.883675370067507,-1.7680881855073274,5.807546701204832,-2.7646119804927913,3.473472133586789,-2.7200321903160463,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.756348176804372,1.7615764405819676,-1.5388289669836195,0.07080621692501461,0.6426698929723338,-0.3106612170666746,0.277797622658288,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.2487545187544351,2.609229589371483,1.8882144277890807,-6.154774232631951,-0.5638199006934052,0.43112941318589476,4.2027303973580565,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.10955533675333518,0.9087196837335013,0.1136664013383859,-4.1472494266956055,2.014924031822069,0.3431702042196298,1.8459002928252932,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.6652930532149404,1.197530864301426,0.9169919325624285,-5.961473613444594,1.8351066038331625,0.8272159997488158,2.950791256392912,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(2.9316838982943185,-0.6964392952831678,-1.1502529215081365,1.4921077726597665,-0.5780146627368032,-3.196356469849491,0.85907655235715,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(2.600077692763368,-1.2623740481307253,-0.8962595005959539,1.9679383389242255,1.2790953056015506,-2.4139441686510956,-1.6329167452667077,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.452791564760785,0.41146795445009166,0.14392806279219328,0.17108543131200796,-1.029600784845083,-1.469443131098191,0.8077470058618661,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.727098084005239,-2.5546937777149403,1.5105485872014457,-0.29443260630992396,1.1439390403078158,-1.9439707234539425,-1.1506513582879956,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.7021391905991415,2.4414499286754787,0.8074093066989305,-6.070712605446909,3.5191034192402006,0.9707334993431298,1.1288619039998729,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.9308026588402101,2.57928079368376,1.0748311675888704,-8.529095009719802,3.699706292413457,2.1444358957249268,2.9816820943899875,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.2360219692964298,-0.8921138259532037,1.324707218340896,-0.13529792443717042,0.03483533664127236,-1.7310071987282634,-0.5952741360978552,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.9580721326511403,1.515267173693862,0.9547831554732867,-3.792366629532976,0.14805240219415627,-0.6733000064089022,2.4871576141650023,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.11224442995910122,1.6882722404753472,1.7161782543665778,-2.9486619700579975,-0.6165883797519401,0.3909989063485372,1.4200766219929295,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4004498564816448,-0.5483306586274586,0.6884992629346187,1.6860799533920177,-2.4028921057076675,-2.221265193101131,0.4912576499341499,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.239942383240145,-1.5480563981269437,1.8577874744757454,0.7272933808052509,-0.9344450764118416,-2.3269279460451013,-0.7435854860482998,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4542570156828636,-0.27176912816457977,-0.3618604064197557,-1.502224358768631,0.9678737333818738,-1.5496348751441344,1.2748010290281975,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.1468076270806558,1.2322052468347184,-1.7602650358096363,0.7212280541208039,0.024643216826090497,-0.1814752483470614,0.561492706792226,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.5077003347535025,1.088513118264028,1.7551210104319521,-0.736441038595527,-1.3056362875092131,-1.3166156974158438,0.2511173359195177,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.288389962747996,0.36332653636764256,1.6656089747619136,-0.571105661353323,-1.1612868506911342,-0.5432082064452731,0.11792111797788773,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.9995296056005114,1.3529339664784819,-2.3981864910916855,2.9849134331502665,-0.7407438786500962,-0.7264517691858112,-0.3538463287395124,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.08579858389687023,1.7161890418770884,-0.06656951353461293,-4.105281638118306,1.5285630478172285,0.8775192894752291,2.1152291309916,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.9661724849567914,-0.40445855460769375,-0.8984041426116092,-0.036985924898836356,-0.8750620577241204,-1.5780799558007883,2.1207161932972505,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.8699336332979304,0.6851162561092408,-0.9012433467548683,-1.8635864465365037,1.9301898676639888,-0.0891783038473156,0.689996751808305,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-3.390371025284407,4.3362614916709905,1.1553623702701241,-0.5402753273558951,-0.7164467112290367,5.759960343500196,-2.098251841172708,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.3121549519106877,-0.49079106810872064,1.0874868101059274,1.8775100736563255,-1.832698844916588,-2.771227001345358,-0.5639729980991646,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.5317909834339799,-0.31402050735813103,1.5222379228128546,1.1028560181554226,-2.2574716049926096,-1.2763341078397625,-0.0682234152133977,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.3489372887473756,-1.902965890195,-1.1058115737668315,6.444396538850495,-1.3013307250524164,-2.59335014865392,-3.2826286389085126,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.10352282484992748,1.7763521706893264,-0.98957323888984,-3.092145229794725,2.3159326671997436,1.2326770331559804,1.1091309782040397,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.6781201591090096,-1.2017056619726723,3.1386436103718722,-1.4826197651366986,0.7413994646513105,-0.061222556588136814,-1.8011807696190751,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.3088071867454587,-0.9058060170486686,-1.533795865471077,4.443254383671029,-2.2143075168348214,-1.767491483116837,-0.3779098725243084,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.42758387794542607,1.3840546035724883,-0.10889830402413547,-3.1754775666120802,1.2232929860961135,0.25803202005775294,1.7027079999027905,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.1914622420587,1.6808636178618053,0.5565573242166482,-1.954492290078305,-0.9510650933441838,0.14161140375081846,1.868522343287696,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.327521800555288,1.707072587638922,-0.3408892551572401,-0.7841366540150495,-0.30706125962166064,-1.403400095559777,1.139293148033613,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-1.6870712174917015,1.691651631532742,-2.288473035077086,4.52043452758501,-1.8935449916089768,2.9237857364797977,-1.609566360393679,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-1.733708401198054,1.3041639797022042,1.400544122440466,-1.9741481668869392,0.4617729940086308,2.3114245726840337,-0.5274602470044196,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.7575715367081157,0.3753135909060661,-1.2693308636208644,0.5371878918731451,0.5384575757585188,-1.153326220541941,0.20366235231148166,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4883842771922242,1.7515504950397989,1.038220064787369,-1.3034051909539248,-1.3740421429605687,-1.0453541069418544,1.3316370102880164,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.816707826258376,0.9334850907564992,-2.7235167200741737,2.561614634752468,0.5749390983559122,-0.42892177674740073,-0.8151907044116287,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.922399180978037,-0.47398744746047616,-1.086455344591692,0.5421631590354696,-0.17489100087797138,-2.141675253309839,1.1382797565150389,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.4370945240496815,0.7406706373308528,2.3817851052918986,-1.5970867983837052,-0.5383146950358882,0.43966344292078025,-0.39121212011259565,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.5227791882404937,0.032628064555142666,-2.7346852692959223,3.6243268586724393,-0.4338687119554254,-0.8963076772737661,-0.5620760681630759,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.6925555904243851,2.2660402104433004,0.571879255854077,-5.136520159556465,0.23388977994347782,-0.21095746484974373,3.839104184046647,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.6170807446057736,1.1618050798356736,-0.3318054593493467,6.307458106404423,-4.152242368795466,1.164412152487124,-2.6433851880918566,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.09933841297654922,-1.3009113230097453,2.3763024813118814,4.843663490637228,-2.7335802864430874,-0.8152959702787319,-4.019613642468096,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.29723257606972664,1.534048303390355,-0.9278630836202846,4.548220911132926,-2.2312916467625055,1.4265140750671224,-2.3032786031118535,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.8723473627536515,0.9717287860436329,2.3847715433643724,0.7344463319711535,-1.8629044282929315,1.9783943683566731,-1.8140411081153947,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.3005647919287311,0.3806355736171525,-0.27869848922330487,-0.8799959881301632,0.3995051923334578,-0.09156717805815423,0.6758278798998893,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.5955050165131914,1.450567042185088,-0.9897943065169226,2.737681953113439,-0.7663788673735875,1.811148094805718,-1.854983423784701,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(2.9669296357978334,-1.3324159367684048,-3.104836225416732,5.208190995197741,-0.8202049866634673,-2.9861699841871703,-0.7016133155919906,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.228016828510732,1.1216551175944176,-0.8558209427875334,4.258437071067928,-2.7976936142573496,1.759131670682027,-1.4539872453038518,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.2339963699690584,-0.2804755708218589,1.4715087228456836,-2.9261144609808616,0.355595728180802,-1.8268629783014674,1.6411674193628243,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.9659087122503214,-0.2548687699578174,2.104950827672197,-6.076161419668977,2.9878426404779534,-1.2192738796045464,1.5970699410759703,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.22061418917082676,1.7175054727901158,-0.5033501522353456,-3.8353548758394256,2.331439472843757,0.9401634108615404,1.4604187484921587,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.309907365358922,-0.12990852843173584,1.0737239270579344,0.7337127225434502,-1.246715098799017,-1.6078875928365746,-0.25052374133607436,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.36721164916342697,-1.7079119599701718,3.0068461711549523,0.14826986026046768,-0.8186880144087275,-0.9349454628893296,-1.5313812357768914,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.6398796287916704,-0.2454439388782933,-0.3454790010819664,2.792239227481451,0.15344573827886987,-1.0493634503221692,-2.4336157756640855,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7847363960073463,0.7363916664271204,-1.0119432855225785,-1.9544812667283535,1.277543003992446,-0.2529346594821023,1.5342034566540081,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.2232936134800012,-1.163429305152226,1.8203348565681234,-1.2313360448785429,1.1074565407265085,-1.7093423514569264,-0.9078154994566392,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7585110515783027,1.565377477710182,2.027749458360845,-5.369019478696252,-0.3380358319830341,-0.9500514254177758,3.588791253857626,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7362390304804842,-1.2017843711210685,0.8926545968864157,1.2399265238688837,-0.050827310016290705,-1.198605392602416,-1.5046056364379843,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.6451221517395296,-2.0484424552178737,0.6171428263446541,6.422100778753815,-2.577636468051222,-1.4890401115179508,-3.785907231054817,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.765086441069906,0.3886895405231462,2.731661900411207,-1.3069068417000809,-0.19766973479399452,1.6879242979289697,-1.449585901495793,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.18985291006333638,-1.0740273879437814,1.2843531782256652,2.9867201516109323,-2.853724333474166,-1.267483825267256,-0.9631441174041762,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.9871628788591412,1.8534178483912092,-1.2805384917990295,-1.092147064487189,1.0822665318842248,0.4024378429492361,0.6510218029229897,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.3717600489367091,0.7167856864650772,-0.7499821639105004,-2.1169534465406232,-0.870825637391141,-0.7319917041438911,3.6275089929559368,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.34781014325513526,-0.42631045215441477,2.276403265265107,-1.7872802807090558,0.6460091472975253,-0.6707279710261537,-0.7145197261034959,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.6978341324237667,0.44583514954616277,2.5487409237553997,-3.883754805256149,-0.5331862190361614,-1.3497349443383184,2.16910621644326,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.42196177110466704,2.16561337972615,1.3262059312894516,-5.6286300261936,-0.08711234527451972,0.5828901807272211,3.841164934415239,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.16389008844843,1.2429168032114994,1.1288227844364782,-0.8914746299219967,-0.12326393212364906,1.7336169885979524,-0.6957687675851021,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.97426704102067,-0.06480324801411252,1.2488895732194991,1.6784228029603945,-2.2987446544566623,0.42970828101052566,-0.7140097535913854,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706) DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LogisticRegressionState(400, 2, 2.0)(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; +create table test.model engine = Memory as select LogisticRegressionState(0.005, 2, 2.0)(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; with (select state from test.model) as model select evalMLMethod(model, predict1, predict2, predict3, predict4, predict5, predict6, predict7) from test.defaults; From f89d0264fc7882c79dd66120fdb200b6fb41abb7 Mon Sep 17 00:00:00 2001 From: Masha Date: Fri, 15 Feb 2019 23:41:50 +0000 Subject: [PATCH 019/194] message with description --- dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference b/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference index edd49736ac8..a760c5b44b6 100644 --- a/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference +++ b/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference @@ -1 +1 @@ -0.6703296703296704 +0.7692307692307693 From 67b28c224053c2867c25cd1d7582d3776d9bb511 Mon Sep 17 00:00:00 2001 From: Masha Date: Tue, 26 Feb 2019 08:12:16 +0000 Subject: [PATCH 020/194] Nesterov and Adam + tests --- .../AggregateFunctionMLMethod.cpp | 6 + .../AggregateFunctionMLMethod.h | 110 +++++++++++++++++- .../0_stateless/00954_ml_test.reference | 1 + .../queries/0_stateless/00954_ml_test.sql | 17 +++ .../0_stateless/00955_ml_test.reference | 1 + .../queries/0_stateless/00955_ml_test.sql | 17 +++ 6 files changed, 150 insertions(+), 2 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00954_ml_test.reference create mode 100644 dbms/tests/queries/0_stateless/00954_ml_test.sql create mode 100644 dbms/tests/queries/0_stateless/00955_ml_test.reference create mode 100644 dbms/tests/queries/0_stateless/00955_ml_test.sql diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 04d31f918d0..814f60f544c 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -61,6 +61,12 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{2.0}) { wu = std::make_shared(); + } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{3.0}) + { + wu = std::make_shared(); + } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{4.0}) + { + wu = std::make_shared(); } else { throw Exception("Such weights updater is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 4394d508846..d815313a67c 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -210,6 +210,9 @@ public: virtual void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & gradient) = 0; virtual void merge(const IWeightsUpdater &, Float64, Float64) {} + virtual std::vector get_update(UInt32 sz, UInt32) { + return std::vector(sz, 0.0); + } }; class StochasticGradientDescent : public IWeightsUpdater @@ -260,6 +263,100 @@ private: Float64 alpha_{0.1}; std::vector accumulated_gradient; }; +class Nesterov : public IWeightsUpdater +{ +public: + Nesterov() {} + Nesterov (Float64 alpha) : alpha_(alpha) {} + void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + if (accumulated_gradient.size() == 0) + { + accumulated_gradient.resize(batch_gradient.size(), Float64{0.0}); + } + for (size_t i = 0; i < batch_gradient.size(); ++i) + { + accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i]; + } + for (size_t i = 0; i < weights.size(); ++i) + { + weights[i] += accumulated_gradient[i] / batch_size; + } + bias += accumulated_gradient[weights.size()] / batch_size; + std::cout<<"BIAS " << bias<<'\n'; + } + virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override { + auto & nesterov_rhs = static_cast(rhs); + for (size_t i = 0; i < accumulated_gradient.size(); ++i) + { + accumulated_gradient[i] = accumulated_gradient[i] * frac + nesterov_rhs.accumulated_gradient[i] * rhs_frac; + } + } + virtual std::vector get_update(UInt32 sz, UInt32 batch_size) override { + if (accumulated_gradient.size() == 0) + { + accumulated_gradient.resize(sz, Float64{0.0}); + return accumulated_gradient; + } + std::vector delta(accumulated_gradient.size()); + // std::cout<<"\n\nHK\n\n"; + for (size_t i = 0; i < delta.size(); ++i) + { + delta[i] = accumulated_gradient[i] * alpha_ / batch_size; + } + return delta; + } + +Float64 alpha_{0.1}; +std::vector accumulated_gradient; +}; +class Adam : public IWeightsUpdater +{ +public: + Adam() {} + Adam (Float64 betta1, Float64 betta2) : betta1_(betta1), betta2_(betta2), betta1t_(betta1), betta2t_(betta2) {} + void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + if (mt_.size() == 0) + { + mt_.resize(batch_gradient.size(), Float64{0.0}); + vt_.resize(batch_gradient.size(), Float64{0.0}); + } + Float64 eps = 0.01; + for (size_t i = 0; i < batch_gradient.size(); ++i) + { + mt_[i] = mt_[i] * betta1_ + (1 - betta1_) * batch_gradient[i]; + vt_[i] = vt_[i] * betta2_ + (1 - betta2_) * batch_gradient[i] * batch_gradient[i]; + if (t < 8) { + mt_[i] = mt_[i] / (1 - betta1t_); + betta1t_ *= betta1_; + } + if (t < 850) { + vt_[i] = vt_[i] / (1 - betta2t_); + betta2t_ *= betta2_; + } + } + for (size_t i = 0; i < weights.size(); ++i) + { + weights[i] += (mt_[i] / (sqrt(vt_[i] + eps))) / cur_batch; + } + bias += (mt_[weights.size()] / (sqrt(vt_[weights.size()] + eps))) / cur_batch; + t += 1; + } + virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override { + auto & adam_rhs = static_cast(rhs); + for (size_t i = 0; i < mt_.size(); ++i) + { + mt_[i] = mt_[i] * frac + adam_rhs.mt_[i] * rhs_frac; + vt_[i] = vt_[i] * frac + adam_rhs.vt_[i] * rhs_frac; + } + } +Float64 betta1_{0.2}; +Float64 betta2_{0.3}; +Float64 betta1t_{0.3}; +Float64 betta2t_{0.3}; +UInt32 t = 0; +std::vector mt_; +std::vector vt_; +}; class LinearModelData { @@ -285,8 +382,16 @@ public: { /// first column stores target; features start from (columns + 1) const auto & target = static_cast &>(*columns[0]).getData()[row_num]; - - gradient_computer->compute(weights, bias, learning_rate, target, columns + 1, row_num); + + auto delta = weights_updater->get_update(weights.size() + 1, batch_capacity); + Float64 delta_bias = bias + delta[weights.size()]; + delta.resize(weights.size()); + for (size_t i = 0; i < weights.size(); ++i) { + delta[i] += weights[i]; + } + + gradient_computer->compute(delta, delta_bias, learning_rate, target, columns + 1, row_num); + // gradient_computer->compute(weights, bias, learning_rate, target, columns + 1, row_num); ++batch_size; if (batch_size == batch_capacity) { @@ -369,6 +474,7 @@ private: batch_size = 0; ++iter_num; gradient_computer->reset(); + //TODO ask: для нестерова и адама не очень. Нужно добавить другую функцию } }; diff --git a/dbms/tests/queries/0_stateless/00954_ml_test.reference b/dbms/tests/queries/0_stateless/00954_ml_test.reference new file mode 100644 index 00000000000..8575e00f538 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00954_ml_test.reference @@ -0,0 +1 @@ +-66.98005053600168 diff --git a/dbms/tests/queries/0_stateless/00954_ml_test.sql b/dbms/tests/queries/0_stateless/00954_ml_test.sql new file mode 100644 index 00000000000..b1bce54036f --- /dev/null +++ b/dbms/tests/queries/0_stateless/00954_ml_test.sql @@ -0,0 +1,17 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults +( + param1 Float64, + param2 Float64, + target Float64, + predict1 Float64, + predict2 Float64 +) ENGINE = Memory; +insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); + +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 3.0)(target, param1, param2) as state from test.defaults; + + +with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00955_ml_test.reference b/dbms/tests/queries/0_stateless/00955_ml_test.reference new file mode 100644 index 00000000000..8d19c2c21f6 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00955_ml_test.reference @@ -0,0 +1 @@ +-70.73127165094067 diff --git a/dbms/tests/queries/0_stateless/00955_ml_test.sql b/dbms/tests/queries/0_stateless/00955_ml_test.sql new file mode 100644 index 00000000000..fb919e5aa57 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00955_ml_test.sql @@ -0,0 +1,17 @@ +CREATE DATABASE IF NOT EXISTS test; +DROP TABLE IF EXISTS test.defaults; +CREATE TABLE IF NOT EXISTS test.defaults +( + param1 Float64, + param2 Float64, + target Float64, + predict1 Float64, + predict2 Float64 +) ENGINE = Memory; +insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); + +DROP TABLE IF EXISTS test.model; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 4.0)(target, param1, param2) as state from test.defaults; + + +with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; From 3fa972e6b676373acd397eb57823cbc482c88ef8 Mon Sep 17 00:00:00 2001 From: quid Date: Sun, 3 Mar 2019 11:46:36 +0300 Subject: [PATCH 021/194] changes in weights updater --- .../AggregateFunctionMLMethod.cpp | 8 +- .../AggregateFunctionMLMethod.h | 488 ++++++++++++------ .../queries/0_stateless/00950_ml_test.sql | 2 +- .../queries/0_stateless/00954_ml_test.sql | 2 +- .../queries/0_stateless/00955_ml_test.sql | 2 +- 5 files changed, 343 insertions(+), 159 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 814f60f544c..4a8d7a43172 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -42,7 +42,6 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } - /// Gradient_Computer for LinearRegression has LinearRegression gradient computer if (std::is_same::value) { gc = std::make_shared(argument_types.size()); @@ -64,11 +63,12 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{3.0}) { wu = std::make_shared(); + } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{4.0}) { - wu = std::make_shared(); - } else - { + /// Adam should be here + wu = std::make_shared(); + } else { throw Exception("Such weights updater is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } } else diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index d815313a67c..c295679fab4 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -29,52 +29,66 @@ namespace ErrorCodes extern const int BAD_ARGUMENTS; } +/** +IGradientComputer class computes gradient according to its loss function +and stores mini-batch +*/ class IGradientComputer { public: - IGradientComputer(UInt32 sz) - : batch_gradient(sz, 0) - {} + IGradientComputer(UInt32 sz) { std::ignore = sz;// : batch_gradient(sz, 0) { + } + virtual ~IGradientComputer() = default; - virtual void compute(const std::vector & weights, Float64 bias, Float64 learning_rate, - Float64 target, const IColumn ** columns, size_t row_num) = 0; + /// Adds to batch_gradient computed gradient in point (weigts, bias) using corresponding loss function + virtual void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, + Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) = 0; - void reset() - { - batch_gradient.assign(batch_gradient.size(), 0); - } +// void reset() +// { +// batch_gradient.assign(batch_gradient.size(), 0); +// } - void write(WriteBuffer & buf) const - { - writeBinary(batch_gradient, buf); - } +// void write(WriteBuffer &buf) const +// { +// writeBinary(batch_gradient, buf); +// } +// +// void read(ReadBuffer &buf) +// { +// readBinary(batch_gradient, buf); +// } - void read(ReadBuffer & buf) - { - readBinary(batch_gradient, buf); - } +// const std::vector &get() const +// { +// return batch_gradient; +// } - const std::vector & get() const - { - return batch_gradient; - } - virtual Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const = 0; - virtual void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const = 0; + virtual Float64 predict(const std::vector &predict_feature, + const std::vector &weights, + Float64 bias) const = 0; -protected: - std::vector batch_gradient; // gradient for bias lies in batch_gradient[batch_gradient.size() - 1] + /// Now we should use predict_for_all function instead of predict + virtual void predict_for_all(ColumnVector::Container &container, + Block &block, const ColumnNumbers &arguments, + const std::vector &weights, + Float64 bias) const = 0; + +//protected: +// std::vector batch_gradient; // gradient for bias lies in batch_gradient[batch_gradient.size() - 1] }; + class LinearRegression : public IGradientComputer { public: LinearRegression(UInt32 sz) - : IGradientComputer(sz) - {} + : IGradientComputer(sz) { + } - void compute(const std::vector & weights, Float64 bias, Float64 learning_rate, - Float64 target, const IColumn ** columns, size_t row_num) override + void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, + Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) override { Float64 derivative = (target - bias); for (size_t i = 0; i < weights.size(); ++i) @@ -83,20 +97,19 @@ public: } derivative *= (2 * learning_rate); - batch_gradient[weights.size()] += derivative; + (*batch_gradient)[weights.size()] += derivative; for (size_t i = 0; i < weights.size(); ++i) { - batch_gradient[i] += derivative * static_cast &>(*columns[i]).getData()[row_num];; + (*batch_gradient)[i] += + derivative * static_cast &>(*columns[i]).getData()[row_num]; } } - Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const override + + Float64 predict(const std::vector &predict_feature, + const std::vector &weights, Float64 bias) const override { /// не обновляем веса при предикте, т.к. это может замедлить предсказание /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче -// if (cur_batch) -// { -// update_weights(); -// } Float64 res{0.0}; for (size_t i = 0; i < predict_feature.size(); ++i) @@ -107,7 +120,11 @@ public: return res; } - void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override + + void predict_for_all(ColumnVector::Container &container, + Block &block, + const ColumnNumbers &arguments, + const std::vector &weights, Float64 bias) const override { size_t rows_num = block.rows(); std::vector results(rows_num, bias); @@ -134,6 +151,7 @@ public: } }; + class LogisticRegression : public IGradientComputer { public: @@ -141,31 +159,32 @@ public: : IGradientComputer(sz) {} - void compute(const std::vector & weights, Float64 bias, Float64 learning_rate, - Float64 target, const IColumn ** columns, size_t row_num) override + void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, + Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) override { Float64 derivative = bias; for (size_t i = 0; i < weights.size(); ++i) { - derivative += weights[i] * static_cast &>(*columns[i]).getData()[row_num];; + derivative += weights[i] * static_cast &>(*columns[i]).getData()[row_num]; } derivative *= target; - derivative = exp(derivative); + derivative = exp(derivative); - batch_gradient[weights.size()] += learning_rate * target / (derivative + 1);; + (*batch_gradient)[weights.size()] += learning_rate * target / (derivative + 1);; for (size_t i = 0; i < weights.size(); ++i) { - batch_gradient[i] += learning_rate * target / (derivative + 1) * static_cast &>(*columns[i]).getData()[row_num]; + (*batch_gradient)[i] += + learning_rate * target * + static_cast &>(*columns[i]).getData()[row_num] + / (derivative + 1); } } - Float64 predict(const std::vector & predict_feature, const std::vector & weights, Float64 bias) const override + + Float64 predict(const std::vector &predict_feature, + const std::vector &weights, Float64 bias) const override { /// не обновляем веса при предикте, т.к. это может замедлить предсказание /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче -// if (cur_batch) -// { -// update_weights(); -// } Float64 res{0.0}; for (size_t i = 0; i < predict_feature.size(); ++i) @@ -176,7 +195,11 @@ public: res = 1 / (1 + exp(-res)); return res; } - void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override + + void predict_for_all(ColumnVector::Container & container, + Block & block, + const ColumnNumbers & arguments, + const std::vector & weights, Float64 bias) const override { size_t rows_num = block.rows(); std::vector results(rows_num, bias); @@ -186,7 +209,6 @@ public: ColumnPtr cur_col = block.getByPosition(arguments[i]).column; for (size_t row_num = 0; row_num != rows_num; ++row_num) { - const auto &element = (*cur_col)[row_num]; if (element.getType() != Field::Types::Float64) throw Exception("Prediction arguments must be values of type Float", @@ -197,124 +219,226 @@ public: } for (size_t row_num = 0; row_num != rows_num; ++row_num) { - results[row_num] = 1 / (1 + exp(-results[row_num])); - container.emplace_back(results[row_num]); + container.emplace_back(1 / (1 + exp(-results[row_num]))); } } }; + +/** +* IWeightsUpdater class defines the way to update current state +* and uses GradientComputer on each iteration +*/ class IWeightsUpdater { public: virtual ~IWeightsUpdater() = default; - virtual void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & gradient) = 0; - virtual void merge(const IWeightsUpdater &, Float64, Float64) {} - virtual std::vector get_update(UInt32 sz, UInt32) { - return std::vector(sz, 0.0); + virtual void add_to_batch(std::vector * batch_gradient, std::shared_ptr gc, + const std::vector & weights, Float64 bias, + Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) + { + gc->compute(batch_gradient, weights, bias, learning_rate, target, columns, row_num); } + + virtual void update(UInt32 batch_size, + std::vector & weights, Float64 & bias, + const std::vector & gradient) = 0; + + virtual void merge(const IWeightsUpdater &, Float64, Float64) + {} + + virtual void write(WriteBuffer &) const + {} + + virtual void read(ReadBuffer &) + {} +// virtual std::vector get_update(UInt32 sz, UInt32) +// { +// return std::vector(sz, 0.0); +// } }; + class StochasticGradientDescent : public IWeightsUpdater { public: - void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + void update(UInt32 batch_size, + std::vector & weights, Float64 & bias, + const std::vector & batch_gradient) override + { /// batch_size is already checked to be greater than 0 - for (size_t i = 0; i < weights.size(); ++i) { weights[i] += batch_gradient[i] / batch_size; } bias += batch_gradient[weights.size()] / batch_size; + +// batch_gradient->assign(batch_gradient->size(), Float64{0.0}); } }; + class Momentum : public IWeightsUpdater { public: - Momentum() {} - Momentum (Float64 alpha) : alpha_(alpha) {} - void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { - /// batch_size is already checked to be greater than 0 + Momentum() + {} - if (accumulated_gradient.size() == 0) + Momentum(Float64 alpha) : alpha_(alpha) + {} + + void update(UInt32 batch_size, + std::vector & weights, Float64 & bias, + const std::vector & batch_gradient) override + { + /// batch_size is already checked to be greater than 0 + if (accumulated_gradient.empty()) { accumulated_gradient.resize(batch_gradient.size(), Float64{0.0}); } + for (size_t i = 0; i < batch_gradient.size(); ++i) { - accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i]; + accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i] / batch_size; } for (size_t i = 0; i < weights.size(); ++i) { - weights[i] += accumulated_gradient[i] / batch_size; + weights[i] += accumulated_gradient[i]; } - bias += accumulated_gradient[weights.size()] / batch_size; + bias += accumulated_gradient[weights.size()]; } - virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override { - auto & momentum_rhs = static_cast(rhs); + + virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override + { + auto &momentum_rhs = static_cast(rhs); for (size_t i = 0; i < accumulated_gradient.size(); ++i) { - accumulated_gradient[i] = accumulated_gradient[i] * frac + momentum_rhs.accumulated_gradient[i] * rhs_frac; + accumulated_gradient[i] = accumulated_gradient[i] * frac + + momentum_rhs.accumulated_gradient[i] * rhs_frac; } } + void write(WriteBuffer &buf) const override + { + writeBinary(accumulated_gradient, buf); + } + + void read(ReadBuffer &buf) override + { + readBinary(accumulated_gradient, buf); + } + private: Float64 alpha_{0.1}; std::vector accumulated_gradient; }; + + class Nesterov : public IWeightsUpdater { public: - Nesterov() {} - Nesterov (Float64 alpha) : alpha_(alpha) {} - void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { - if (accumulated_gradient.size() == 0) + Nesterov() + {} + + Nesterov(Float64 alpha) : alpha_(alpha) + {} + + void add_to_batch(std::vector * batch_gradient, std::shared_ptr gc, + const std::vector & weights, Float64 bias, + Float64 learning_rate, Float64 target, const IColumn ** columns, size_t row_num) override + { + if (accumulated_gradient.empty()) + { + accumulated_gradient.resize(batch_gradient->size(), Float64{0.0}); + } + + std::vector shifted_weights(weights.size()); + for (size_t i = 0; i != shifted_weights.size(); ++i) + { + shifted_weights[i] = weights[i] + accumulated_gradient[i] * alpha_; + } + auto shifted_bias = bias + accumulated_gradient[weights.size()] * alpha_; + + gc->compute(batch_gradient, shifted_weights, shifted_bias, learning_rate, target, columns, row_num); + } + + void update(UInt32 batch_size, + std::vector & weights, Float64 & bias, + const std::vector & batch_gradient) override + { + if (accumulated_gradient.empty()) { accumulated_gradient.resize(batch_gradient.size(), Float64{0.0}); } + for (size_t i = 0; i < batch_gradient.size(); ++i) { - accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i]; + accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i] / batch_size; } for (size_t i = 0; i < weights.size(); ++i) { - weights[i] += accumulated_gradient[i] / batch_size; + weights[i] += accumulated_gradient[i]; } - bias += accumulated_gradient[weights.size()] / batch_size; - std::cout<<"BIAS " << bias<<'\n'; + bias += accumulated_gradient[weights.size()]; } - virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override { + + virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override + { auto & nesterov_rhs = static_cast(rhs); for (size_t i = 0; i < accumulated_gradient.size(); ++i) { - accumulated_gradient[i] = accumulated_gradient[i] * frac + nesterov_rhs.accumulated_gradient[i] * rhs_frac; + accumulated_gradient[i] = + accumulated_gradient[i] * frac + nesterov_rhs.accumulated_gradient[i] * rhs_frac; } } - virtual std::vector get_update(UInt32 sz, UInt32 batch_size) override { - if (accumulated_gradient.size() == 0) - { - accumulated_gradient.resize(sz, Float64{0.0}); - return accumulated_gradient; - } - std::vector delta(accumulated_gradient.size()); - // std::cout<<"\n\nHK\n\n"; - for (size_t i = 0; i < delta.size(); ++i) - { - delta[i] = accumulated_gradient[i] * alpha_ / batch_size; - } - return delta; - } -Float64 alpha_{0.1}; -std::vector accumulated_gradient; + void write(WriteBuffer &buf) const override + { + writeBinary(accumulated_gradient, buf); + } + + void read(ReadBuffer &buf) override + { + readBinary(accumulated_gradient, buf); + } +// virtual std::vector get_update(UInt32 sz, UInt32 batch_size) override +// { +// if (accumulated_gradient.size() == 0) +// { +// accumulated_gradient.resize(sz, Float64{0.0}); +// return accumulated_gradient; +// } +// std::vector delta(accumulated_gradient.size()); +// // std::cout<<"\n\nHK\n\n"; +// for (size_t i = 0; i < delta.size(); ++i) +// { +// delta[i] = accumulated_gradient[i] * alpha_ / batch_size; +// } +// return delta; +// } + +private: + Float64 alpha_{0.1}; + std::vector accumulated_gradient; }; + + +// TODO: проверить после изменения логики моментума +/* class Adam : public IWeightsUpdater { public: - Adam() {} - Adam (Float64 betta1, Float64 betta2) : betta1_(betta1), betta2_(betta2), betta1t_(betta1), betta2t_(betta2) {} - void update(UInt32 cur_batch, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override { + Adam() + {} + + Adam(Float64 betta1, Float64 betta2) : betta1_(betta1), betta2_(betta2), betta1t_(betta1), betta2t_(betta2) + {} + + void update(UInt32 cur_batch, + std::vector & weights, Float64 & bias, + std::vector * batch_gradient) override + { if (mt_.size() == 0) { mt_.resize(batch_gradient.size(), Float64{0.0}); @@ -325,11 +449,13 @@ public: { mt_[i] = mt_[i] * betta1_ + (1 - betta1_) * batch_gradient[i]; vt_[i] = vt_[i] * betta2_ + (1 - betta2_) * batch_gradient[i] * batch_gradient[i]; - if (t < 8) { + if (t < 8) + { mt_[i] = mt_[i] / (1 - betta1t_); betta1t_ *= betta1_; } - if (t < 850) { + if (t < 850) + { vt_[i] = vt_[i] / (1 - betta2t_); betta2t_ *= betta2_; } @@ -341,23 +467,33 @@ public: bias += (mt_[weights.size()] / (sqrt(vt_[weights.size()] + eps))) / cur_batch; t += 1; } - virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override { - auto & adam_rhs = static_cast(rhs); + + virtual void merge(const IWeightsUpdater &rhs, Float64 frac, Float64 rhs_frac) override + { + auto &adam_rhs = static_cast(rhs); for (size_t i = 0; i < mt_.size(); ++i) { mt_[i] = mt_[i] * frac + adam_rhs.mt_[i] * rhs_frac; vt_[i] = vt_[i] * frac + adam_rhs.vt_[i] * rhs_frac; } } -Float64 betta1_{0.2}; -Float64 betta2_{0.3}; -Float64 betta1t_{0.3}; -Float64 betta2t_{0.3}; -UInt32 t = 0; -std::vector mt_; -std::vector vt_; -}; +private: + Float64 betta1_{0.2}; + Float64 betta2_{0.3}; + Float64 betta1t_{0.3}; + Float64 betta2t_{0.3}; + UInt32 t = 0; + std::vector mt_; + std::vector vt_; +}; + */ + + +/** +* LinearModelData is a class which manages current state of learning +* and is stored as AggregateFunctionState +*/ class LinearModelData { public: @@ -365,33 +501,53 @@ public: {} LinearModelData(Float64 learning_rate, - UInt32 param_num, - UInt32 batch_capacity, - std::shared_ptr gc, - std::shared_ptr wu) - : learning_rate(learning_rate), - batch_capacity(batch_capacity), - gradient_computer(std::move(gc)), - weights_updater(std::move(wu)) + UInt32 param_num, + UInt32 batch_capacity, + std::shared_ptr gc, + std::shared_ptr wu) + : learning_rate(learning_rate), + batch_capacity(batch_capacity), + batch_size(0), + gradient_computer(std::move(gc)), + weights_updater(std::move(wu)) { weights.resize(param_num, Float64{0.0}); - batch_size = 0; + gradient_batch.resize(param_num + 1, Float64{0.0}); } - void add(const IColumn ** columns, size_t row_num) + void add(const IColumn **columns, size_t row_num) { /// first column stores target; features start from (columns + 1) - const auto & target = static_cast &>(*columns[0]).getData()[row_num]; - - auto delta = weights_updater->get_update(weights.size() + 1, batch_capacity); - Float64 delta_bias = bias + delta[weights.size()]; - delta.resize(weights.size()); - for (size_t i = 0; i < weights.size(); ++i) { - delta[i] += weights[i]; - } - - gradient_computer->compute(delta, delta_bias, learning_rate, target, columns + 1, row_num); - // gradient_computer->compute(weights, bias, learning_rate, target, columns + 1, row_num); + const auto &target = static_cast &>(*columns[0]).getData()[row_num]; + +// auto delta = weights_updater->get_update(weights.size() + 1, batch_capacity); +// Float64 delta_bias = bias + delta[weights.size()]; +// delta.resize(weights.size()); +// for (size_t i = 0; i < weights.size(); ++i) +// { +// delta[i] += weights[i]; +// } + +// gradient_computer->compute(delta, delta_bias, learning_rate, target, columns + 1, row_num); +// gradient_computer->compute(weights, bias, learning_rate, target, columns + 1, row_num); + std::cout << "\nBATCH BEFORE\n"; + for (auto i : gradient_batch) + std::cout << i << " "; + std::cout << "\nhello\n"; + + + weights_updater->add_to_batch(&gradient_batch, gradient_computer, + weights, bias, learning_rate, target, columns, row_num); + + + std::cout << "BATCH AFTER\n"; + for (auto i : gradient_batch) + std::cout << i << " "; + std::cout << "\nhello\n\n"; + + if (iter_num == 10) + exit(1); + ++batch_size; if (batch_size == batch_capacity) { @@ -399,7 +555,7 @@ public: } } - void merge(const LinearModelData & rhs) + void merge(const LinearModelData &rhs) { if (iter_num == 0 && rhs.iter_num == 0) return; @@ -421,63 +577,90 @@ public: weights_updater->merge(*rhs.weights_updater, frac, rhs_frac); } - void write(WriteBuffer & buf) const + void write(WriteBuffer &buf) const { writeBinary(bias, buf); writeBinary(weights, buf); writeBinary(iter_num, buf); + writeBinary(gradient_batch, buf); writeBinary(batch_size, buf); - gradient_computer->write(buf); + weights_updater->write(buf); +// gradient_computer->write(buf); } - void read(ReadBuffer & buf) + void read(ReadBuffer &buf) { readBinary(bias, buf); readBinary(weights, buf); readBinary(iter_num, buf); + readBinary(gradient_batch, buf); readBinary(batch_size, buf); - gradient_computer->read(buf); + weights_updater->read(buf); +// gradient_computer->read(buf); } - Float64 predict(const std::vector & predict_feature) const + Float64 predict(const std::vector &predict_feature) const { /// не обновляем веса при предикте, т.к. это может замедлить предсказание - /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче + /// однако можно например обновлять их при каждом мердже независимо от того, сколько элементнов в батче // if (cur_batch) // { // update_weights(); // } + std::cout << "\n\nWEIGHTS: "; + for (size_t i = 0; i != weights.size(); ++i) { + std::cout << weights[i] << " "; + } + std::cout << "\n\n"; + return gradient_computer->predict(predict_feature, weights, bias); } - void predict_for_all(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments) const + + void predict_for_all(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments) const { + std::cout << "\n\nWEIGHTS: "; + for (size_t i = 0; i != weights.size(); ++i) { + std::cout << weights[i] << " "; + } + std::cout << "\n\n"; + gradient_computer->predict_for_all(container, block, arguments, weights, bias); } private: std::vector weights; + Float64 bias{0.0}; + Float64 learning_rate; UInt32 batch_capacity; - Float64 bias{0.0}; + UInt32 iter_num = 0; + std::vector gradient_batch; UInt32 batch_size; + std::shared_ptr gradient_computer; std::shared_ptr weights_updater; + /** + * The function is called when we want to flush current batch and make a step with it + */ void update_state() { if (batch_size == 0) return; - weights_updater->update(batch_size, weights, bias, gradient_computer->get()); +// weights_updater->update(batch_size, weights, bias, gradient_batch); + + // /// use pointer to gradient_batch, because some methods (e.g. simple stochastic descent) require to reset it + weights_updater->update(batch_size, weights, bias, gradient_batch); batch_size = 0; ++iter_num; - gradient_computer->reset(); - //TODO ask: для нестерова и адама не очень. Нужно добавить другую функцию + gradient_batch.assign(gradient_batch.size(), Float64{0.0}); } }; + template < /// Implemented Machine Learning method typename Data, @@ -490,19 +673,19 @@ public: String getName() const override { return Name::name; } explicit AggregateFunctionMLMethod(UInt32 param_num, - std::shared_ptr gradient_computer, - std::shared_ptr weights_updater, - Float64 learning_rate, - UInt32 batch_size, - const DataTypes & argument_types, - const Array & params) + std::shared_ptr gradient_computer, + std::shared_ptr weights_updater, + Float64 learning_rate, + UInt32 batch_size, + const DataTypes & argument_types, + const Array & params) : IAggregateFunctionDataHelper>(argument_types, params), param_num(param_num), learning_rate(learning_rate), batch_size(batch_size), gc(std::move(gradient_computer)), - wu(std::move(weights_updater)) - {} + wu(std::move(weights_updater)) { + } DataTypePtr getReturnType() const override { @@ -538,7 +721,8 @@ public: void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments) const { if (arguments.size() != param_num + 1) - throw Exception("Predict got incorrect number of arguments. Got: " + std::to_string(arguments.size()) + ". Required: " + std::to_string(param_num + 1), + throw Exception("Predict got incorrect number of arguments. Got: " + + std::to_string(arguments.size()) + ". Required: " + std::to_string(param_num + 1), ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); auto &column = dynamic_cast &>(to); diff --git a/dbms/tests/queries/0_stateless/00950_ml_test.sql b/dbms/tests/queries/0_stateless/00950_ml_test.sql index 0a009c29d29..46f64a1f1dd 100644 --- a/dbms/tests/queries/0_stateless/00950_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00950_ml_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.01, 5, 1.0)(target, param1, param2) as state from test.defaults; with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00954_ml_test.sql b/dbms/tests/queries/0_stateless/00954_ml_test.sql index b1bce54036f..2df84c00d3f 100644 --- a/dbms/tests/queries/0_stateless/00954_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00954_ml_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 3.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00955_ml_test.sql b/dbms/tests/queries/0_stateless/00955_ml_test.sql index fb919e5aa57..2df84c00d3f 100644 --- a/dbms/tests/queries/0_stateless/00955_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00955_ml_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 4.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; From 6371b4021dadd2f5940356fa5e21b449f56c3848 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Sun, 3 Mar 2019 13:21:12 +0300 Subject: [PATCH 022/194] changes in gradient_computer class --- .../AggregateFunctionMLMethod.cpp | 4 +- .../AggregateFunctionMLMethod.h | 111 ++---------------- .../queries/0_stateless/00950_ml_test.sql | 2 +- .../queries/0_stateless/00951_ml_test.sql | 2 +- .../queries/0_stateless/00954_ml_test.sql | 2 +- 5 files changed, 17 insertions(+), 104 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 4a8d7a43172..bd3aa51c2e2 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -44,10 +44,10 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (std::is_same::value) { - gc = std::make_shared(argument_types.size()); + gc = std::make_shared(); } else if (std::is_same::value) { - gc = std::make_shared(argument_types.size()); + gc = std::make_shared(); } else { throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index c295679fab4..2fd4c7cc3f2 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -36,8 +36,8 @@ and stores mini-batch class IGradientComputer { public: - IGradientComputer(UInt32 sz) { std::ignore = sz;// : batch_gradient(sz, 0) { - } + IGradientComputer() + {} virtual ~IGradientComputer() = default; @@ -45,26 +45,6 @@ public: virtual void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) = 0; -// void reset() -// { -// batch_gradient.assign(batch_gradient.size(), 0); -// } - -// void write(WriteBuffer &buf) const -// { -// writeBinary(batch_gradient, buf); -// } -// -// void read(ReadBuffer &buf) -// { -// readBinary(batch_gradient, buf); -// } - -// const std::vector &get() const -// { -// return batch_gradient; -// } - virtual Float64 predict(const std::vector &predict_feature, const std::vector &weights, Float64 bias) const = 0; @@ -74,18 +54,14 @@ public: Block &block, const ColumnNumbers &arguments, const std::vector &weights, Float64 bias) const = 0; - -//protected: -// std::vector batch_gradient; // gradient for bias lies in batch_gradient[batch_gradient.size() - 1] }; class LinearRegression : public IGradientComputer { public: - LinearRegression(UInt32 sz) - : IGradientComputer(sz) { - } + LinearRegression() + {} void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) override @@ -155,8 +131,7 @@ public: class LogisticRegression : public IGradientComputer { public: - LogisticRegression(UInt32 sz) - : IGradientComputer(sz) + LogisticRegression() {} void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, @@ -253,10 +228,6 @@ public: virtual void read(ReadBuffer &) {} -// virtual std::vector get_update(UInt32 sz, UInt32) -// { -// return std::vector(sz, 0.0); -// } }; @@ -273,8 +244,6 @@ public: weights[i] += batch_gradient[i] / batch_size; } bias += batch_gradient[weights.size()] / batch_size; - -// batch_gradient->assign(batch_gradient->size(), Float64{0.0}); } }; @@ -402,21 +371,6 @@ public: { readBinary(accumulated_gradient, buf); } -// virtual std::vector get_update(UInt32 sz, UInt32 batch_size) override -// { -// if (accumulated_gradient.size() == 0) -// { -// accumulated_gradient.resize(sz, Float64{0.0}); -// return accumulated_gradient; -// } -// std::vector delta(accumulated_gradient.size()); -// // std::cout<<"\n\nHK\n\n"; -// for (size_t i = 0; i < delta.size(); ++i) -// { -// delta[i] = accumulated_gradient[i] * alpha_ / batch_size; -// } -// return delta; -// } private: Float64 alpha_{0.1}; @@ -505,11 +459,11 @@ public: UInt32 batch_capacity, std::shared_ptr gc, std::shared_ptr wu) - : learning_rate(learning_rate), - batch_capacity(batch_capacity), - batch_size(0), - gradient_computer(std::move(gc)), - weights_updater(std::move(wu)) + : learning_rate(learning_rate), + batch_capacity(batch_capacity), + batch_size(0), + gradient_computer(std::move(gc)), + weights_updater(std::move(wu)) { weights.resize(param_num, Float64{0.0}); gradient_batch.resize(param_num + 1, Float64{0.0}); @@ -520,33 +474,9 @@ public: /// first column stores target; features start from (columns + 1) const auto &target = static_cast &>(*columns[0]).getData()[row_num]; -// auto delta = weights_updater->get_update(weights.size() + 1, batch_capacity); -// Float64 delta_bias = bias + delta[weights.size()]; -// delta.resize(weights.size()); -// for (size_t i = 0; i < weights.size(); ++i) -// { -// delta[i] += weights[i]; -// } - -// gradient_computer->compute(delta, delta_bias, learning_rate, target, columns + 1, row_num); -// gradient_computer->compute(weights, bias, learning_rate, target, columns + 1, row_num); - std::cout << "\nBATCH BEFORE\n"; - for (auto i : gradient_batch) - std::cout << i << " "; - std::cout << "\nhello\n"; - - + /// Here we have columns + 1 as first column corresponds to target value, and others - to features weights_updater->add_to_batch(&gradient_batch, gradient_computer, - weights, bias, learning_rate, target, columns, row_num); - - - std::cout << "BATCH AFTER\n"; - for (auto i : gradient_batch) - std::cout << i << " "; - std::cout << "\nhello\n\n"; - - if (iter_num == 10) - exit(1); + weights, bias, learning_rate, target, columns + 1, row_num); ++batch_size; if (batch_size == batch_capacity) @@ -585,7 +515,6 @@ public: writeBinary(gradient_batch, buf); writeBinary(batch_size, buf); weights_updater->write(buf); -// gradient_computer->write(buf); } void read(ReadBuffer &buf) @@ -596,7 +525,6 @@ public: readBinary(gradient_batch, buf); readBinary(batch_size, buf); weights_updater->read(buf); -// gradient_computer->read(buf); } Float64 predict(const std::vector &predict_feature) const @@ -608,23 +536,11 @@ public: // update_weights(); // } - std::cout << "\n\nWEIGHTS: "; - for (size_t i = 0; i != weights.size(); ++i) { - std::cout << weights[i] << " "; - } - std::cout << "\n\n"; - return gradient_computer->predict(predict_feature, weights, bias); } void predict_for_all(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments) const { - std::cout << "\n\nWEIGHTS: "; - for (size_t i = 0; i != weights.size(); ++i) { - std::cout << weights[i] << " "; - } - std::cout << "\n\n"; - gradient_computer->predict_for_all(container, block, arguments, weights, bias); } @@ -650,9 +566,6 @@ private: if (batch_size == 0) return; -// weights_updater->update(batch_size, weights, bias, gradient_batch); - - // /// use pointer to gradient_batch, because some methods (e.g. simple stochastic descent) require to reset it weights_updater->update(batch_size, weights, bias, gradient_batch); batch_size = 0; ++iter_num; diff --git a/dbms/tests/queries/0_stateless/00950_ml_test.sql b/dbms/tests/queries/0_stateless/00950_ml_test.sql index 46f64a1f1dd..0a009c29d29 100644 --- a/dbms/tests/queries/0_stateless/00950_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00950_ml_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.01, 5, 1.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00951_ml_test.sql b/dbms/tests/queries/0_stateless/00951_ml_test.sql index ca9c2f99505..3bce8cc3085 100644 --- a/dbms/tests/queries/0_stateless/00951_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00951_ml_test.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS test.defaults predict1 Float64, predict2 Float64 ) ENGINE = Memory; -insert into test.defaults values (1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2),(1,2,1,-1,-2),(-1,-2,0,1,2) +insert into test.defaults values (1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2) DROP TABLE IF EXISTS test.model; create table test.model engine = Memory as select LogisticRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00954_ml_test.sql b/dbms/tests/queries/0_stateless/00954_ml_test.sql index 2df84c00d3f..932924672d6 100644 --- a/dbms/tests/queries/0_stateless/00954_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00954_ml_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.01, 1, 2.0)(target, param1, param2) as state from test.defaults; with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; From 521e897a92bff165c0f2a79e3517dff107fd10cc Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Sat, 9 Mar 2019 21:24:11 +0300 Subject: [PATCH 023/194] init --- dbms/src/Storages/StorageMergeTree.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index ba3fe04dd89..10b9b9d51b6 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include #include #include @@ -224,11 +226,29 @@ void StorageMergeTree::alter( auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); auto columns_for_parts = new_columns.getAllPhysical(); std::vector transactions; - for (const MergeTreeData::DataPartPtr & part : parts) + + ThreadPool thread_pool(2 * getNumberOfPhysicalCPUCores()); + size_t i = 0; + transactions.resize(parts.size()); + for (const auto & part : parts) { - if (auto transaction = data.alterDataPart(part, columns_for_parts, new_indices.indices, false)) - transactions.push_back(std::move(transaction)); + thread_pool.schedule( + [this, i, &transactions, &part, columns_for_parts, new_indices = new_indices.indices] { + if (auto transaction = this->data.alterDataPart(part, columns_for_parts, new_indices, false)) + transactions[i] = (std::move(transaction)); + } + ); + + ++i; } + thread_pool.wait(); + transactions.erase( + std::remove_if(transactions.begin(), transactions.end(), + [](const MergeTreeData::AlterDataPartTransactionPtr& transaction) { + return transaction == nullptr; + } + ) + ); auto table_hard_lock = lockStructureForAlter(context.getCurrentQueryId()); From c3182d4ae690e5f51e3a1e6de3f6c14cea3f0bd4 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Sun, 10 Mar 2019 22:47:26 +0300 Subject: [PATCH 024/194] fix erase --- dbms/src/Storages/StorageMergeTree.cpp | 62 +++++++++++++++----------- dbms/src/Storages/StorageMergeTree.h | 3 ++ 2 files changed, 38 insertions(+), 27 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 10b9b9d51b6..a1fa2426249 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -193,6 +193,38 @@ void StorageMergeTree::rename(const String & new_path_to_db, const String & /*ne } +std::vector StorageMergeTree::prepare_alter_transactions( + const ColumnsDescription& new_columns, const IndicesDescription& new_indices, const size_t thread_pool_size) +{ + ThreadPool thread_pool(thread_pool_size); + + auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); + std::vector transactions(parts.size()); + const auto& columns_for_parts = new_columns.getAllPhysical(); + size_t i = 0; + for (const auto & part : parts) + { + thread_pool.schedule( + [this, i, &transactions, &part, columns_for_parts, new_indices = new_indices.indices] + { + if (auto transaction = this->data.alterDataPart(part, columns_for_parts, new_indices, false)) + transactions[i] = (std::move(transaction)); + } + ); + + ++i; + } + thread_pool.wait(); + auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), + [](const MergeTreeData::AlterDataPartTransactionPtr& transaction) { + return transaction == nullptr; + } + ); + transactions.erase(erase_pos, transactions.end()); + + return transactions; +} + void StorageMergeTree::alter( const AlterCommands & params, const String & current_database_name, @@ -223,32 +255,8 @@ void StorageMergeTree::alter( ASTPtr new_primary_key_ast = data.primary_key_ast; params.apply(new_columns, new_indices, new_order_by_ast, new_primary_key_ast); - auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); - auto columns_for_parts = new_columns.getAllPhysical(); - std::vector transactions; - - ThreadPool thread_pool(2 * getNumberOfPhysicalCPUCores()); - size_t i = 0; - transactions.resize(parts.size()); - for (const auto & part : parts) - { - thread_pool.schedule( - [this, i, &transactions, &part, columns_for_parts, new_indices = new_indices.indices] { - if (auto transaction = this->data.alterDataPart(part, columns_for_parts, new_indices, false)) - transactions[i] = (std::move(transaction)); - } - ); - - ++i; - } - thread_pool.wait(); - transactions.erase( - std::remove_if(transactions.begin(), transactions.end(), - [](const MergeTreeData::AlterDataPartTransactionPtr& transaction) { - return transaction == nullptr; - } - ) - ); + std::vector transactions = prepare_alter_transactions(new_columns, new_indices, + 2 * getNumberOfPhysicalCPUCores()); auto table_hard_lock = lockStructureForAlter(context.getCurrentQueryId()); @@ -269,7 +277,7 @@ void StorageMergeTree::alter( data.setPrimaryKeyIndicesAndColumns(new_order_by_ast, new_primary_key_ast, new_columns, new_indices); for (auto & transaction : transactions) - transaction->commit(); + transaction->commit(); /// Columns sizes could be changed data.recalculateColumnSizes(); diff --git a/dbms/src/Storages/StorageMergeTree.h b/dbms/src/Storages/StorageMergeTree.h index d17b496bd97..36b6cb9fc36 100644 --- a/dbms/src/Storages/StorageMergeTree.h +++ b/dbms/src/Storages/StorageMergeTree.h @@ -132,6 +132,9 @@ private: BackgroundProcessingPool::TaskHandle background_task_handle; + std::vector prepare_alter_transactions( + const ColumnsDescription& new_columns, const IndicesDescription& new_indices, const size_t thread_pool_size); + void loadMutations(); /** Determines what parts should be merged and merges it. From 6acb39032ff072bc3771f0d7293456964fcbe5ca Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Mon, 11 Mar 2019 23:17:50 +0300 Subject: [PATCH 025/194] format --- dbms/src/Storages/StorageMergeTree.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index a1fa2426249..363718badf0 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -200,7 +200,9 @@ std::vector StorageMergeTree::prepar auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); std::vector transactions(parts.size()); + const auto& columns_for_parts = new_columns.getAllPhysical(); + size_t i = 0; for (const auto & part : parts) { @@ -215,6 +217,7 @@ std::vector StorageMergeTree::prepar ++i; } thread_pool.wait(); + auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), [](const MergeTreeData::AlterDataPartTransactionPtr& transaction) { return transaction == nullptr; @@ -255,8 +258,7 @@ void StorageMergeTree::alter( ASTPtr new_primary_key_ast = data.primary_key_ast; params.apply(new_columns, new_indices, new_order_by_ast, new_primary_key_ast); - std::vector transactions = prepare_alter_transactions(new_columns, new_indices, - 2 * getNumberOfPhysicalCPUCores()); + auto transactions = prepare_alter_transactions(new_columns, new_indices, 2 * getNumberOfPhysicalCPUCores()); auto table_hard_lock = lockStructureForAlter(context.getCurrentQueryId()); From 3f01882310f0755abd61d8d459eac942fe136ab5 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Tue, 12 Mar 2019 08:56:02 +0300 Subject: [PATCH 026/194] format2 --- dbms/src/Storages/StorageMergeTree.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 363718badf0..a7a618873a8 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -219,7 +219,8 @@ std::vector StorageMergeTree::prepar thread_pool.wait(); auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), - [](const MergeTreeData::AlterDataPartTransactionPtr& transaction) { + [](const MergeTreeData::AlterDataPartTransactionPtr& transaction) + { return transaction == nullptr; } ); From 6daee801fafd2f45360408a735233818aa4594b2 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 12 Mar 2019 16:24:03 +0300 Subject: [PATCH 027/194] Update StorageMergeTree.cpp --- dbms/src/Storages/StorageMergeTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index a7a618873a8..ab176cae64d 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -280,7 +280,7 @@ void StorageMergeTree::alter( data.setPrimaryKeyIndicesAndColumns(new_order_by_ast, new_primary_key_ast, new_columns, new_indices); for (auto & transaction : transactions) - transaction->commit(); + transaction->commit(); /// Columns sizes could be changed data.recalculateColumnSizes(); From 72f785bd1db0788b3ae4e1e4b272c54db66665fc Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 12 Mar 2019 16:24:56 +0300 Subject: [PATCH 028/194] Update StorageMergeTree.cpp --- dbms/src/Storages/StorageMergeTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index ab176cae64d..dbfa02b2869 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -194,7 +194,7 @@ void StorageMergeTree::rename(const String & new_path_to_db, const String & /*ne std::vector StorageMergeTree::prepare_alter_transactions( - const ColumnsDescription& new_columns, const IndicesDescription& new_indices, const size_t thread_pool_size) + const ColumnsDescription & new_columns, const IndicesDescription & new_indices, const size_t thread_pool_size) { ThreadPool thread_pool(thread_pool_size); From fc3cb57881e85cbc96643ab71237bbd6d9591fad Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 12 Mar 2019 16:26:26 +0300 Subject: [PATCH 029/194] Update StorageMergeTree.cpp --- dbms/src/Storages/StorageMergeTree.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index dbfa02b2869..90a50ce80f8 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -193,7 +193,7 @@ void StorageMergeTree::rename(const String & new_path_to_db, const String & /*ne } -std::vector StorageMergeTree::prepare_alter_transactions( +std::vector StorageMergeTree::prepareAlterTransactions( const ColumnsDescription & new_columns, const IndicesDescription & new_indices, const size_t thread_pool_size) { ThreadPool thread_pool(thread_pool_size); @@ -201,7 +201,7 @@ std::vector StorageMergeTree::prepar auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); std::vector transactions(parts.size()); - const auto& columns_for_parts = new_columns.getAllPhysical(); + const auto & columns_for_parts = new_columns.getAllPhysical(); size_t i = 0; for (const auto & part : parts) @@ -210,7 +210,7 @@ std::vector StorageMergeTree::prepar [this, i, &transactions, &part, columns_for_parts, new_indices = new_indices.indices] { if (auto transaction = this->data.alterDataPart(part, columns_for_parts, new_indices, false)) - transactions[i] = (std::move(transaction)); + transactions[i] = std::move(transaction); } ); @@ -219,7 +219,7 @@ std::vector StorageMergeTree::prepar thread_pool.wait(); auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), - [](const MergeTreeData::AlterDataPartTransactionPtr& transaction) + [](const MergeTreeData::AlterDataPartTransactionPtr & transaction) { return transaction == nullptr; } @@ -259,7 +259,7 @@ void StorageMergeTree::alter( ASTPtr new_primary_key_ast = data.primary_key_ast; params.apply(new_columns, new_indices, new_order_by_ast, new_primary_key_ast); - auto transactions = prepare_alter_transactions(new_columns, new_indices, 2 * getNumberOfPhysicalCPUCores()); + auto transactions = prepareAlterTransactions(new_columns, new_indices, 2 * getNumberOfPhysicalCPUCores()); auto table_hard_lock = lockStructureForAlter(context.getCurrentQueryId()); From 24d0315f1e7cbf7218c612e338b2acc2ab8c9426 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 12 Mar 2019 16:26:48 +0300 Subject: [PATCH 030/194] Update StorageMergeTree.h --- dbms/src/Storages/StorageMergeTree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.h b/dbms/src/Storages/StorageMergeTree.h index 36b6cb9fc36..7e0da497465 100644 --- a/dbms/src/Storages/StorageMergeTree.h +++ b/dbms/src/Storages/StorageMergeTree.h @@ -132,8 +132,8 @@ private: BackgroundProcessingPool::TaskHandle background_task_handle; - std::vector prepare_alter_transactions( - const ColumnsDescription& new_columns, const IndicesDescription& new_indices, const size_t thread_pool_size); + std::vector prepareAlterTransactions( + const ColumnsDescription & new_columns, const IndicesDescription & new_indices, const size_t thread_pool_size); void loadMutations(); From b5f0414200d98843fadd9d7002bdbfe93342b289 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Thu, 4 Apr 2019 03:17:27 +0300 Subject: [PATCH 031/194] new test --- .../AggregateFunctionMLMethod.h | 17 +++++++------- .../0_stateless/00960_dataset_test.sql | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00960_dataset_test.sql diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 2fd4c7cc3f2..6bceb2ee8a8 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -7,19 +7,17 @@ #include #include -#include +#include +#include +#include +#include #include +#include #include #include -#include -#include -#include -#include - - namespace DB { @@ -618,6 +616,7 @@ public: /// хочется не константный rhs void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override { + std::cout << "\nMERGING!!\n\n"; this->data(place).merge(this->data(rhs)); } @@ -633,6 +632,8 @@ public: void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments) const { + std::cout << "\nPREDICTING!!\n\n"; + if (arguments.size() != param_num + 1) throw Exception("Predict got incorrect number of arguments. Got: " + std::to_string(arguments.size()) + ". Required: " + std::to_string(param_num + 1), @@ -660,7 +661,7 @@ public: { std::ignore = place; std::ignore = to; - return; + throw std::runtime_error("not implemented"); } const char * getHeaderFilePath() const override { return __FILE__; } diff --git a/dbms/tests/queries/0_stateless/00960_dataset_test.sql b/dbms/tests/queries/0_stateless/00960_dataset_test.sql new file mode 100644 index 00000000000..1b065afdecb --- /dev/null +++ b/dbms/tests/queries/0_stateless/00960_dataset_test.sql @@ -0,0 +1,22 @@ +-- CREATE DATABASE IF NOT EXISTS test; +-- DROP TABLE IF EXISTS test.trainset; +-- CREATE TABLE IF NOT EXISTS test.trainset +-- ( +-- param1 Float64, param2 Float64, param3 Float64, param4 Float64, param5 Float64, param6 Float64, param7 Float64, param8 Float64, param9 Float64, param10 Float64, param11 Float64, param12 Float64, param13 Float64, param14 Float64, param15 Float64, param16 Float64, param17 Float64, param18 Float64, param19 Float64, param20 Float64, param21 Float64, param22 Float64, param23 Float64, param24 Float64, param25 Float64, param26 Float64, param27 Float64, param28 Float64, param29 Float64, param30 Float64, param31 Float64, param32 Float64, param33 Float64, param34 Float64, param35 Float64, param36 Float64, param37 Float64, param38 Float64, param39 Float64, param40 Float64, param41 Float64, param42 Float64, param43 Float64, param44 Float64, param45 Float64, param46 Float64, param47 Float64, param48 Float64, param49 Float64, param50 Float64, param51 Float64, param52 Float64, param53 Float64, param54 Float64, param55 Float64, param56 Float64, param57 Float64, param58 Float64, param59 Float64, param60 Float64, param61 Float64, param62 Float64, param63 Float64, param64 Float64, param65 Float64, param66 Float64, param67 Float64, param68 Float64, param69 Float64, param70 Float64, param71 Float64, param72 Float64, param73 Float64, param74 Float64, param75 Float64, param76 Float64, param77 Float64, param78 Float64, param79 Float64, param80 Float64, param81 Float64, param82 Float64, param83 Float64, param84 Float64, param85 Float64, param86 Float64, param87 Float64, param88 Float64, param89 Float64, param90 Float64, param91 Float64, param92 Float64, param93 Float64, param94 Float64, param95 Float64, param96 Float64, param97 Float64, param98 Float64, param99 Float64, param100 Float64, param101 Float64, param102 Float64, param103 Float64, param104 Float64, param105 Float64, param106 Float64, param107 Float64, param108 Float64, param109 Float64, param110 Float64, param111 Float64, param112 Float64, param113 Float64, param114 Float64, param115 Float64, param116 Float64, param117 Float64, param118 Float64, param119 Float64, param120 Float64, param121 Float64, param122 Float64, param123 Float64, param124 Float64, param125 Float64, param126 Float64, param127 Float64, param128 Float64, param129 Float64, param130 Float64, param131 Float64, param132 Float64, param133 Float64, param134 Float64, param135 Float64, param136 Float64, param137 Float64, param138 Float64, param139 Float64, param140 Float64, param141 Float64, param142 Float64, param143 Float64, param144 Float64, param145 Float64, param146 Float64, param147 Float64, param148 Float64, param149 Float64, param150 Float64, param151 Float64, param152 Float64, param153 Float64, param154 Float64, param155 Float64, param156 Float64, param157 Float64, param158 Float64, param159 Float64, param160 Float64, param161 Float64, param162 Float64, param163 Float64, param164 Float64, param165 Float64, param166 Float64, param167 Float64, param168 Float64, param169 Float64, param170 Float64, param171 Float64, param172 Float64, param173 Float64, param174 Float64, param175 Float64, param176 Float64, param177 Float64, param178 Float64, param179 Float64, param180 Float64, param181 Float64, param182 Float64, param183 Float64, target Float64 +-- ) ENGINE = Memory; +-- DROP TABLE IF EXISTS test.testset; +-- CREATE TABLE IF NOT EXISTS test.testset +-- ( +-- param1 Float64, param2 Float64, param3 Float64, param4 Float64, param5 Float64, param6 Float64, param7 Float64, param8 Float64, param9 Float64, param10 Float64, param11 Float64, param12 Float64, param13 Float64, param14 Float64, param15 Float64, param16 Float64, param17 Float64, param18 Float64, param19 Float64, param20 Float64, param21 Float64, param22 Float64, param23 Float64, param24 Float64, param25 Float64, param26 Float64, param27 Float64, param28 Float64, param29 Float64, param30 Float64, param31 Float64, param32 Float64, param33 Float64, param34 Float64, param35 Float64, param36 Float64, param37 Float64, param38 Float64, param39 Float64, param40 Float64, param41 Float64, param42 Float64, param43 Float64, param44 Float64, param45 Float64, param46 Float64, param47 Float64, param48 Float64, param49 Float64, param50 Float64, param51 Float64, param52 Float64, param53 Float64, param54 Float64, param55 Float64, param56 Float64, param57 Float64, param58 Float64, param59 Float64, param60 Float64, param61 Float64, param62 Float64, param63 Float64, param64 Float64, param65 Float64, param66 Float64, param67 Float64, param68 Float64, param69 Float64, param70 Float64, param71 Float64, param72 Float64, param73 Float64, param74 Float64, param75 Float64, param76 Float64, param77 Float64, param78 Float64, param79 Float64, param80 Float64, param81 Float64, param82 Float64, param83 Float64, param84 Float64, param85 Float64, param86 Float64, param87 Float64, param88 Float64, param89 Float64, param90 Float64, param91 Float64, param92 Float64, param93 Float64, param94 Float64, param95 Float64, param96 Float64, param97 Float64, param98 Float64, param99 Float64, param100 Float64, param101 Float64, param102 Float64, param103 Float64, param104 Float64, param105 Float64, param106 Float64, param107 Float64, param108 Float64, param109 Float64, param110 Float64, param111 Float64, param112 Float64, param113 Float64, param114 Float64, param115 Float64, param116 Float64, param117 Float64, param118 Float64, param119 Float64, param120 Float64, param121 Float64, param122 Float64, param123 Float64, param124 Float64, param125 Float64, param126 Float64, param127 Float64, param128 Float64, param129 Float64, param130 Float64, param131 Float64, param132 Float64, param133 Float64, param134 Float64, param135 Float64, param136 Float64, param137 Float64, param138 Float64, param139 Float64, param140 Float64, param141 Float64, param142 Float64, param143 Float64, param144 Float64, param145 Float64, param146 Float64, param147 Float64, param148 Float64, param149 Float64, param150 Float64, param151 Float64, param152 Float64, param153 Float64, param154 Float64, param155 Float64, param156 Float64, param157 Float64, param158 Float64, param159 Float64, param160 Float64, param161 Float64, param162 Float64, param163 Float64, param164 Float64, param165 Float64, param166 Float64, param167 Float64, param168 Float64, param169 Float64, param170 Float64, param171 Float64, param172 Float64, param173 Float64, param174 Float64, param175 Float64, param176 Float64, param177 Float64, param178 Float64, param179 Float64, param180 Float64, param181 Float64, param182 Float64, param183 Float64 +-- ) ENGINE = Memory; + +SET send_logs_level = 'trace'; +-- SET log_queries = 1; +-- SET max_threads = 4; + +-- drop table if exists test.model; +-- create table if not exists test.model engine = Memory as select LinearRegressionState(0.0000001, 4, 2.0)(target, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, param21, param22, param23, param24, param25, param26, param27, param28, param29, param30, param31, param32, param33, param34, param35, param36, param37, param38, param39, param40, param41, param42, param43, param44, param45, param46, param47, param48, param49, param50, param51, param52, param53, param54, param55, param56, param57, param58, param59, param60, param61, param62, param63, param64, param65, param66, param67, param68, param69, param70, param71, param72, param73, param74, param75, param76, param77, param78, param79, param80, param81, param82, param83, param84, param85, param86, param87, param88, param89, param90, param91, param92, param93, param94, param95, param96, param97, param98, param99, param100, param101, param102, param103, param104, param105, param106, param107, param108, param109, param110, param111, param112, param113, param114, param115, param116, param117, param118, param119, param120, param121, param122, param123, param124, param125, param126, param127, param128, param129, param130, param131, param132, param133, param134, param135, param136, param137, param138, param139, param140, param141, param142, param143, param144, param145, param146, param147, param148, param149, param150, param151, param152, param153, param154, param155, param156, param157, param158, param159, param160, param161, param162, param163, param164, param165, param166, param167, param168, param169, param170, param171, param172, param173, param174, param175, param176, param177, param178, param179, param180, param181, param182, param183) as state from test.trainset; + +select LinearRegressionState(0.0000001, 4, 2.0)(target, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, param21, param22, param23, param24, param25, param26, param27, param28, param29, param30, param31, param32, param33, param34, param35, param36, param37, param38, param39, param40, param41, param42, param43, param44, param45, param46, param47, param48, param49, param50, param51, param52, param53, param54, param55, param56, param57, param58, param59, param60, param61, param62, param63, param64, param65, param66, param67, param68, param69, param70, param71, param72, param73, param74, param75, param76, param77, param78, param79, param80, param81, param82, param83, param84, param85, param86, param87, param88, param89, param90, param91, param92, param93, param94, param95, param96, param97, param98, param99, param100, param101, param102, param103, param104, param105, param106, param107, param108, param109, param110, param111, param112, param113, param114, param115, param116, param117, param118, param119, param120, param121, param122, param123, param124, param125, param126, param127, param128, param129, param130, param131, param132, param133, param134, param135, param136, param137, param138, param139, param140, param141, param142, param143, param144, param145, param146, param147, param148, param149, param150, param151, param152, param153, param154, param155, param156, param157, param158, param159, param160, param161, param162, param163, param164, param165, param166, param167, param168, param169, param170, param171, param172, param173, param174, param175, param176, param177, param178, param179, param180, param181, param182, param183) from test.trainset; + +-- with (select state from test.model) as model select evalMLMethod(model, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, param21, param22, param23, param24, param25, param26, param27, param28, param29, param30, param31, param32, param33, param34, param35, param36, param37, param38, param39, param40, param41, param42, param43, param44, param45, param46, param47, param48, param49, param50, param51, param52, param53, param54, param55, param56, param57, param58, param59, param60, param61, param62, param63, param64, param65, param66, param67, param68, param69, param70, param71, param72, param73, param74, param75, param76, param77, param78, param79, param80, param81, param82, param83, param84, param85, param86, param87, param88, param89, param90, param91, param92, param93, param94, param95, param96, param97, param98, param99, param100, param101, param102, param103, param104, param105, param106, param107, param108, param109, param110, param111, param112, param113, param114, param115, param116, param117, param118, param119, param120, param121, param122, param123, param124, param125, param126, param127, param128, param129, param130, param131, param132, param133, param134, param135, param136, param137, param138, param139, param140, param141, param142, param143, param144, param145, param146, param147, param148, param149, param150, param151, param152, param153, param154, param155, param156, param157, param158, param159, param160, param161, param162, param163, param164, param165, param166, param167, param168, param169, param170, param171, param172, param173, param174, param175, param176, param177, param178, param179, param180, param181, param182, param183) from test.testset; \ No newline at end of file From 9d9d16e1ea74652557d29513469dfe9c8bee131b Mon Sep 17 00:00:00 2001 From: bgranvea Date: Fri, 8 Mar 2019 17:49:10 +0100 Subject: [PATCH 032/194] support for SimpleAggregateFunction data type --- .../AggregatingSortedBlockInputStream.cpp | 44 +++++- .../AggregatingSortedBlockInputStream.h | 51 ++++++ .../DataTypes/DataTypeDomainIPv4AndIPv6.cpp | 18 +-- .../DataTypeDomainSimpleAggregateFunction.cpp | 149 ++++++++++++++++++ .../DataTypeDomainSimpleAggregateFunction.h | 45 ++++++ .../DataTypeDomainWithSimpleSerialization.h | 2 +- dbms/src/DataTypes/DataTypeFactory.cpp | 31 ++-- dbms/src/DataTypes/DataTypeFactory.h | 13 +- dbms/src/DataTypes/IDataType.cpp | 53 +++---- dbms/src/DataTypes/IDataType.h | 11 +- dbms/src/DataTypes/IDataTypeDomain.h | 41 +++-- .../00915_simple_aggregate_function.reference | 43 +++++ .../00915_simple_aggregate_function.sql | 27 ++++ 13 files changed, 454 insertions(+), 74 deletions(-) create mode 100644 dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp create mode 100644 dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h create mode 100644 dbms/tests/queries/0_stateless/00915_simple_aggregate_function.reference create mode 100644 dbms/tests/queries/0_stateless/00915_simple_aggregate_function.sql diff --git a/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp b/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp index 0697ec8167c..34fb19b2688 100644 --- a/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp +++ b/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp @@ -1,6 +1,8 @@ #include #include #include +#include +#include namespace DB @@ -22,7 +24,7 @@ AggregatingSortedBlockInputStream::AggregatingSortedBlockInputStream( ColumnWithTypeAndName & column = header.safeGetByPosition(i); /// We leave only states of aggregate functions. - if (!startsWith(column.type->getName(), "AggregateFunction")) + if (!dynamic_cast(column.type.get()) && !findSimpleAggregateFunction(column.type)) { column_numbers_not_to_aggregate.push_back(i); continue; @@ -40,7 +42,14 @@ AggregatingSortedBlockInputStream::AggregatingSortedBlockInputStream( continue; } - column_numbers_to_aggregate.push_back(i); + if (auto simple_aggr = findSimpleAggregateFunction(column.type)) { + // simple aggregate function + SimpleAggregateDescription desc{simple_aggr->getFunction(), i}; + columns_to_simple_aggregate.emplace_back(std::move(desc)); + } else { + // standard aggregate function + column_numbers_to_aggregate.push_back(i); + } } } @@ -90,8 +99,11 @@ void AggregatingSortedBlockInputStream::merge(MutableColumns & merged_columns, s key_differs = next_key != current_key; /// if there are enough rows accumulated and the last one is calculated completely - if (key_differs && merged_rows >= max_block_size) + if (key_differs && merged_rows >= max_block_size) { + /// Write the simple aggregation result for the previous group. + insertSimpleAggregationResult(merged_columns); return; + } queue.pop(); @@ -110,6 +122,14 @@ void AggregatingSortedBlockInputStream::merge(MutableColumns & merged_columns, s for (auto & column_to_aggregate : columns_to_aggregate) column_to_aggregate->insertDefault(); + /// Write the simple aggregation result for the previous group. + if (merged_rows > 0) + insertSimpleAggregationResult(merged_columns); + + /// Reset simple aggregation states for next row + for (auto & desc : columns_to_simple_aggregate) + desc.createState(); + ++merged_rows; } @@ -127,6 +147,9 @@ void AggregatingSortedBlockInputStream::merge(MutableColumns & merged_columns, s } } + /// Write the simple aggregation result for the previous group. + insertSimpleAggregationResult(merged_columns); + finished = true; } @@ -138,6 +161,21 @@ void AggregatingSortedBlockInputStream::addRow(SortCursor & cursor) size_t j = column_numbers_to_aggregate[i]; columns_to_aggregate[i]->insertMergeFrom(*cursor->all_columns[j], cursor->pos); } + + for (auto & desc : columns_to_simple_aggregate) + { + auto & col = cursor->all_columns[desc.column_number]; + desc.add_function(desc.function.get(), desc.state.data(), &col, cursor->pos, nullptr); + } +} + +void AggregatingSortedBlockInputStream::insertSimpleAggregationResult(MutableColumns & merged_columns) +{ + for (auto & desc : columns_to_simple_aggregate) + { + desc.function->insertResultInto(desc.state.data(), *merged_columns[desc.column_number]); + desc.destroyState(); + } } } diff --git a/dbms/src/DataStreams/AggregatingSortedBlockInputStream.h b/dbms/src/DataStreams/AggregatingSortedBlockInputStream.h index 522b54aeaec..97a579e31a6 100644 --- a/dbms/src/DataStreams/AggregatingSortedBlockInputStream.h +++ b/dbms/src/DataStreams/AggregatingSortedBlockInputStream.h @@ -7,6 +7,7 @@ #include #include #include +#include namespace DB @@ -38,10 +39,13 @@ private: /// Read finished. bool finished = false; + struct SimpleAggregateDescription; + /// Columns with which numbers should be aggregated. ColumnNumbers column_numbers_to_aggregate; ColumnNumbers column_numbers_not_to_aggregate; std::vector columns_to_aggregate; + std::vector columns_to_simple_aggregate; RowRef current_key; /// The current primary key. RowRef next_key; /// The primary key of the next row. @@ -54,6 +58,53 @@ private: /** Extract all states of aggregate functions and merge them with the current group. */ void addRow(SortCursor & cursor); + + /** Insert all values of current row for simple aggregate functions + */ + void insertSimpleAggregationResult(MutableColumns & merged_columns); + + /// Stores information for aggregation of SimpleAggregateFunction columns + struct SimpleAggregateDescription + { + /// An aggregate function 'anyLast', 'sum'... + AggregateFunctionPtr function; + IAggregateFunction::AddFunc add_function; + size_t column_number; + AlignedBuffer state; + bool created = false; + + SimpleAggregateDescription(const AggregateFunctionPtr & function_, const size_t column_number_) : function(function_), column_number(column_number_) + { + add_function = function->getAddressOfAddFunction(); + state.reset(function->sizeOfData(), function->alignOfData()); + } + + void createState() + { + if (created) + return; + function->create(state.data()); + created = true; + } + + void destroyState() + { + if (!created) + return; + function->destroy(state.data()); + created = false; + } + + /// Explicitly destroy aggregation state if the stream is terminated + ~SimpleAggregateDescription() + { + destroyState(); + } + + SimpleAggregateDescription() = default; + SimpleAggregateDescription(SimpleAggregateDescription &&) = default; + SimpleAggregateDescription(const SimpleAggregateDescription &) = delete; + }; }; } diff --git a/dbms/src/DataTypes/DataTypeDomainIPv4AndIPv6.cpp b/dbms/src/DataTypes/DataTypeDomainIPv4AndIPv6.cpp index 873dbde506b..f57a6167d3d 100644 --- a/dbms/src/DataTypes/DataTypeDomainIPv4AndIPv6.cpp +++ b/dbms/src/DataTypes/DataTypeDomainIPv4AndIPv6.cpp @@ -23,7 +23,7 @@ namespace class DataTypeDomainIPv4 : public DataTypeDomainWithSimpleSerialization { public: - const char * getName() const override + String doGetName() const override { return "IPv4"; } @@ -33,7 +33,7 @@ public: const auto col = checkAndGetColumn(&column); if (!col) { - throw Exception(String(getName()) + " domain can only serialize columns of type UInt32." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); + throw Exception(getName() + " domain can only serialize columns of type UInt32." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); } char buffer[IPV4_MAX_TEXT_LENGTH + 1] = {'\0'}; @@ -48,7 +48,7 @@ public: ColumnUInt32 * col = typeid_cast(&column); if (!col) { - throw Exception(String(getName()) + " domain can only deserialize columns of type UInt32." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); + throw Exception(getName() + " domain can only deserialize columns of type UInt32." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); } char buffer[IPV4_MAX_TEXT_LENGTH + 1] = {'\0'}; @@ -66,7 +66,7 @@ public: class DataTypeDomainIPv6 : public DataTypeDomainWithSimpleSerialization { public: - const char * getName() const override + String doGetName() const override { return "IPv6"; } @@ -76,7 +76,7 @@ public: const auto col = checkAndGetColumn(&column); if (!col) { - throw Exception(String(getName()) + " domain can only serialize columns of type FixedString(16)." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); + throw Exception(getName() + " domain can only serialize columns of type FixedString(16)." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); } char buffer[IPV6_MAX_TEXT_LENGTH + 1] = {'\0'}; @@ -91,7 +91,7 @@ public: ColumnFixedString * col = typeid_cast(&column); if (!col) { - throw Exception(String(getName()) + " domain can only deserialize columns of type FixedString(16)." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); + throw Exception(getName() + " domain can only deserialize columns of type FixedString(16)." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); } char buffer[IPV6_MAX_TEXT_LENGTH + 1] = {'\0'}; @@ -100,7 +100,7 @@ public: std::string ipv6_value(IPV6_BINARY_LENGTH, '\0'); if (!parseIPv6(buffer, reinterpret_cast(ipv6_value.data()))) { - throw Exception(String("Invalid ") + getName() + " value.", ErrorCodes::CANNOT_PARSE_DOMAIN_VALUE_FROM_STRING); + throw Exception("Invalid " + getName() + " value.", ErrorCodes::CANNOT_PARSE_DOMAIN_VALUE_FROM_STRING); } col->insertString(ipv6_value); @@ -111,8 +111,8 @@ public: void registerDataTypeDomainIPv4AndIPv6(DataTypeFactory & factory) { - factory.registerDataTypeDomain("UInt32", std::make_unique()); - factory.registerDataTypeDomain("FixedString(16)", std::make_unique()); + factory.registerDataTypeDomain("IPv4", [] { return std::make_pair(DataTypeFactory::instance().get("UInt32"), std::make_unique()); }); + factory.registerDataTypeDomain("IPv6", [] { return std::make_pair(DataTypeFactory::instance().get("FixedString(16)"), std::make_unique()); }); } } // namespace DB diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp new file mode 100644 index 00000000000..402ce86ad62 --- /dev/null +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp @@ -0,0 +1,149 @@ +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +namespace DB { + +namespace ErrorCodes +{ + extern const int SYNTAX_ERROR; + extern const int BAD_ARGUMENTS; + extern const int PARAMETERS_TO_AGGREGATE_FUNCTIONS_MUST_BE_LITERALS; + extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; + extern const int LOGICAL_ERROR; +} + +const std::vector supported_functions = std::vector( + {"any", "anyLast", "min", "max", "sum"}); + + +String DataTypeDomainSimpleAggregateFunction::doGetName() const { + std::stringstream stream; + stream << "SimpleAggregateFunction(" << function->getName(); + + if (!parameters.empty()) { + stream << "("; + for (size_t i = 0; i < parameters.size(); ++i) { + if (i) + stream << ", "; + stream << applyVisitor(DB::FieldVisitorToString(), parameters[i]); + } + stream << ")"; + } + + for (const auto &argument_type : argument_types) + stream << ", " << argument_type->getName(); + + stream << ")"; + return stream.str(); +} + + +static std::pair create(const ASTPtr & arguments) +{ + String function_name; + AggregateFunctionPtr function; + DataTypes argument_types; + Array params_row; + + if (!arguments || arguments->children.empty()) + throw Exception("Data type SimpleAggregateFunction requires parameters: " + "name of aggregate function and list of data types for arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + + if (const ASTFunction * parametric = typeid_cast(arguments->children[0].get())) + { + if (parametric->parameters) + throw Exception("Unexpected level of parameters to aggregate function", ErrorCodes::SYNTAX_ERROR); + function_name = parametric->name; + + const ASTs & parameters = typeid_cast(*parametric->arguments).children; + params_row.resize(parameters.size()); + + for (size_t i = 0; i < parameters.size(); ++i) + { + const ASTLiteral * lit = typeid_cast(parameters[i].get()); + if (!lit) + throw Exception("Parameters to aggregate functions must be literals", + ErrorCodes::PARAMETERS_TO_AGGREGATE_FUNCTIONS_MUST_BE_LITERALS); + + params_row[i] = lit->value; + } + } + else if (auto opt_name = getIdentifierName(arguments->children[0])) + { + function_name = *opt_name; + } + else if (typeid_cast(arguments->children[0].get())) + { + throw Exception("Aggregate function name for data type SimpleAggregateFunction must be passed as identifier (without quotes) or function", + ErrorCodes::BAD_ARGUMENTS); + } + else + throw Exception("Unexpected AST element passed as aggregate function name for data type SimpleAggregateFunction. Must be identifier or function.", + ErrorCodes::BAD_ARGUMENTS); + + for (size_t i = 1; i < arguments->children.size(); ++i) + argument_types.push_back(DataTypeFactory::instance().get(arguments->children[i])); + + if (function_name.empty()) + throw Exception("Logical error: empty name of aggregate function passed", ErrorCodes::LOGICAL_ERROR); + + function = AggregateFunctionFactory::instance().get(function_name, argument_types, params_row); + + // check function + if (std::find(std::begin(supported_functions), std::end(supported_functions), function->getName()) == std::end(supported_functions)) { + throw Exception("Unsupported aggregate function " + function->getName() + ", supported functions are " + boost::algorithm::join(supported_functions, ","), + ErrorCodes::BAD_ARGUMENTS); + } + + DataTypePtr storage_type = DataTypeFactory::instance().get(argument_types[0]->getName()); + DataTypeDomainPtr domain = std::make_unique(storage_type, function, argument_types, params_row); + + if (!function->getReturnType()->equals(*removeLowCardinality(storage_type))) { + throw Exception("Incompatible data types between aggregate function '" + function->getName() + "' which returns " + function->getReturnType()->getName() + " and column storage type " + storage_type->getName(), + ErrorCodes::BAD_ARGUMENTS); + } + + return std::make_pair(storage_type, std::move(domain)); +} + +static const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(const IDataTypeDomain * domain) { + if (domain == nullptr) + return nullptr; + + if (auto simple_aggr = dynamic_cast(domain)) + return simple_aggr; + + if (domain->getDomain() != nullptr) + return findSimpleAggregateFunction(domain->getDomain()); + + return nullptr; +} + +const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(DataTypePtr dataType) { + return findSimpleAggregateFunction(dataType->getDomain()); +} + + +void registerDataTypeDomainSimpleAggregateFunction(DataTypeFactory & factory) +{ + factory.registerDataTypeDomain("SimpleAggregateFunction", create); +} + +} diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h new file mode 100644 index 00000000000..70e94b1a652 --- /dev/null +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h @@ -0,0 +1,45 @@ +#pragma once + +#include +#include +#include + +#include + +namespace DB +{ + +/** The type SimpleAggregateFunction(fct, type) is meant to be used in an AggregatingMergeTree. It behaves like a standard + * data type but when rows are merged, an aggregation function is applied. + * + * The aggregation function is limited to simple functions whose merge state is the final result: + * any, anyLast, min, max, sum + * + * Examples: + * + * SimpleAggregateFunction(sum, Nullable(Float64)) + * SimpleAggregateFunction(anyLast, LowCardinality(Nullable(String))) + * SimpleAggregateFunction(anyLast, IPv4) + * + * Technically, a standard IDataType is instanciated and a DataTypeDomainSimpleAggregateFunction is added as domain. + */ + +class DataTypeDomainSimpleAggregateFunction : public IDataTypeDomain { +private: + const DataTypePtr storage_type; + const AggregateFunctionPtr function; + const DataTypes argument_types; + const Array parameters; + +public: + DataTypeDomainSimpleAggregateFunction(const DataTypePtr storage_type_, const AggregateFunctionPtr & function_, const DataTypes & argument_types_, const Array & parameters_) + : storage_type(storage_type_), function(function_), argument_types(argument_types_), parameters(parameters_) {} + + const AggregateFunctionPtr getFunction() const { return function; } + String doGetName() const override; +}; + +/// recursively follow data type domain to find a DataTypeDomainSimpleAggregateFunction +const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(DataTypePtr dataType); + +} diff --git a/dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.h b/dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.h index 7834e9235d2..3ccb4091636 100644 --- a/dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.h +++ b/dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.h @@ -12,7 +12,7 @@ class IColumn; /** Simple DataTypeDomain that uses serializeText/deserializeText * for all serialization and deserialization. */ -class DataTypeDomainWithSimpleSerialization : public IDataTypeDomain +class DataTypeDomainWithSimpleSerialization : public IDataTypeDomainCustomSerialization { public: virtual ~DataTypeDomainWithSimpleSerialization() override; diff --git a/dbms/src/DataTypes/DataTypeFactory.cpp b/dbms/src/DataTypes/DataTypeFactory.cpp index a0afab890e9..a405075e884 100644 --- a/dbms/src/DataTypes/DataTypeFactory.cpp +++ b/dbms/src/DataTypes/DataTypeFactory.cpp @@ -115,19 +115,23 @@ void DataTypeFactory::registerSimpleDataType(const String & name, SimpleCreator }, case_sensitiveness); } -void DataTypeFactory::registerDataTypeDomain(const String & type_name, DataTypeDomainPtr domain, CaseSensitiveness case_sensitiveness) +void DataTypeFactory::registerDataTypeDomain(const String & family_name, CreatorWithDomain creator, CaseSensitiveness case_sensitiveness) { - all_domains.reserve(all_domains.size() + 1); - - auto data_type = get(type_name); - setDataTypeDomain(*data_type, *domain); - - registerDataType(domain->getName(), [data_type](const ASTPtr & /*ast*/) + registerDataType(family_name, [creator](const ASTPtr & ast) { - return data_type; - }, case_sensitiveness); + auto res = creator(ast); + res.first->appendDomain(std::move(res.second)); - all_domains.emplace_back(std::move(domain)); + return res.first; + }, case_sensitiveness); +} + +void DataTypeFactory::registerDataTypeDomain(const String & name, SimpleCreatorWithDomain creator, CaseSensitiveness case_sensitiveness) +{ + registerDataTypeDomain(name, [creator](const ASTPtr & /*ast*/) + { + return creator(); + }, case_sensitiveness); } const DataTypeFactory::Creator& DataTypeFactory::findCreatorByName(const String & family_name) const @@ -153,11 +157,6 @@ const DataTypeFactory::Creator& DataTypeFactory::findCreatorByName(const String throw Exception("Unknown data type family: " + family_name, ErrorCodes::UNKNOWN_TYPE); } -void DataTypeFactory::setDataTypeDomain(const IDataType & data_type, const IDataTypeDomain & domain) -{ - data_type.setDomain(&domain); -} - void registerDataTypeNumbers(DataTypeFactory & factory); void registerDataTypeDecimal(DataTypeFactory & factory); void registerDataTypeDate(DataTypeFactory & factory); @@ -175,6 +174,7 @@ void registerDataTypeNested(DataTypeFactory & factory); void registerDataTypeInterval(DataTypeFactory & factory); void registerDataTypeLowCardinality(DataTypeFactory & factory); void registerDataTypeDomainIPv4AndIPv6(DataTypeFactory & factory); +void registerDataTypeDomainSimpleAggregateFunction(DataTypeFactory & factory); DataTypeFactory::DataTypeFactory() @@ -196,6 +196,7 @@ DataTypeFactory::DataTypeFactory() registerDataTypeInterval(*this); registerDataTypeLowCardinality(*this); registerDataTypeDomainIPv4AndIPv6(*this); + registerDataTypeDomainSimpleAggregateFunction(*this); } DataTypeFactory::~DataTypeFactory() diff --git a/dbms/src/DataTypes/DataTypeFactory.h b/dbms/src/DataTypes/DataTypeFactory.h index c6ef100bbb7..e4a82b342d1 100644 --- a/dbms/src/DataTypes/DataTypeFactory.h +++ b/dbms/src/DataTypes/DataTypeFactory.h @@ -28,6 +28,8 @@ class DataTypeFactory final : public ext::singleton, public IFa private: using SimpleCreator = std::function; using DataTypesDictionary = std::unordered_map; + using CreatorWithDomain = std::function(const ASTPtr & parameters)>; + using SimpleCreatorWithDomain = std::function()>; public: DataTypePtr get(const String & full_name) const; @@ -40,11 +42,13 @@ public: /// Register a simple data type, that have no parameters. void registerSimpleDataType(const String & name, SimpleCreator creator, CaseSensitiveness case_sensitiveness = CaseSensitive); - // Register a domain - a refinement of existing type. - void registerDataTypeDomain(const String & type_name, DataTypeDomainPtr domain, CaseSensitiveness case_sensitiveness = CaseSensitive); + /// Register a type family with a dynamic domain + void registerDataTypeDomain(const String & family_name, CreatorWithDomain creator, CaseSensitiveness case_sensitiveness = CaseSensitive); + + /// Register a simple data type domain + void registerDataTypeDomain(const String & name, SimpleCreatorWithDomain creator, CaseSensitiveness case_sensitiveness = CaseSensitive); private: - static void setDataTypeDomain(const IDataType & data_type, const IDataTypeDomain & domain); const Creator& findCreatorByName(const String & family_name) const; private: @@ -53,9 +57,6 @@ private: /// Case insensitive data types will be additionally added here with lowercased name. DataTypesDictionary case_insensitive_data_types; - // All domains are owned by factory and shared amongst DataType instances. - std::vector all_domains; - DataTypeFactory(); ~DataTypeFactory() override; diff --git a/dbms/src/DataTypes/IDataType.cpp b/dbms/src/DataTypes/IDataType.cpp index 679871dba71..0270f1d7923 100644 --- a/dbms/src/DataTypes/IDataType.cpp +++ b/dbms/src/DataTypes/IDataType.cpp @@ -142,9 +142,9 @@ void IDataType::insertDefaultInto(IColumn & column) const void IDataType::serializeAsTextEscaped(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->serializeTextEscaped(column, row_num, ostr, settings); + ser_domain->serializeTextEscaped(column, row_num, ostr, settings); } else { @@ -154,9 +154,9 @@ void IDataType::serializeAsTextEscaped(const IColumn & column, size_t row_num, W void IDataType::deserializeAsTextEscaped(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->deserializeTextEscaped(column, istr, settings); + ser_domain->deserializeTextEscaped(column, istr, settings); } else { @@ -166,9 +166,9 @@ void IDataType::deserializeAsTextEscaped(IColumn & column, ReadBuffer & istr, co void IDataType::serializeAsTextQuoted(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->serializeTextQuoted(column, row_num, ostr, settings); + ser_domain->serializeTextQuoted(column, row_num, ostr, settings); } else { @@ -178,9 +178,9 @@ void IDataType::serializeAsTextQuoted(const IColumn & column, size_t row_num, Wr void IDataType::deserializeAsTextQuoted(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->deserializeTextQuoted(column, istr, settings); + ser_domain->deserializeTextQuoted(column, istr, settings); } else { @@ -190,9 +190,9 @@ void IDataType::deserializeAsTextQuoted(IColumn & column, ReadBuffer & istr, con void IDataType::serializeAsTextCSV(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (domain) - { - domain->serializeTextCSV(column, row_num, ostr, settings); + if (auto ser_domain = dynamic_cast(domain.get())) + { + ser_domain->serializeTextCSV(column, row_num, ostr, settings); } else { @@ -202,9 +202,9 @@ void IDataType::serializeAsTextCSV(const IColumn & column, size_t row_num, Write void IDataType::deserializeAsTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->deserializeTextCSV(column, istr, settings); + ser_domain->deserializeTextCSV(column, istr, settings); } else { @@ -214,9 +214,9 @@ void IDataType::deserializeAsTextCSV(IColumn & column, ReadBuffer & istr, const void IDataType::serializeAsText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->serializeText(column, row_num, ostr, settings); + ser_domain->serializeText(column, row_num, ostr, settings); } else { @@ -226,9 +226,9 @@ void IDataType::serializeAsText(const IColumn & column, size_t row_num, WriteBuf void IDataType::serializeAsTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->serializeTextJSON(column, row_num, ostr, settings); + ser_domain->serializeTextJSON(column, row_num, ostr, settings); } else { @@ -238,9 +238,9 @@ void IDataType::serializeAsTextJSON(const IColumn & column, size_t row_num, Writ void IDataType::deserializeAsTextJSON(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->deserializeTextJSON(column, istr, settings); + ser_domain->deserializeTextJSON(column, istr, settings); } else { @@ -250,9 +250,9 @@ void IDataType::deserializeAsTextJSON(IColumn & column, ReadBuffer & istr, const void IDataType::serializeAsTextXML(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (domain) + if (auto ser_domain = dynamic_cast(domain.get())) { - domain->serializeTextXML(column, row_num, ostr, settings); + ser_domain->serializeTextXML(column, row_num, ostr, settings); } else { @@ -260,13 +260,12 @@ void IDataType::serializeAsTextXML(const IColumn & column, size_t row_num, Write } } -void IDataType::setDomain(const IDataTypeDomain* const new_domain) const +void IDataType::appendDomain(DataTypeDomainPtr new_domain) const { - if (domain != nullptr) - { - throw Exception("Type " + getName() + " already has a domain.", ErrorCodes::LOGICAL_ERROR); - } - domain = new_domain; + if (domain == nullptr) + domain = std::move(new_domain); + else + domain->appendDomain(std::move(new_domain)); } } diff --git a/dbms/src/DataTypes/IDataType.h b/dbms/src/DataTypes/IDataType.h index aa253fbdc08..a95402bf20a 100644 --- a/dbms/src/DataTypes/IDataType.h +++ b/dbms/src/DataTypes/IDataType.h @@ -13,6 +13,8 @@ class ReadBuffer; class WriteBuffer; class IDataTypeDomain; +using DataTypeDomainPtr = std::unique_ptr; + class IDataType; struct FormatSettings; @@ -459,18 +461,19 @@ public: private: friend class DataTypeFactory; - /** Sets domain on existing DataType, can be considered as second phase + /** Sets domain on existing DataType or append it to existing domain, can be considered as second phase * of construction explicitly done by DataTypeFactory. - * Will throw an exception if domain is already set. */ - void setDomain(const IDataTypeDomain* newDomain) const; + void appendDomain(DataTypeDomainPtr new_domain) const; private: /** This is mutable to allow setting domain on `const IDataType` post construction, * simplifying creation of domains for all types, without them even knowing * of domain existence. */ - mutable IDataTypeDomain const* domain; + mutable DataTypeDomainPtr domain; +public: + const IDataTypeDomain * getDomain() const { return domain.get(); } }; diff --git a/dbms/src/DataTypes/IDataTypeDomain.h b/dbms/src/DataTypes/IDataTypeDomain.h index ad38e88a213..1eed8afd808 100644 --- a/dbms/src/DataTypes/IDataTypeDomain.h +++ b/dbms/src/DataTypes/IDataTypeDomain.h @@ -1,6 +1,8 @@ #pragma once #include +#include +#include namespace DB { @@ -10,21 +12,42 @@ class WriteBuffer; struct FormatSettings; class IColumn; -/** Further refinment of the properties of data type. - * - * Contains methods for serialization/deserialization. - * Implementations of this interface represent a data type domain (example: IPv4) - * which is a refinement of the exsitgin type with a name and specific text - * representation. - * - * IDataTypeDomain is totally immutable object. You can always share them. +/** Allow to customize an existing data type and set a different name. Derived class IDataTypeDomainCustomSerialization allows + * further customization of serialization/deserialization methods. See use in IPv4 and IPv6 data type domains. + * + * IDataTypeDomain can be chained for further delegation (only for getName for the moment). */ class IDataTypeDomain { +private: + mutable DataTypeDomainPtr delegate; + public: virtual ~IDataTypeDomain() {} - virtual const char* getName() const = 0; + String getName() const { + if (delegate) + return delegate->getName(); + else + return doGetName(); + } + + void appendDomain(DataTypeDomainPtr delegate_) const { + if (delegate == nullptr) + delegate = std::move(delegate_); + else + delegate->appendDomain(std::move(delegate_)); + } + + const IDataTypeDomain * getDomain() const { return delegate.get(); } + +protected: + virtual String doGetName() const = 0; +}; + +class IDataTypeDomainCustomSerialization : public IDataTypeDomain { +public: + virtual ~IDataTypeDomainCustomSerialization() {} /** Text serialization for displaying on a terminal or saving into a text file, and the like. * Without escaping or quoting. diff --git a/dbms/tests/queries/0_stateless/00915_simple_aggregate_function.reference b/dbms/tests/queries/0_stateless/00915_simple_aggregate_function.reference new file mode 100644 index 00000000000..fbb3d60638e --- /dev/null +++ b/dbms/tests/queries/0_stateless/00915_simple_aggregate_function.reference @@ -0,0 +1,43 @@ +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +0 0 +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +SimpleAggregateFunction(sum, Float64) +0 0 +1 2 +2 4 +3 6 +4 8 +5 10 +6 12 +7 14 +8 16 +9 18 +0 0 +1 2 +2 4 +3 6 +4 8 +5 10 +6 12 +7 14 +8 16 +9 18 +1 1 2 2.2.2.2 +SimpleAggregateFunction(anyLast, Nullable(String)) SimpleAggregateFunction(anyLast, LowCardinality(Nullable(String))) SimpleAggregateFunction(anyLast, IPv4) diff --git a/dbms/tests/queries/0_stateless/00915_simple_aggregate_function.sql b/dbms/tests/queries/0_stateless/00915_simple_aggregate_function.sql new file mode 100644 index 00000000000..f4f80033eaa --- /dev/null +++ b/dbms/tests/queries/0_stateless/00915_simple_aggregate_function.sql @@ -0,0 +1,27 @@ +-- basic test +drop table if exists test.simple; + +create table test.simple (id UInt64,val SimpleAggregateFunction(sum,Double)) engine=AggregatingMergeTree order by id; +insert into test.simple select number,number from system.numbers limit 10; + +select * from test.simple; +select * from test.simple final; +select toTypeName(val) from test.simple limit 1; + +-- merge +insert into test.simple select number,number from system.numbers limit 10; + +select * from test.simple final; + +optimize table test.simple final; +select * from test.simple; + +-- complex types +drop table if exists test.simple; + +create table test.simple (id UInt64,nullable_str SimpleAggregateFunction(anyLast,Nullable(String)),low_str SimpleAggregateFunction(anyLast,LowCardinality(Nullable(String))),ip SimpleAggregateFunction(anyLast,IPv4)) engine=AggregatingMergeTree order by id; +insert into test.simple values(1,'1','1','1.1.1.1'); +insert into test.simple values(1,null,'2','2.2.2.2'); + +select * from test.simple final; +select toTypeName(nullable_str),toTypeName(low_str),toTypeName(ip) from test.simple limit 1; From faa7d38cb5b8ba1d5fcb97c8442c02eaadc49bd7 Mon Sep 17 00:00:00 2001 From: bgranvea Date: Mon, 11 Mar 2019 09:24:52 +0100 Subject: [PATCH 033/194] fix for style --- .../AggregatingSortedBlockInputStream.cpp | 10 +++++--- .../DataTypeDomainSimpleAggregateFunction.cpp | 24 ++++++++++++------- .../DataTypeDomainSimpleAggregateFunction.h | 3 ++- dbms/src/DataTypes/IDataTypeDomain.h | 9 ++++--- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp b/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp index 34fb19b2688..1be85f7e1b8 100644 --- a/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp +++ b/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp @@ -42,11 +42,14 @@ AggregatingSortedBlockInputStream::AggregatingSortedBlockInputStream( continue; } - if (auto simple_aggr = findSimpleAggregateFunction(column.type)) { + if (auto simple_aggr = findSimpleAggregateFunction(column.type)) + { // simple aggregate function SimpleAggregateDescription desc{simple_aggr->getFunction(), i}; columns_to_simple_aggregate.emplace_back(std::move(desc)); - } else { + } + else + { // standard aggregate function column_numbers_to_aggregate.push_back(i); } @@ -99,7 +102,8 @@ void AggregatingSortedBlockInputStream::merge(MutableColumns & merged_columns, s key_differs = next_key != current_key; /// if there are enough rows accumulated and the last one is calculated completely - if (key_differs && merged_rows >= max_block_size) { + if (key_differs && merged_rows >= max_block_size) + { /// Write the simple aggregation result for the previous group. insertSimpleAggregationResult(merged_columns); return; diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp index 402ce86ad62..65bef22ce28 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp @@ -18,7 +18,8 @@ #include -namespace DB { +namespace DB +{ namespace ErrorCodes { @@ -33,13 +34,16 @@ const std::vector supported_functions = std::vector( {"any", "anyLast", "min", "max", "sum"}); -String DataTypeDomainSimpleAggregateFunction::doGetName() const { +String DataTypeDomainSimpleAggregateFunction::doGetName() const +{ std::stringstream stream; stream << "SimpleAggregateFunction(" << function->getName(); - if (!parameters.empty()) { + if (!parameters.empty()) + { stream << "("; - for (size_t i = 0; i < parameters.size(); ++i) { + for (size_t i = 0; i < parameters.size(); ++i) + { if (i) stream << ", "; stream << applyVisitor(DB::FieldVisitorToString(), parameters[i]); @@ -107,7 +111,8 @@ static std::pair create(const ASTPtr & arguments function = AggregateFunctionFactory::instance().get(function_name, argument_types, params_row); // check function - if (std::find(std::begin(supported_functions), std::end(supported_functions), function->getName()) == std::end(supported_functions)) { + if (std::find(std::begin(supported_functions), std::end(supported_functions), function->getName()) == std::end(supported_functions)) + { throw Exception("Unsupported aggregate function " + function->getName() + ", supported functions are " + boost::algorithm::join(supported_functions, ","), ErrorCodes::BAD_ARGUMENTS); } @@ -115,7 +120,8 @@ static std::pair create(const ASTPtr & arguments DataTypePtr storage_type = DataTypeFactory::instance().get(argument_types[0]->getName()); DataTypeDomainPtr domain = std::make_unique(storage_type, function, argument_types, params_row); - if (!function->getReturnType()->equals(*removeLowCardinality(storage_type))) { + if (!function->getReturnType()->equals(*removeLowCardinality(storage_type))) + { throw Exception("Incompatible data types between aggregate function '" + function->getName() + "' which returns " + function->getReturnType()->getName() + " and column storage type " + storage_type->getName(), ErrorCodes::BAD_ARGUMENTS); } @@ -123,7 +129,8 @@ static std::pair create(const ASTPtr & arguments return std::make_pair(storage_type, std::move(domain)); } -static const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(const IDataTypeDomain * domain) { +static const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(const IDataTypeDomain * domain) +{ if (domain == nullptr) return nullptr; @@ -136,7 +143,8 @@ static const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction return nullptr; } -const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(DataTypePtr dataType) { +const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(DataTypePtr dataType) +{ return findSimpleAggregateFunction(dataType->getDomain()); } diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h index 70e94b1a652..6573f1ae5d0 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h @@ -24,7 +24,8 @@ namespace DB * Technically, a standard IDataType is instanciated and a DataTypeDomainSimpleAggregateFunction is added as domain. */ -class DataTypeDomainSimpleAggregateFunction : public IDataTypeDomain { +class DataTypeDomainSimpleAggregateFunction : public IDataTypeDomain +{ private: const DataTypePtr storage_type; const AggregateFunctionPtr function; diff --git a/dbms/src/DataTypes/IDataTypeDomain.h b/dbms/src/DataTypes/IDataTypeDomain.h index 1eed8afd808..a840964d28a 100644 --- a/dbms/src/DataTypes/IDataTypeDomain.h +++ b/dbms/src/DataTypes/IDataTypeDomain.h @@ -25,14 +25,16 @@ private: public: virtual ~IDataTypeDomain() {} - String getName() const { + String getName() const + { if (delegate) return delegate->getName(); else return doGetName(); } - void appendDomain(DataTypeDomainPtr delegate_) const { + void appendDomain(DataTypeDomainPtr delegate_) const + { if (delegate == nullptr) delegate = std::move(delegate_); else @@ -45,7 +47,8 @@ protected: virtual String doGetName() const = 0; }; -class IDataTypeDomainCustomSerialization : public IDataTypeDomain { +class IDataTypeDomainCustomSerialization : public IDataTypeDomain +{ public: virtual ~IDataTypeDomainCustomSerialization() {} From ee5a88c15f979dd8782a2a82ce1ad5f434f57ad3 Mon Sep 17 00:00:00 2001 From: bgranvea Date: Mon, 11 Mar 2019 11:46:14 +0100 Subject: [PATCH 034/194] fix memory leak --- dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp | 2 +- dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp index 65bef22ce28..5daa886df43 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp @@ -118,7 +118,7 @@ static std::pair create(const ASTPtr & arguments } DataTypePtr storage_type = DataTypeFactory::instance().get(argument_types[0]->getName()); - DataTypeDomainPtr domain = std::make_unique(storage_type, function, argument_types, params_row); + DataTypeDomainPtr domain = std::make_unique(function, argument_types, params_row); if (!function->getReturnType()->equals(*removeLowCardinality(storage_type))) { diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h index 6573f1ae5d0..98989eeac11 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h @@ -27,14 +27,13 @@ namespace DB class DataTypeDomainSimpleAggregateFunction : public IDataTypeDomain { private: - const DataTypePtr storage_type; const AggregateFunctionPtr function; const DataTypes argument_types; const Array parameters; public: - DataTypeDomainSimpleAggregateFunction(const DataTypePtr storage_type_, const AggregateFunctionPtr & function_, const DataTypes & argument_types_, const Array & parameters_) - : storage_type(storage_type_), function(function_), argument_types(argument_types_), parameters(parameters_) {} + DataTypeDomainSimpleAggregateFunction(const AggregateFunctionPtr & function_, const DataTypes & argument_types_, const Array & parameters_) + : function(function_), argument_types(argument_types_), parameters(parameters_) {} const AggregateFunctionPtr getFunction() const { return function; } String doGetName() const override; From a3020f2d22d7bd8cf180afd2ae79ab250c2f9ccf Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 26 Mar 2019 00:51:54 +0300 Subject: [PATCH 035/194] Update DataTypeDomainSimpleAggregateFunction.cpp --- dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp index 5daa886df43..570310c1312 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp @@ -51,7 +51,7 @@ String DataTypeDomainSimpleAggregateFunction::doGetName() const stream << ")"; } - for (const auto &argument_type : argument_types) + for (const auto & argument_type : argument_types) stream << ", " << argument_type->getName(); stream << ")"; From c1ea15f0bb04c5b722947d6c688e3a0871d07493 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 26 Mar 2019 00:54:19 +0300 Subject: [PATCH 036/194] Update DataTypeDomainSimpleAggregateFunction.cpp --- .../DataTypes/DataTypeDomainSimpleAggregateFunction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp index 570310c1312..ee524f76ec9 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp @@ -70,18 +70,18 @@ static std::pair create(const ASTPtr & arguments throw Exception("Data type SimpleAggregateFunction requires parameters: " "name of aggregate function and list of data types for arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); - if (const ASTFunction * parametric = typeid_cast(arguments->children[0].get())) + if (const ASTFunction * parametric = arguments->children[0]->as()) { if (parametric->parameters) throw Exception("Unexpected level of parameters to aggregate function", ErrorCodes::SYNTAX_ERROR); function_name = parametric->name; - const ASTs & parameters = typeid_cast(*parametric->arguments).children; + const ASTs & parameters = parametric->arguments->as().children; params_row.resize(parameters.size()); for (size_t i = 0; i < parameters.size(); ++i) { - const ASTLiteral * lit = typeid_cast(parameters[i].get()); + const ASTLiteral * lit = parameters[i]->as(); if (!lit) throw Exception("Parameters to aggregate functions must be literals", ErrorCodes::PARAMETERS_TO_AGGREGATE_FUNCTIONS_MUST_BE_LITERALS); @@ -93,7 +93,7 @@ static std::pair create(const ASTPtr & arguments { function_name = *opt_name; } - else if (typeid_cast(arguments->children[0].get())) + else if (arguments->children[0]->as()) { throw Exception("Aggregate function name for data type SimpleAggregateFunction must be passed as identifier (without quotes) or function", ErrorCodes::BAD_ARGUMENTS); From e4b93f092b6328a097bda6fba9a0d9805d14d0a7 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 26 Mar 2019 00:57:34 +0300 Subject: [PATCH 037/194] Update DataTypeDomainSimpleAggregateFunction.cpp --- dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp index ee524f76ec9..dfcd7604aeb 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp @@ -30,8 +30,8 @@ namespace ErrorCodes extern const int LOGICAL_ERROR; } -const std::vector supported_functions = std::vector( - {"any", "anyLast", "min", "max", "sum"}); +static const std::initializer_list supported_functions = std::vector( + {"any", "anyLast", "min", "max", "sum"}); String DataTypeDomainSimpleAggregateFunction::doGetName() const From caa096a3d0e7340d5cf0d4cecf33f552c06bbd9d Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 26 Mar 2019 00:57:58 +0300 Subject: [PATCH 038/194] Update DataTypeDomainSimpleAggregateFunction.cpp --- dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp index dfcd7604aeb..82e3b873f5e 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp @@ -30,8 +30,7 @@ namespace ErrorCodes extern const int LOGICAL_ERROR; } -static const std::initializer_list supported_functions = std::vector( - {"any", "anyLast", "min", "max", "sum"}); +static const std::vector supported_functions{"any", "anyLast", "min", "max", "sum"}; String DataTypeDomainSimpleAggregateFunction::doGetName() const From 42b07c5ee980d51b9780aadd30821a174ec9d990 Mon Sep 17 00:00:00 2001 From: bgranvea Date: Fri, 29 Mar 2019 21:04:04 +0100 Subject: [PATCH 039/194] refactor to avoid dynamic_cast in data type serialization --- .../AggregatingSortedBlockInputStream.cpp | 6 +- .../{IDataTypeDomain.h => DataTypeCustom.h} | 67 ++++++++++--------- ...IPv6.cpp => DataTypeCustomIPv4AndIPv6.cpp} | 40 +++++------ ...DataTypeCustomSimpleAggregateFunction.cpp} | 33 ++------- ...> DataTypeCustomSimpleAggregateFunction.h} | 13 ++-- ...DataTypeCustomSimpleTextSerialization.cpp} | 26 +++---- ...> DataTypeCustomSimpleTextSerialization.h} | 8 +-- dbms/src/DataTypes/DataTypeFactory.cpp | 10 +-- dbms/src/DataTypes/DataTypeFactory.h | 15 ++--- dbms/src/DataTypes/IDataType.cpp | 63 ++++++++--------- dbms/src/DataTypes/IDataType.h | 20 +++--- 11 files changed, 139 insertions(+), 162 deletions(-) rename dbms/src/DataTypes/{IDataTypeDomain.h => DataTypeCustom.h} (62%) rename dbms/src/DataTypes/{DataTypeDomainIPv4AndIPv6.cpp => DataTypeCustomIPv4AndIPv6.cpp} (62%) rename dbms/src/DataTypes/{DataTypeDomainSimpleAggregateFunction.cpp => DataTypeCustomSimpleAggregateFunction.cpp} (81%) rename dbms/src/DataTypes/{DataTypeDomainSimpleAggregateFunction.h => DataTypeCustomSimpleAggregateFunction.h} (67%) rename dbms/src/DataTypes/{DataTypeDomainWithSimpleSerialization.cpp => DataTypeCustomSimpleTextSerialization.cpp} (73%) rename dbms/src/DataTypes/{DataTypeDomainWithSimpleSerialization.h => DataTypeCustomSimpleTextSerialization.h} (89%) diff --git a/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp b/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp index 1be85f7e1b8..f093e47e640 100644 --- a/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp +++ b/dbms/src/DataStreams/AggregatingSortedBlockInputStream.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include namespace DB @@ -24,7 +24,7 @@ AggregatingSortedBlockInputStream::AggregatingSortedBlockInputStream( ColumnWithTypeAndName & column = header.safeGetByPosition(i); /// We leave only states of aggregate functions. - if (!dynamic_cast(column.type.get()) && !findSimpleAggregateFunction(column.type)) + if (!dynamic_cast(column.type.get()) && !dynamic_cast(column.type->getCustomName())) { column_numbers_not_to_aggregate.push_back(i); continue; @@ -42,7 +42,7 @@ AggregatingSortedBlockInputStream::AggregatingSortedBlockInputStream( continue; } - if (auto simple_aggr = findSimpleAggregateFunction(column.type)) + if (auto simple_aggr = dynamic_cast(column.type->getCustomName())) { // simple aggregate function SimpleAggregateDescription desc{simple_aggr->getFunction(), i}; diff --git a/dbms/src/DataTypes/IDataTypeDomain.h b/dbms/src/DataTypes/DataTypeCustom.h similarity index 62% rename from dbms/src/DataTypes/IDataTypeDomain.h rename to dbms/src/DataTypes/DataTypeCustom.h index a840964d28a..93882361e20 100644 --- a/dbms/src/DataTypes/IDataTypeDomain.h +++ b/dbms/src/DataTypes/DataTypeCustom.h @@ -1,8 +1,8 @@ #pragma once +#include #include #include -#include namespace DB { @@ -12,45 +12,21 @@ class WriteBuffer; struct FormatSettings; class IColumn; -/** Allow to customize an existing data type and set a different name. Derived class IDataTypeDomainCustomSerialization allows - * further customization of serialization/deserialization methods. See use in IPv4 and IPv6 data type domains. - * - * IDataTypeDomain can be chained for further delegation (only for getName for the moment). +/** Allow to customize an existing data type and set a different name and/or text serialization/deserialization methods. + * See use in IPv4 and IPv6 data types, and also in SimpleAggregateFunction. */ -class IDataTypeDomain +class IDataTypeCustomName { -private: - mutable DataTypeDomainPtr delegate; - public: - virtual ~IDataTypeDomain() {} + virtual ~IDataTypeCustomName() {} - String getName() const - { - if (delegate) - return delegate->getName(); - else - return doGetName(); - } - - void appendDomain(DataTypeDomainPtr delegate_) const - { - if (delegate == nullptr) - delegate = std::move(delegate_); - else - delegate->appendDomain(std::move(delegate_)); - } - - const IDataTypeDomain * getDomain() const { return delegate.get(); } - -protected: - virtual String doGetName() const = 0; + virtual String getName() const = 0; }; -class IDataTypeDomainCustomSerialization : public IDataTypeDomain +class IDataTypeCustomTextSerialization { public: - virtual ~IDataTypeDomainCustomSerialization() {} + virtual ~IDataTypeCustomTextSerialization() {} /** Text serialization for displaying on a terminal or saving into a text file, and the like. * Without escaping or quoting. @@ -82,4 +58,31 @@ public: virtual void serializeTextXML(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const = 0; }; +using DataTypeCustomNamePtr = std::unique_ptr; +using DataTypeCustomTextSerializationPtr = std::unique_ptr; + +/** Describe a data type customization + */ +struct DataTypeCustomDesc +{ + DataTypeCustomNamePtr name; + DataTypeCustomTextSerializationPtr text_serialization; + + DataTypeCustomDesc(DataTypeCustomNamePtr name_, DataTypeCustomTextSerializationPtr text_serialization_) + : name(std::move(name_)), text_serialization(std::move(text_serialization_)) {} +}; + +using DataTypeCustomDescPtr = std::unique_ptr; + +/** A simple implementation of IDataTypeCustomName + */ +class DataTypeCustomFixedName : public IDataTypeCustomName +{ +private: + String name; +public: + DataTypeCustomFixedName(String name_) : name(name_) {} + String getName() const override { return name; } +}; + } // namespace DB diff --git a/dbms/src/DataTypes/DataTypeDomainIPv4AndIPv6.cpp b/dbms/src/DataTypes/DataTypeCustomIPv4AndIPv6.cpp similarity index 62% rename from dbms/src/DataTypes/DataTypeDomainIPv4AndIPv6.cpp rename to dbms/src/DataTypes/DataTypeCustomIPv4AndIPv6.cpp index f57a6167d3d..8d12a9847db 100644 --- a/dbms/src/DataTypes/DataTypeDomainIPv4AndIPv6.cpp +++ b/dbms/src/DataTypes/DataTypeCustomIPv4AndIPv6.cpp @@ -1,9 +1,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include @@ -20,20 +20,15 @@ namespace ErrorCodes namespace { -class DataTypeDomainIPv4 : public DataTypeDomainWithSimpleSerialization +class DataTypeCustomIPv4Serialization : public DataTypeCustomSimpleTextSerialization { public: - String doGetName() const override - { - return "IPv4"; - } - void serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override { const auto col = checkAndGetColumn(&column); if (!col) { - throw Exception(getName() + " domain can only serialize columns of type UInt32." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); + throw Exception("IPv4 type can only serialize columns of type UInt32." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); } char buffer[IPV4_MAX_TEXT_LENGTH + 1] = {'\0'}; @@ -48,7 +43,7 @@ public: ColumnUInt32 * col = typeid_cast(&column); if (!col) { - throw Exception(getName() + " domain can only deserialize columns of type UInt32." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); + throw Exception("IPv4 type can only deserialize columns of type UInt32." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); } char buffer[IPV4_MAX_TEXT_LENGTH + 1] = {'\0'}; @@ -63,20 +58,16 @@ public: } }; -class DataTypeDomainIPv6 : public DataTypeDomainWithSimpleSerialization +class DataTypeCustomIPv6Serialization : public DataTypeCustomSimpleTextSerialization { public: - String doGetName() const override - { - return "IPv6"; - } void serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override { const auto col = checkAndGetColumn(&column); if (!col) { - throw Exception(getName() + " domain can only serialize columns of type FixedString(16)." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); + throw Exception("IPv6 type domain can only serialize columns of type FixedString(16)." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); } char buffer[IPV6_MAX_TEXT_LENGTH + 1] = {'\0'}; @@ -91,7 +82,7 @@ public: ColumnFixedString * col = typeid_cast(&column); if (!col) { - throw Exception(getName() + " domain can only deserialize columns of type FixedString(16)." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); + throw Exception("IPv6 type domain can only deserialize columns of type FixedString(16)." + column.getName(), ErrorCodes::ILLEGAL_COLUMN); } char buffer[IPV6_MAX_TEXT_LENGTH + 1] = {'\0'}; @@ -100,7 +91,7 @@ public: std::string ipv6_value(IPV6_BINARY_LENGTH, '\0'); if (!parseIPv6(buffer, reinterpret_cast(ipv6_value.data()))) { - throw Exception("Invalid " + getName() + " value.", ErrorCodes::CANNOT_PARSE_DOMAIN_VALUE_FROM_STRING); + throw Exception("Invalid IPv6 value.", ErrorCodes::CANNOT_PARSE_DOMAIN_VALUE_FROM_STRING); } col->insertString(ipv6_value); @@ -111,8 +102,17 @@ public: void registerDataTypeDomainIPv4AndIPv6(DataTypeFactory & factory) { - factory.registerDataTypeDomain("IPv4", [] { return std::make_pair(DataTypeFactory::instance().get("UInt32"), std::make_unique()); }); - factory.registerDataTypeDomain("IPv6", [] { return std::make_pair(DataTypeFactory::instance().get("FixedString(16)"), std::make_unique()); }); + factory.registerSimpleDataTypeCustom("IPv4", [] + { + return std::make_pair(DataTypeFactory::instance().get("UInt32"), + std::make_unique(std::make_unique("IPv4"), std::make_unique())); + }); + + factory.registerSimpleDataTypeCustom("IPv6", [] + { + return std::make_pair(DataTypeFactory::instance().get("FixedString(16)"), + std::make_unique(std::make_unique("IPv6"), std::make_unique())); + }); } } // namespace DB diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeCustomSimpleAggregateFunction.cpp similarity index 81% rename from dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp rename to dbms/src/DataTypes/DataTypeCustomSimpleAggregateFunction.cpp index 82e3b873f5e..2cb0f87facd 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeCustomSimpleAggregateFunction.cpp @@ -5,7 +5,7 @@ #include -#include +#include #include #include #include @@ -33,7 +33,7 @@ namespace ErrorCodes static const std::vector supported_functions{"any", "anyLast", "min", "max", "sum"}; -String DataTypeDomainSimpleAggregateFunction::doGetName() const +String DataTypeCustomSimpleAggregateFunction::getName() const { std::stringstream stream; stream << "SimpleAggregateFunction(" << function->getName(); @@ -58,7 +58,7 @@ String DataTypeDomainSimpleAggregateFunction::doGetName() const } -static std::pair create(const ASTPtr & arguments) +static std::pair create(const ASTPtr & arguments) { String function_name; AggregateFunctionPtr function; @@ -117,7 +117,6 @@ static std::pair create(const ASTPtr & arguments } DataTypePtr storage_type = DataTypeFactory::instance().get(argument_types[0]->getName()); - DataTypeDomainPtr domain = std::make_unique(function, argument_types, params_row); if (!function->getReturnType()->equals(*removeLowCardinality(storage_type))) { @@ -125,32 +124,14 @@ static std::pair create(const ASTPtr & arguments ErrorCodes::BAD_ARGUMENTS); } - return std::make_pair(storage_type, std::move(domain)); + DataTypeCustomNamePtr custom_name = std::make_unique(function, argument_types, params_row); + + return std::make_pair(storage_type, std::make_unique(std::move(custom_name), nullptr)); } -static const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(const IDataTypeDomain * domain) -{ - if (domain == nullptr) - return nullptr; - - if (auto simple_aggr = dynamic_cast(domain)) - return simple_aggr; - - if (domain->getDomain() != nullptr) - return findSimpleAggregateFunction(domain->getDomain()); - - return nullptr; -} - -const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(DataTypePtr dataType) -{ - return findSimpleAggregateFunction(dataType->getDomain()); -} - - void registerDataTypeDomainSimpleAggregateFunction(DataTypeFactory & factory) { - factory.registerDataTypeDomain("SimpleAggregateFunction", create); + factory.registerDataTypeCustom("SimpleAggregateFunction", create); } } diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h b/dbms/src/DataTypes/DataTypeCustomSimpleAggregateFunction.h similarity index 67% rename from dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h rename to dbms/src/DataTypes/DataTypeCustomSimpleAggregateFunction.h index 98989eeac11..3e82b546903 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.h +++ b/dbms/src/DataTypes/DataTypeCustomSimpleAggregateFunction.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include @@ -21,10 +21,10 @@ namespace DB * SimpleAggregateFunction(anyLast, LowCardinality(Nullable(String))) * SimpleAggregateFunction(anyLast, IPv4) * - * Technically, a standard IDataType is instanciated and a DataTypeDomainSimpleAggregateFunction is added as domain. + * Technically, a standard IDataType is instanciated and customized with IDataTypeCustomName and DataTypeCustomDesc. */ -class DataTypeDomainSimpleAggregateFunction : public IDataTypeDomain +class DataTypeCustomSimpleAggregateFunction : public IDataTypeCustomName { private: const AggregateFunctionPtr function; @@ -32,14 +32,11 @@ private: const Array parameters; public: - DataTypeDomainSimpleAggregateFunction(const AggregateFunctionPtr & function_, const DataTypes & argument_types_, const Array & parameters_) + DataTypeCustomSimpleAggregateFunction(const AggregateFunctionPtr & function_, const DataTypes & argument_types_, const Array & parameters_) : function(function_), argument_types(argument_types_), parameters(parameters_) {} const AggregateFunctionPtr getFunction() const { return function; } - String doGetName() const override; + String getName() const override; }; -/// recursively follow data type domain to find a DataTypeDomainSimpleAggregateFunction -const DataTypeDomainSimpleAggregateFunction * findSimpleAggregateFunction(DataTypePtr dataType); - } diff --git a/dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.cpp b/dbms/src/DataTypes/DataTypeCustomSimpleTextSerialization.cpp similarity index 73% rename from dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.cpp rename to dbms/src/DataTypes/DataTypeCustomSimpleTextSerialization.cpp index 12b1837be1f..44ce27a6e88 100644 --- a/dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.cpp +++ b/dbms/src/DataTypes/DataTypeCustomSimpleTextSerialization.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -9,7 +9,7 @@ namespace { using namespace DB; -static String serializeToString(const DataTypeDomainWithSimpleSerialization & domain, const IColumn & column, size_t row_num, const FormatSettings & settings) +static String serializeToString(const DataTypeCustomSimpleTextSerialization & domain, const IColumn & column, size_t row_num, const FormatSettings & settings) { WriteBufferFromOwnString buffer; domain.serializeText(column, row_num, buffer, settings); @@ -17,7 +17,7 @@ static String serializeToString(const DataTypeDomainWithSimpleSerialization & do return buffer.str(); } -static void deserializeFromString(const DataTypeDomainWithSimpleSerialization & domain, IColumn & column, const String & s, const FormatSettings & settings) +static void deserializeFromString(const DataTypeCustomSimpleTextSerialization & domain, IColumn & column, const String & s, const FormatSettings & settings) { ReadBufferFromString istr(s); domain.deserializeText(column, istr, settings); @@ -28,59 +28,59 @@ static void deserializeFromString(const DataTypeDomainWithSimpleSerialization & namespace DB { -DataTypeDomainWithSimpleSerialization::~DataTypeDomainWithSimpleSerialization() +DataTypeCustomSimpleTextSerialization::~DataTypeCustomSimpleTextSerialization() { } -void DataTypeDomainWithSimpleSerialization::serializeTextEscaped(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::serializeTextEscaped(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { writeEscapedString(serializeToString(*this, column, row_num, settings), ostr); } -void DataTypeDomainWithSimpleSerialization::deserializeTextEscaped(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::deserializeTextEscaped(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { String str; readEscapedString(str, istr); deserializeFromString(*this, column, str, settings); } -void DataTypeDomainWithSimpleSerialization::serializeTextQuoted(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::serializeTextQuoted(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { writeQuotedString(serializeToString(*this, column, row_num, settings), ostr); } -void DataTypeDomainWithSimpleSerialization::deserializeTextQuoted(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::deserializeTextQuoted(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { String str; readQuotedString(str, istr); deserializeFromString(*this, column, str, settings); } -void DataTypeDomainWithSimpleSerialization::serializeTextCSV(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::serializeTextCSV(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { writeCSVString(serializeToString(*this, column, row_num, settings), ostr); } -void DataTypeDomainWithSimpleSerialization::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { String str; readCSVString(str, istr, settings.csv); deserializeFromString(*this, column, str, settings); } -void DataTypeDomainWithSimpleSerialization::serializeTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::serializeTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { writeJSONString(serializeToString(*this, column, row_num, settings), ostr, settings); } -void DataTypeDomainWithSimpleSerialization::deserializeTextJSON(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::deserializeTextJSON(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { String str; readJSONString(str, istr); deserializeFromString(*this, column, str, settings); } -void DataTypeDomainWithSimpleSerialization::serializeTextXML(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const +void DataTypeCustomSimpleTextSerialization::serializeTextXML(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { writeXMLString(serializeToString(*this, column, row_num, settings), ostr); } diff --git a/dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.h b/dbms/src/DataTypes/DataTypeCustomSimpleTextSerialization.h similarity index 89% rename from dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.h rename to dbms/src/DataTypes/DataTypeCustomSimpleTextSerialization.h index 3ccb4091636..fb9be86d95f 100644 --- a/dbms/src/DataTypes/DataTypeDomainWithSimpleSerialization.h +++ b/dbms/src/DataTypes/DataTypeCustomSimpleTextSerialization.h @@ -1,6 +1,6 @@ #pragma once -#include +#include namespace DB { @@ -10,12 +10,12 @@ class WriteBuffer; struct FormatSettings; class IColumn; -/** Simple DataTypeDomain that uses serializeText/deserializeText +/** Simple IDataTypeCustomTextSerialization that uses serializeText/deserializeText * for all serialization and deserialization. */ -class DataTypeDomainWithSimpleSerialization : public IDataTypeDomainCustomSerialization +class DataTypeCustomSimpleTextSerialization : public IDataTypeCustomTextSerialization { public: - virtual ~DataTypeDomainWithSimpleSerialization() override; + virtual ~DataTypeCustomSimpleTextSerialization() override; // Methods that subclasses must override in order to get full serialization/deserialization support. virtual void serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override = 0; diff --git a/dbms/src/DataTypes/DataTypeFactory.cpp b/dbms/src/DataTypes/DataTypeFactory.cpp index a405075e884..8c4c899516a 100644 --- a/dbms/src/DataTypes/DataTypeFactory.cpp +++ b/dbms/src/DataTypes/DataTypeFactory.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include @@ -115,20 +115,20 @@ void DataTypeFactory::registerSimpleDataType(const String & name, SimpleCreator }, case_sensitiveness); } -void DataTypeFactory::registerDataTypeDomain(const String & family_name, CreatorWithDomain creator, CaseSensitiveness case_sensitiveness) +void DataTypeFactory::registerDataTypeCustom(const String & family_name, CreatorWithCustom creator, CaseSensitiveness case_sensitiveness) { registerDataType(family_name, [creator](const ASTPtr & ast) { auto res = creator(ast); - res.first->appendDomain(std::move(res.second)); + res.first->setCustomization(std::move(res.second)); return res.first; }, case_sensitiveness); } -void DataTypeFactory::registerDataTypeDomain(const String & name, SimpleCreatorWithDomain creator, CaseSensitiveness case_sensitiveness) +void DataTypeFactory::registerSimpleDataTypeCustom(const String &name, SimpleCreatorWithCustom creator, CaseSensitiveness case_sensitiveness) { - registerDataTypeDomain(name, [creator](const ASTPtr & /*ast*/) + registerDataTypeCustom(name, [creator](const ASTPtr & /*ast*/) { return creator(); }, case_sensitiveness); diff --git a/dbms/src/DataTypes/DataTypeFactory.h b/dbms/src/DataTypes/DataTypeFactory.h index e4a82b342d1..a6c714c1a0e 100644 --- a/dbms/src/DataTypes/DataTypeFactory.h +++ b/dbms/src/DataTypes/DataTypeFactory.h @@ -17,9 +17,6 @@ namespace DB class IDataType; using DataTypePtr = std::shared_ptr; -class IDataTypeDomain; -using DataTypeDomainPtr = std::unique_ptr; - /** Creates a data type by name of data type family and parameters. */ @@ -28,8 +25,8 @@ class DataTypeFactory final : public ext::singleton, public IFa private: using SimpleCreator = std::function; using DataTypesDictionary = std::unordered_map; - using CreatorWithDomain = std::function(const ASTPtr & parameters)>; - using SimpleCreatorWithDomain = std::function()>; + using CreatorWithCustom = std::function(const ASTPtr & parameters)>; + using SimpleCreatorWithCustom = std::function()>; public: DataTypePtr get(const String & full_name) const; @@ -42,11 +39,11 @@ public: /// Register a simple data type, that have no parameters. void registerSimpleDataType(const String & name, SimpleCreator creator, CaseSensitiveness case_sensitiveness = CaseSensitive); - /// Register a type family with a dynamic domain - void registerDataTypeDomain(const String & family_name, CreatorWithDomain creator, CaseSensitiveness case_sensitiveness = CaseSensitive); + /// Register a customized type family + void registerDataTypeCustom(const String & family_name, CreatorWithCustom creator, CaseSensitiveness case_sensitiveness = CaseSensitive); - /// Register a simple data type domain - void registerDataTypeDomain(const String & name, SimpleCreatorWithDomain creator, CaseSensitiveness case_sensitiveness = CaseSensitive); + /// Register a simple customized data type + void registerSimpleDataTypeCustom(const String & name, SimpleCreatorWithCustom creator, CaseSensitiveness case_sensitiveness = CaseSensitive); private: const Creator& findCreatorByName(const String & family_name) const; diff --git a/dbms/src/DataTypes/IDataType.cpp b/dbms/src/DataTypes/IDataType.cpp index 0270f1d7923..09c080f56cc 100644 --- a/dbms/src/DataTypes/IDataType.cpp +++ b/dbms/src/DataTypes/IDataType.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include @@ -23,8 +23,7 @@ namespace ErrorCodes extern const int DATA_TYPE_CANNOT_BE_PROMOTED; } -IDataType::IDataType() - : domain(nullptr) +IDataType::IDataType() : custom_name(nullptr), custom_text_serialization(nullptr) { } @@ -34,9 +33,9 @@ IDataType::~IDataType() String IDataType::getName() const { - if (domain) + if (custom_name) { - return domain->getName(); + return custom_name->getName(); } else { @@ -142,9 +141,9 @@ void IDataType::insertDefaultInto(IColumn & column) const void IDataType::serializeAsTextEscaped(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->serializeTextEscaped(column, row_num, ostr, settings); + custom_text_serialization->serializeTextEscaped(column, row_num, ostr, settings); } else { @@ -154,9 +153,9 @@ void IDataType::serializeAsTextEscaped(const IColumn & column, size_t row_num, W void IDataType::deserializeAsTextEscaped(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->deserializeTextEscaped(column, istr, settings); + custom_text_serialization->deserializeTextEscaped(column, istr, settings); } else { @@ -166,9 +165,9 @@ void IDataType::deserializeAsTextEscaped(IColumn & column, ReadBuffer & istr, co void IDataType::serializeAsTextQuoted(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->serializeTextQuoted(column, row_num, ostr, settings); + custom_text_serialization->serializeTextQuoted(column, row_num, ostr, settings); } else { @@ -178,9 +177,9 @@ void IDataType::serializeAsTextQuoted(const IColumn & column, size_t row_num, Wr void IDataType::deserializeAsTextQuoted(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->deserializeTextQuoted(column, istr, settings); + custom_text_serialization->deserializeTextQuoted(column, istr, settings); } else { @@ -190,9 +189,9 @@ void IDataType::deserializeAsTextQuoted(IColumn & column, ReadBuffer & istr, con void IDataType::serializeAsTextCSV(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) - { - ser_domain->serializeTextCSV(column, row_num, ostr, settings); + if (custom_text_serialization) + { + custom_text_serialization->serializeTextCSV(column, row_num, ostr, settings); } else { @@ -202,9 +201,9 @@ void IDataType::serializeAsTextCSV(const IColumn & column, size_t row_num, Write void IDataType::deserializeAsTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->deserializeTextCSV(column, istr, settings); + custom_text_serialization->deserializeTextCSV(column, istr, settings); } else { @@ -214,9 +213,9 @@ void IDataType::deserializeAsTextCSV(IColumn & column, ReadBuffer & istr, const void IDataType::serializeAsText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->serializeText(column, row_num, ostr, settings); + custom_text_serialization->serializeText(column, row_num, ostr, settings); } else { @@ -226,9 +225,9 @@ void IDataType::serializeAsText(const IColumn & column, size_t row_num, WriteBuf void IDataType::serializeAsTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->serializeTextJSON(column, row_num, ostr, settings); + custom_text_serialization->serializeTextJSON(column, row_num, ostr, settings); } else { @@ -238,9 +237,9 @@ void IDataType::serializeAsTextJSON(const IColumn & column, size_t row_num, Writ void IDataType::deserializeAsTextJSON(IColumn & column, ReadBuffer & istr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->deserializeTextJSON(column, istr, settings); + custom_text_serialization->deserializeTextJSON(column, istr, settings); } else { @@ -250,9 +249,9 @@ void IDataType::deserializeAsTextJSON(IColumn & column, ReadBuffer & istr, const void IDataType::serializeAsTextXML(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings & settings) const { - if (auto ser_domain = dynamic_cast(domain.get())) + if (custom_text_serialization) { - ser_domain->serializeTextXML(column, row_num, ostr, settings); + custom_text_serialization->serializeTextXML(column, row_num, ostr, settings); } else { @@ -260,12 +259,14 @@ void IDataType::serializeAsTextXML(const IColumn & column, size_t row_num, Write } } -void IDataType::appendDomain(DataTypeDomainPtr new_domain) const +void IDataType::setCustomization(DataTypeCustomDescPtr custom_desc_) const { - if (domain == nullptr) - domain = std::move(new_domain); - else - domain->appendDomain(std::move(new_domain)); + /// replace only if not null + if (custom_desc_->name) + custom_name = std::move(custom_desc_->name); + + if (custom_desc_->text_serialization) + custom_text_serialization = std::move(custom_desc_->text_serialization); } } diff --git a/dbms/src/DataTypes/IDataType.h b/dbms/src/DataTypes/IDataType.h index a95402bf20a..6446f8ada43 100644 --- a/dbms/src/DataTypes/IDataType.h +++ b/dbms/src/DataTypes/IDataType.h @@ -4,6 +4,7 @@ #include #include #include +#include namespace DB @@ -12,9 +13,6 @@ namespace DB class ReadBuffer; class WriteBuffer; -class IDataTypeDomain; -using DataTypeDomainPtr = std::unique_ptr; - class IDataType; struct FormatSettings; @@ -461,19 +459,19 @@ public: private: friend class DataTypeFactory; - /** Sets domain on existing DataType or append it to existing domain, can be considered as second phase - * of construction explicitly done by DataTypeFactory. + /** Customize this DataType */ - void appendDomain(DataTypeDomainPtr new_domain) const; + void setCustomization(DataTypeCustomDescPtr custom_desc_) const; private: - /** This is mutable to allow setting domain on `const IDataType` post construction, - * simplifying creation of domains for all types, without them even knowing - * of domain existence. + /** This is mutable to allow setting custom name and serialization on `const IDataType` post construction. */ - mutable DataTypeDomainPtr domain; + mutable DataTypeCustomNamePtr custom_name; + mutable DataTypeCustomTextSerializationPtr custom_text_serialization; + public: - const IDataTypeDomain * getDomain() const { return domain.get(); } + const IDataTypeCustomName * getCustomName() const { return custom_name.get(); } + const IDataTypeCustomTextSerialization * getCustomTextSerialization() const { return custom_text_serialization.get(); } }; From 35a266c96a9451336431b3de43806d58165fdaa0 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Tue, 9 Apr 2019 00:01:10 +0300 Subject: [PATCH 040/194] linear regression tests --- .../AggregateFunctionMLMethod.cpp | 53 +- .../AggregateFunctionMLMethod.h | 202 ++---- .../0_stateless/00950_ml_test.reference | 302 +-------- .../queries/0_stateless/00950_ml_test.sql | 8 +- .../0_stateless/00951_ml_test.reference | 96 +-- .../queries/0_stateless/00951_ml_test.sql | 7 +- .../queries/0_stateless/00952_ml_test.sql | 2 +- .../0_stateless/00953_dataset_test.reference | 1 + ...955_ml_test.sql => 00953_dataset_test.sql} | 6 +- .../0_stateless/00953_ml_test.good_reference | 580 ------------------ .../0_stateless/00953_ml_test.reference | 580 ------------------ .../00953_ml_test.rock_auc_reference | 1 - .../queries/0_stateless/00953_ml_test.sql | 25 - .../0_stateless/00954_ml_test.reference | 2 +- .../queries/0_stateless/00954_ml_test.sql | 6 +- .../0_stateless/00955_ml_test.reference | 1 - .../0_stateless/00960_dataset_test.sql | 22 - 17 files changed, 89 insertions(+), 1805 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00953_dataset_test.reference rename dbms/tests/queries/0_stateless/{00955_ml_test.sql => 00953_dataset_test.sql} (97%) delete mode 100644 dbms/tests/queries/0_stateless/00953_ml_test.good_reference delete mode 100644 dbms/tests/queries/0_stateless/00953_ml_test.reference delete mode 100644 dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference delete mode 100644 dbms/tests/queries/0_stateless/00953_ml_test.sql delete mode 100644 dbms/tests/queries/0_stateless/00955_ml_test.reference delete mode 100644 dbms/tests/queries/0_stateless/00960_dataset_test.sql diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index bd3aa51c2e2..7a4d5d731d2 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -19,6 +19,9 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (parameters.size() > 4) throw Exception("Aggregate function " + name + " requires at most four parameters", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + if (argument_types.size() < 2) + throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + for (size_t i = 0; i < argument_types.size(); ++i) { if (!WhichDataType(argument_types[i]).isFloat64()) @@ -28,58 +31,58 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } Float64 learning_rate = Float64(0.01); + Float64 l2_reg_coef = Float64(0.01); UInt32 batch_size = 1; - std::shared_ptr gc; std::shared_ptr wu; + std::shared_ptr gc; + if (!parameters.empty()) { learning_rate = applyVisitor(FieldVisitorConvertToNumber(), parameters[0]); } if (parameters.size() > 1) { - batch_size = applyVisitor(FieldVisitorConvertToNumber(), parameters[1]); - - } - - if (std::is_same::value) - { - gc = std::make_shared(); - } else if (std::is_same::value) - { - gc = std::make_shared(); - } else - { - throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + l2_reg_coef = applyVisitor(FieldVisitorConvertToNumber(), parameters[1]); } if (parameters.size() > 2) { - if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{1.0}) + batch_size = applyVisitor(FieldVisitorConvertToNumber(), parameters[2]); + + } + if (parameters.size() > 3) + { + if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{1.0}) { wu = std::make_shared(); - } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{2.0}) + } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{2.0}) { wu = std::make_shared(); - } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{3.0}) + } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{3.0}) { wu = std::make_shared(); - } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[2]) == Float64{4.0}) - { - /// Adam should be here - wu = std::make_shared(); } else { - throw Exception("Such weights updater is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + throw Exception("Invalid parameter for weights updater", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } } else { wu = std::make_unique(); } - if (argument_types.size() < 2) - throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + if (std::is_same::value) + { + gc = std::make_shared(); + } else if (std::is_same::value) + { + gc = std::make_shared(); + } else + { + throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + } - return std::make_shared(argument_types.size() - 1, gc, wu, learning_rate, batch_size, argument_types, parameters); + + return std::make_shared(argument_types.size() - 1, gc, wu, learning_rate, l2_reg_coef, batch_size, argument_types, parameters); } } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 6bceb2ee8a8..f17572a5928 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -28,8 +28,7 @@ namespace ErrorCodes } /** -IGradientComputer class computes gradient according to its loss function -and stores mini-batch +GradientComputer class computes gradient according to its loss function */ class IGradientComputer { @@ -39,16 +38,12 @@ public: virtual ~IGradientComputer() = default; - /// Adds to batch_gradient computed gradient in point (weigts, bias) using corresponding loss function + /// Adds computed gradient in new point (weights, bias) to batch_gradient virtual void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, - Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) = 0; + Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) = 0; - virtual Float64 predict(const std::vector &predict_feature, - const std::vector &weights, - Float64 bias) const = 0; - - /// Now we should use predict_for_all function instead of predict - virtual void predict_for_all(ColumnVector::Container &container, + /// Now we should use predict_block function instead of predict + virtual void predict_block(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments, const std::vector &weights, Float64 bias) const = 0; @@ -62,7 +57,7 @@ public: {} void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, - Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) override + Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) override { Float64 derivative = (target - bias); for (size_t i = 0; i < weights.size(); ++i) @@ -75,27 +70,12 @@ public: for (size_t i = 0; i < weights.size(); ++i) { (*batch_gradient)[i] += - derivative * static_cast &>(*columns[i]).getData()[row_num]; + derivative * static_cast &>(*columns[i]).getData()[row_num] + - 2 * l2_reg_coef * weights[i]; } } - Float64 predict(const std::vector &predict_feature, - const std::vector &weights, Float64 bias) const override - { - /// не обновляем веса при предикте, т.к. это может замедлить предсказание - /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче - - Float64 res{0.0}; - for (size_t i = 0; i < predict_feature.size(); ++i) - { - res += predict_feature[i] * weights[i]; - } - res += bias; - - return res; - } - - void predict_for_all(ColumnVector::Container &container, + void predict_block(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments, const std::vector &weights, Float64 bias) const override @@ -133,7 +113,7 @@ public: {} void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, - Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) override + Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) override { Float64 derivative = bias; for (size_t i = 0; i < weights.size(); ++i) @@ -148,28 +128,12 @@ public: { (*batch_gradient)[i] += learning_rate * target * - static_cast &>(*columns[i]).getData()[row_num] - / (derivative + 1); + static_cast &>(*columns[i]).getData()[row_num] / (derivative + 1) + - 2 * l2_reg_coef * weights[i]; } } - Float64 predict(const std::vector &predict_feature, - const std::vector &weights, Float64 bias) const override - { - /// не обновляем веса при предикте, т.к. это может замедлить предсказание - /// однако можно например обновлять их при каждом мердже не зависимо от того, сколько элементнов в батче - - Float64 res{0.0}; - for (size_t i = 0; i < predict_feature.size(); ++i) - { - res += predict_feature[i] * weights[i]; - } - res += bias; - res = 1 / (1 + exp(-res)); - return res; - } - - void predict_for_all(ColumnVector::Container & container, + void predict_block(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override @@ -199,8 +163,8 @@ public: /** -* IWeightsUpdater class defines the way to update current state -* and uses GradientComputer on each iteration +* IWeightsUpdater class defines the way to update current weights +* and uses class GradientComputer on each iteration */ class IWeightsUpdater { @@ -209,9 +173,9 @@ public: virtual void add_to_batch(std::vector * batch_gradient, std::shared_ptr gc, const std::vector & weights, Float64 bias, - Float64 learning_rate, Float64 target, const IColumn **columns, size_t row_num) + Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) { - gc->compute(batch_gradient, weights, bias, learning_rate, target, columns, row_num); + gc->compute(batch_gradient, weights, bias, learning_rate, l2_reg_coef, target, columns, row_num); } virtual void update(UInt32 batch_size, @@ -313,7 +277,7 @@ public: void add_to_batch(std::vector * batch_gradient, std::shared_ptr gc, const std::vector & weights, Float64 bias, - Float64 learning_rate, Float64 target, const IColumn ** columns, size_t row_num) override + Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn ** columns, size_t row_num) override { if (accumulated_gradient.empty()) { @@ -327,7 +291,7 @@ public: } auto shifted_bias = bias + accumulated_gradient[weights.size()] * alpha_; - gc->compute(batch_gradient, shifted_weights, shifted_bias, learning_rate, target, columns, row_num); + gc->compute(batch_gradient, shifted_weights, shifted_bias, learning_rate, l2_reg_coef, target, columns, row_num); } void update(UInt32 batch_size, @@ -376,75 +340,8 @@ private: }; -// TODO: проверить после изменения логики моментума -/* -class Adam : public IWeightsUpdater -{ -public: - Adam() - {} - - Adam(Float64 betta1, Float64 betta2) : betta1_(betta1), betta2_(betta2), betta1t_(betta1), betta2t_(betta2) - {} - - void update(UInt32 cur_batch, - std::vector & weights, Float64 & bias, - std::vector * batch_gradient) override - { - if (mt_.size() == 0) - { - mt_.resize(batch_gradient.size(), Float64{0.0}); - vt_.resize(batch_gradient.size(), Float64{0.0}); - } - Float64 eps = 0.01; - for (size_t i = 0; i < batch_gradient.size(); ++i) - { - mt_[i] = mt_[i] * betta1_ + (1 - betta1_) * batch_gradient[i]; - vt_[i] = vt_[i] * betta2_ + (1 - betta2_) * batch_gradient[i] * batch_gradient[i]; - if (t < 8) - { - mt_[i] = mt_[i] / (1 - betta1t_); - betta1t_ *= betta1_; - } - if (t < 850) - { - vt_[i] = vt_[i] / (1 - betta2t_); - betta2t_ *= betta2_; - } - } - for (size_t i = 0; i < weights.size(); ++i) - { - weights[i] += (mt_[i] / (sqrt(vt_[i] + eps))) / cur_batch; - } - bias += (mt_[weights.size()] / (sqrt(vt_[weights.size()] + eps))) / cur_batch; - t += 1; - } - - virtual void merge(const IWeightsUpdater &rhs, Float64 frac, Float64 rhs_frac) override - { - auto &adam_rhs = static_cast(rhs); - for (size_t i = 0; i < mt_.size(); ++i) - { - mt_[i] = mt_[i] * frac + adam_rhs.mt_[i] * rhs_frac; - vt_[i] = vt_[i] * frac + adam_rhs.vt_[i] * rhs_frac; - } - } - -private: - Float64 betta1_{0.2}; - Float64 betta2_{0.3}; - Float64 betta1t_{0.3}; - Float64 betta2t_{0.3}; - UInt32 t = 0; - std::vector mt_; - std::vector vt_; -}; - */ - - /** * LinearModelData is a class which manages current state of learning -* and is stored as AggregateFunctionState */ class LinearModelData { @@ -453,11 +350,13 @@ public: {} LinearModelData(Float64 learning_rate, + Float64 l2_reg_coef, UInt32 param_num, UInt32 batch_capacity, std::shared_ptr gc, std::shared_ptr wu) : learning_rate(learning_rate), + l2_reg_coef(l2_reg_coef), batch_capacity(batch_capacity), batch_size(0), gradient_computer(std::move(gc)), @@ -474,7 +373,7 @@ public: /// Here we have columns + 1 as first column corresponds to target value, and others - to features weights_updater->add_to_batch(&gradient_batch, gradient_computer, - weights, bias, learning_rate, target, columns + 1, row_num); + weights, bias, learning_rate, l2_reg_coef, target, columns + 1, row_num); ++batch_size; if (batch_size == batch_capacity) @@ -489,20 +388,18 @@ public: return; update_state(); - /// нельзя обновить из-за константости -// rhs.update_weights(); + /// can't update rhs state because it's constant - Float64 frac = static_cast(iter_num) / (iter_num + rhs.iter_num); - Float64 rhs_frac = static_cast(rhs.iter_num) / (iter_num + rhs.iter_num); + Float64 frac = (static_cast(iter_num) * iter_num) / (iter_num * iter_num + rhs.iter_num * rhs.iter_num); for (size_t i = 0; i < weights.size(); ++i) { - weights[i] = weights[i] * frac + rhs.weights[i] * rhs_frac; + weights[i] = weights[i] * frac + rhs.weights[i] * (1 - frac); } + bias = bias * frac + rhs.bias * (1 - frac); - bias = bias * frac + rhs.bias * rhs_frac; iter_num += rhs.iter_num; - weights_updater->merge(*rhs.weights_updater, frac, rhs_frac); + weights_updater->merge(*rhs.weights_updater, frac, 1 - frac); } void write(WriteBuffer &buf) const @@ -525,21 +422,9 @@ public: weights_updater->read(buf); } - Float64 predict(const std::vector &predict_feature) const + void predict_block(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments) const { - /// не обновляем веса при предикте, т.к. это может замедлить предсказание - /// однако можно например обновлять их при каждом мердже независимо от того, сколько элементнов в батче -// if (cur_batch) -// { -// update_weights(); -// } - - return gradient_computer->predict(predict_feature, weights, bias); - } - - void predict_for_all(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments) const - { - gradient_computer->predict_for_all(container, block, arguments, weights, bias); + gradient_computer->predict_block(container, block, arguments, weights, bias); } private: @@ -547,6 +432,7 @@ private: Float64 bias{0.0}; Float64 learning_rate; + Float64 l2_reg_coef; UInt32 batch_capacity; UInt32 iter_num = 0; @@ -557,8 +443,8 @@ private: std::shared_ptr weights_updater; /** - * The function is called when we want to flush current batch and make a step with it - */ + * The function is called when we want to flush current batch and update our weights + */ void update_state() { if (batch_size == 0) @@ -587,12 +473,14 @@ public: std::shared_ptr gradient_computer, std::shared_ptr weights_updater, Float64 learning_rate, + Float64 l2_reg_coef, UInt32 batch_size, const DataTypes & argument_types, const Array & params) : IAggregateFunctionDataHelper>(argument_types, params), param_num(param_num), learning_rate(learning_rate), + l2_reg_coef(l2_reg_coef), batch_size(batch_size), gc(std::move(gradient_computer)), wu(std::move(weights_updater)) { @@ -605,7 +493,7 @@ public: void create(AggregateDataPtr place) const override { - new (place) Data(learning_rate, param_num, batch_size, gc, wu); + new (place) Data(learning_rate, l2_reg_coef, param_num, batch_size, gc, wu); } void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override @@ -613,10 +501,8 @@ public: this->data(place).add(columns, row_num); } - /// хочется не константный rhs void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override { - std::cout << "\nMERGING!!\n\n"; this->data(place).merge(this->data(rhs)); } @@ -632,8 +518,6 @@ public: void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments) const { - std::cout << "\nPREDICTING!!\n\n"; - if (arguments.size() != param_num + 1) throw Exception("Predict got incorrect number of arguments. Got: " + std::to_string(arguments.size()) + ". Required: " + std::to_string(param_num + 1), @@ -641,20 +525,7 @@ public: auto &column = dynamic_cast &>(to); - /// Так делали с одним предиктом, пока пусть побудет тут -// std::vector predict_features(arguments.size() - 1); -// for (size_t i = 1; i < arguments.size(); ++i) -// { -// const auto& element = (*block.getByPosition(arguments[i]).column)[row_num]; -// if (element.getType() != Field::Types::Float64) -// throw Exception("Prediction arguments must be values of type Float", -// ErrorCodes::BAD_ARGUMENTS); -// -//// predict_features[i - 1] = element.get(); -// } -// column.getData().push_back(this->data(place).predict(predict_features)); -// column.getData().push_back(this->data(place).predict_for_all()); - this->data(place).predict_for_all(column.getData(), block, arguments); + this->data(place).predict_block(column.getData(), block, arguments); } void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override @@ -669,6 +540,7 @@ public: private: UInt32 param_num; Float64 learning_rate; + Float64 l2_reg_coef; UInt32 batch_size; std::shared_ptr gc; std::shared_ptr wu; diff --git a/dbms/tests/queries/0_stateless/00950_ml_test.reference b/dbms/tests/queries/0_stateless/00950_ml_test.reference index 6326f98fcd1..6ed281c757a 100644 --- a/dbms/tests/queries/0_stateless/00950_ml_test.reference +++ b/dbms/tests/queries/0_stateless/00950_ml_test.reference @@ -1,300 +1,2 @@ --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 --67.00423606399804 +1 +1 diff --git a/dbms/tests/queries/0_stateless/00950_ml_test.sql b/dbms/tests/queries/0_stateless/00950_ml_test.sql index 0a009c29d29..b6a02893840 100644 --- a/dbms/tests/queries/0_stateless/00950_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00950_ml_test.sql @@ -8,10 +8,10 @@ CREATE TABLE IF NOT EXISTS test.defaults predict1 Float64, predict2 Float64 ) ENGINE = Memory; -insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); +insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 2.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 0.0, 2, 1.0)(target, param1, param2) as state from test.defaults; - -with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; +select ans < -61.374 and ans > -61.375 from +(with (select state from remote('127.0.0.1', test.model)) as model select evalMLMethod(model, predict1, predict2) as ans from remote('127.0.0.1', test.defaults)); diff --git a/dbms/tests/queries/0_stateless/00951_ml_test.reference b/dbms/tests/queries/0_stateless/00951_ml_test.reference index b636d351b84..f2599a746ac 100644 --- a/dbms/tests/queries/0_stateless/00951_ml_test.reference +++ b/dbms/tests/queries/0_stateless/00951_ml_test.reference @@ -1,92 +1,4 @@ -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 -0.014756373152892969 -0.9981703893717232 +0 +1 +1 +0 diff --git a/dbms/tests/queries/0_stateless/00951_ml_test.sql b/dbms/tests/queries/0_stateless/00951_ml_test.sql index 3bce8cc3085..9dbb7ece7fe 100644 --- a/dbms/tests/queries/0_stateless/00951_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00951_ml_test.sql @@ -10,7 +10,10 @@ CREATE TABLE IF NOT EXISTS test.defaults ) ENGINE = Memory; insert into test.defaults values (1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2) DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LogisticRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LogisticRegressionState(0.1, 0.0, 1.0, 1)(target, param1, param2) as state from test.defaults; +select ans < 1.1 and ans > 0.9 from +(with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) as ans from test.defaults limit 2); -with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; +select ans > -0.1 and ans < 0.1 from +(with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) as ans from test.defaults limit 2); diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.sql b/dbms/tests/queries/0_stateless/00952_ml_test.sql index 813131cf78d..94dea65ed55 100644 --- a/dbms/tests/queries/0_stateless/00952_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00952_ml_test.sql @@ -21,5 +21,5 @@ CREATE TABLE IF NOT EXISTS test.defaults ) ENGINE = Memory; insert into test.defaults values (1.76210664421617,1.7469706406568504,0.7988286239230257,1.0938642223599824,1.167321139201246,1.7648182796261376,0.909111664354187,0.92,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,-0.06763531281107672,0.7988286239230257,0.5966532121963541,1.167321139201246,0.4551512643242912,0.909111664354187,0.76,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.07046681268810527,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-1.0056311758200724,0.909111664354187,0.72,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,0.11933920911869125,0.909111664354187,0.8,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.24499761810756004,-0.7274920231630502,-0.952028633990455,-1.3921908284581592,-0.5042604443804907,-0.6530285178541898,-1.0999748867047898,0.65,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.1512488252480781,1.2520781078928702,1.674257252879766,1.0938642223599824,-0.5042604443804907,1.244309594057455,0.909111664354187,0.9,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,0.6101272780073337,-0.6698191206144725,0.909111664354187,0.75,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.7685900343659244,-1.057420378339037,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-1.1735372034228724,-1.0999748867047898,0.68,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-1.2921824506242887,-0.8924562007510436,-1.8274572629471952,-1.3921908284581592,-2.175842027962227,-1.0056311758200724,-1.0999748867047898,0.5,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.5403910062799865,0.09732886477691666,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.0018049897967303734,-1.0999748867047898,0.45,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.7149218116994412,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.3340070654088696,0.909111664354187,0.52,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.889452617118896,0.5922213975408968,0.7988286239230257,0.5966532121963541,1.167321139201246,0.6734291002079332,0.909111664354187,0.84,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.9767180198286235,0.7571855751288902,0.7988286239230257,0.5966532121963541,1.167321139201246,0.8413351278107333,0.909111664354187,0.78,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.8558554370756518,0.26229304236491,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.62,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,-1.618648166768315,-0.6698191206144725,0.909111664354187,0.61,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.24499761810756004,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.5019130930116695,-1.0999748867047898,0.54,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.016798590021622126,-0.06763531281107672,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,0.16971101739953035,-1.0999748867047898,0.66,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.1913293954410769,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.65,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.10406399273134952,0.4272572199529034,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,0.3376170450023333,-1.0999748867047898,0.63,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-1.2049170479145614,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.1661010378060696,-1.0999748867047898,0.62,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,-1.618648166768315,-1.1735372034228724,0.909111664354187,0.64,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.7149218116994412,1.087113930304877,0.7988286239230257,-0.3977688081309026,-1.618648166768315,-0.3340070654088696,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.9767180198286235,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.5129592382219361,0.909111664354187,0.94,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(1.5003104360869879,1.9119348182448437,1.674257252879766,1.5910752325236108,1.167321139201246,1.848771293427536,0.909111664354187,0.95,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(1.6748412415064426,1.9119348182448437,1.674257252879766,0.5966532121963541,0.052933416813421515,2.016677321030339,0.909111664354187,0.97,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(2.023902852345352,2.076898995832837,1.674257252879766,1.0938642223599824,1.167321139201246,1.680865265824736,0.909111664354187,0.94,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.4531256035702591,0.26229304236491,1.674257252879766,1.0938642223599824,0.052933416813421515,0.3376170450023333,-1.0999748867047898,0.76,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.6412440614631982,-1.5523129111030172,-0.952028633990455,-1.8894018386217877,-1.0614543055744028,-1.8451613138340752,0.909111664354187,0.44,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.9030402695923805,-2.377133799042984,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-2.348879396642477,-1.0999748867047898,0.46,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-0.5940592289464697,-1.3873487335150236,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-2.180973369039677,-1.0999748867047898,0.54,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.4667132560437435,-1.7172770886910105,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.8377251482172725,0.909111664354187,0.65,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.889452617118896,-0.7274920231630502,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.5019130930116695,0.909111664354187,0.74,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(1.8493720469258974,1.7469706406568504,0.7988286239230257,-0.3977688081309026,1.167321139201246,1.3450532106191362,0.909111664354187,0.91,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(2.023902852345352,1.087113930304877,1.674257252879766,0.5966532121963541,0.6101272780073337,1.680865265824736,0.909111664354187,0.9,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(1.2385142279578056,0.7571855751288902,1.674257252879766,0.5966532121963541,1.724515000395158,2.016677321030339,0.909111664354187,0.94,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.2785947981508043,0.4272572199529034,1.674257252879766,1.5910752325236108,1.724515000395158,1.0092411554135332,0.909111664354187,0.88,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.553978658753471,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.6101272780073337,-0.3340070654088696,-1.0999748867047898,0.64,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.4667132560437435,-0.39756366798706344,-1.8274572629471952,-2.386612848785416,-1.618648166768315,-1.3414432310256739,-1.0999748867047898,0.58,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-1.117651645204834,-0.39756366798706344,-1.8274572629471952,-0.3977688081309026,-2.175842027962227,-1.8451613138340752,-1.0999748867047898,0.52,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.8558554370756518,0.09732886477691666,-0.952028633990455,0.5966532121963541,0.052933416813421515,-1.5093492586284738,-1.0999748867047898,0.48,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.7685900343659244,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.46,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.07046681268810527,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6698191206144725,0.909111664354187,0.49,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.3322630208172874,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.1661010378060696,0.909111664354187,0.53,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.3257796306675331,1.582006463068857,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.8413351278107333,-1.0999748867047898,0.87,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.8021872144091686,0.9221497527168835,1.674257252879766,1.0938642223599824,0.6101272780073337,1.3450532106191362,0.909111664354187,0.91,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.4531256035702591,0.4272572199529034,1.674257252879766,1.5910752325236108,0.6101272780073337,0.8413351278107333,0.909111664354187,0.88,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.0639834225383509,1.087113930304877,1.674257252879766,0.5966532121963541,1.724515000395158,1.1771471830163363,0.909111664354187,0.86,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.9366374496356247,1.9119348182448437,1.674257252879766,1.0938642223599824,0.6101272780073337,1.848771293427536,-1.0999748867047898,0.89,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.36586020086053167,0.4272572199529034,-0.0766000050337147,0.09944220203272576,1.724515000395158,0.42157005880373183,0.909111664354187,0.82,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.889452617118896,0.5922213975408968,0.7988286239230257,-0.3977688081309026,0.6101272780073337,-0.3340070654088696,0.909111664354187,0.78,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.3322630208172874,-1.5523129111030172,-0.0766000050337147,-0.8949798182945309,1.167321139201246,-0.5019130930116695,0.909111664354187,0.76,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.41952842352701486,-1.2223845559270303,-0.952028633990455,-1.8894018386217877,0.052933416813421515,-1.1735372034228724,0.909111664354187,0.56,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.5003104360869879,1.4170422854808635,0.7988286239230257,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.78,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.6276564089897139,0.7571855751288902,0.7988286239230257,0.5966532121963541,-1.0614543055744028,-0.8377251482172725,0.909111664354187,0.72,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-1.0056311758200724,-1.0999748867047898,0.7,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.2785947981508043,-0.7274920231630502,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-1.5093492586284738,-1.0999748867047898,0.64,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.07046681268810527,-0.8924562007510436,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-2.013067341436875,-1.0999748867047898,0.64,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.6412440614631982,-1.3873487335150236,-0.952028633990455,0.5966532121963541,-1.618648166768315,-1.6772552862312753,-1.0999748867047898,0.46,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.4667132560437435,-1.3873487335150236,-1.8274572629471952,-0.3977688081309026,-1.618648166768315,-3.0205035070536796,0.909111664354187,0.36,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.5067938262367422,-0.5625278455750569,-0.952028633990455,-1.3921908284581592,-1.618648166768315,-0.5019130930116695,-1.0999748867047898,0.42,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.681324631656197,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.8377251482172725,-1.0999748867047898,0.48,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.8558554370756518,-1.057420378339037,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-0.6698191206144725,-1.0999748867047898,0.47,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.117651645204834,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.6698191206144725,0.909111664354187,0.54,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.15773221539783266,-0.06763531281107672,-0.952028633990455,0.5966532121963541,-0.5042604443804907,-0.1661010378060696,0.909111664354187,0.56,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.7149218116994412,0.5922213975408968,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.16971101739953035,-1.0999748867047898,0.52,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.09944220203272576,0.052933416813421515,0.5391042781256927,-1.0999748867047898,0.55,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.889452617118896,1.087113930304877,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.7070103057284927,-1.0999748867047898,0.61,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.07046681268810527,-0.06763531281107672,-0.952028633990455,0.09944220203272576,0.052933416813421515,0.06896740083785215,0.909111664354187,0.57,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.10406399273134952,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.6101272780073337,1.0428223609340956,0.909111664354187,0.68,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.9767180198286235,1.2520781078928702,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9420787443724145,0.909111664354187,0.78,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(1.3257796306675331,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.7480276768658578,0.909111664354187,0.94,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(1.6748412415064426,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,1.9495149099892173,0.909111664354187,0.96,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.36586020086053167,0.5922213975408968,1.674257252879766,1.5910752325236108,1.724515000395158,1.4290062244205346,0.909111664354187,0.93,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.24499761810756004,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.7405915112490521,0.909111664354187,0.84,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.24499761810756004,-0.2325994903990701,-0.0766000050337147,-0.3977688081309026,1.724515000395158,0.5055230726051333,-1.0999748867047898,0.74,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(1.0639834225383509,1.087113930304877,-0.952028633990455,-1.3921908284581592,0.6101272780073337,-0.06535742124438843,0.909111664354187,0.72,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.889452617118896,0.7571855751288902,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.20329222292009272,0.909111664354187,0.74,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.3794478533340162,-1.3873487335150236,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.6362379150939101,-1.0999748867047898,0.64,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.8157748668826532,-2.0472054438669973,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-1.777998902792955,0.909111664354187,0.44,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.990305672302108,-2.377133799042984,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-2.0802297524779956,-1.0999748867047898,0.46,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-0.972049970299513,0.909111664354187,0.5,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(2.023902852345352,2.076898995832837,0.7988286239230257,1.5910752325236108,1.724515000395158,1.5129592382219361,0.909111664354187,0.96,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.2785947981508043,0.4272572199529034,1.674257252879766,1.5910752325236108,1.167321139201246,1.0428223609340956,0.909111664354187,0.92,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.4531256035702591,1.2520781078928702,1.674257252879766,0.5966532121963541,1.167321139201246,1.2778907995780144,0.909111664354187,0.92,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(2.023902852345352,1.2520781078928702,1.674257252879766,1.0938642223599824,1.167321139201246,1.4290062244205346,0.909111664354187,0.94,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.1913293954410769,-0.7274920231630502,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.10254860635841155,-1.0999748867047898,0.76,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-0.15773221539783266,-0.2325994903990701,-0.0766000050337147,1.0938642223599824,0.052933416813421515,-0.30042585988831016,-1.0999748867047898,0.72,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.016798590021622126,-0.06763531281107672,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.535494298532232,-1.0999748867047898,0.66,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.24499761810756004,0.09732886477691666,-0.0766000050337147,1.0938642223599824,0.052933416813421515,-0.7705627371761508,-1.0999748867047898,0.64,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.07046681268810527,0.26229304236491,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.27045463396121155,0.909111664354187,0.74,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(0.10406399273134952,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.6101272780073337,-1.139955997902313,0.909111664354187,0.64,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.553978658753471,-1.7172770886910105,-0.0766000050337147,1.5910752325236108,0.052933416813421515,-1.5765116696695942,-1.0999748867047898,0.38,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.6412440614631982,-1.5523129111030172,-0.952028633990455,0.5966532121963541,-0.5042604443804907,-0.9552593675392334,-1.0999748867047898,0.34,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.3794478533340162,-1.7172770886910105,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-1.2071184089434333,0.909111664354187,0.44,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.2049170479145614,-1.3873487335150236,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898,0.36,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.117651645204834,-1.2223845559270303,0.7988286239230257,-1.8894018386217877,-1.0614543055744028,-1.2742808199845537,-1.0999748867047898,0.42,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.9431208397853792,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-1.0056311758200724,-1.0999748867047898,0.48,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(1.2385142279578056,2.076898995832837,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.6062666891668145,0.909111664354187,0.86,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(1.3257796306675331,1.9119348182448437,0.7988286239230257,1.5910752325236108,1.167321139201246,1.076403566454655,0.909111664354187,0.9,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(0.5403910062799865,0.9221497527168835,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.47194186708457386,0.909111664354187,0.79,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.4531256035702591,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.2332634488471884,0.909111664354187,0.71,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.8041439426967131,-1.0999748867047898,0.64,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.24499761810756004,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.052933416813421515,-0.585866106813071,-1.0999748867047898,0.62,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.016798590021622126,-0.5625278455750569,-0.952028633990455,1.0938642223599824,0.6101272780073337,-0.2164728460869087,-1.0999748867047898,0.57,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.8021872144091686,0.7571855751288902,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.7573821140093348,0.909111664354187,0.74,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.07046681268810527,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.30403583948177093,0.909111664354187,0.69,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,1.167321139201246,0.9756599498929738,0.909111664354187,0.87,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.8493720469258974,1.582006463068857,0.7988286239230257,0.09944220203272576,1.167321139201246,1.4457968271808173,0.909111664354187,0.91,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.2385142279578056,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.3114720050985766,0.909111664354187,0.93,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.117651645204834,-0.7274920231630502,1.674257252879766,1.5910752325236108,0.6101272780073337,0.06896740083785215,-1.0999748867047898,0.68,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.0303862424951067,0.09732886477691666,1.674257252879766,-0.3977688081309026,-0.5042604443804907,-0.199682243326629,-1.0999748867047898,0.61,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.36586020086053167,0.26229304236491,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.13612981187897094,0.909111664354187,0.69,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.3794478533340162,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.4347506819705508,0.909111664354187,0.62,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(0.2785947981508043,0.4272572199529034,-0.952028633990455,0.5966532121963541,0.052933416813421515,-0.06535742124438843,-1.0999748867047898,0.72,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5067938262367422,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.2500540516074711,0.909111664354187,0.59,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,0.7988286239230257,1.0938642223599824,1.167321139201246,0.7405915112490521,0.909111664354187,0.66,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.553978658753471,-0.8924562007510436,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.03538619531728977,-1.0999748867047898,0.56,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-2.3393672831410175,-0.5625278455750569,0.7988286239230257,-1.3921908284581592,-1.0614543055744028,-1.9123237248751956,-1.0999748867047898,0.45,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.8157748668826532,-1.3873487335150236,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-2.214554574560236,-1.0999748867047898,0.47,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(0.889452617118896,-0.5625278455750569,1.674257252879766,-0.3977688081309026,0.052933416813421515,0.4047794560434521,0.909111664354187,0.71,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,1.6137028547836172,0.909111664354187,0.94,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(1.5003104360869879,1.9119348182448437,1.674257252879766,1.0938642223599824,1.167321139201246,1.4793780327013768,0.909111664354187,0.94,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,0.7988286239230257,-1.8894018386217877,-1.0614543055744028,-0.40116947644999135,-1.0999748867047898,0.57,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.7685900343659244,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.6362379150939101,-1.0999748867047898,0.61,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.3794478533340162,-0.2325994903990701,0.7988286239230257,-0.8949798182945309,-0.5042604443804907,-0.2164728460869087,-1.0999748867047898,0.57,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.10254860635841155,0.909111664354187,0.64,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.5403910062799865,0.9221497527168835,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,1.2107283885368956,0.909111664354187,0.85,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.1913293954410769,0.7571855751288902,-0.0766000050337147,-0.8949798182945309,-1.618648166768315,0.18650162015981303,0.909111664354187,0.78,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.8021872144091686,0.7571855751288902,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.8413351278107333,0.909111664354187,0.84,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.4130450333772604,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.2611001968177347,0.909111664354187,0.92,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.9366374496356247,1.087113930304877,1.674257252879766,0.5966532121963541,1.167321139201246,1.9495149099892173,0.909111664354187,0.96,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-1.2049170479145614,-0.39756366798706344,1.674257252879766,1.5910752325236108,1.167321139201246,0.08575800359813185,-1.0999748867047898,0.77,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.681324631656197,-0.39756366798706344,1.674257252879766,0.09944220203272576,0.052933416813421515,-0.06535742124438843,-1.0999748867047898,0.71,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.5403910062799865,0.7571855751288902,1.674257252879766,0.5966532121963541,1.167321139201246,0.30403583948177093,-1.0999748867047898,0.79,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.4130450333772604,0.9221497527168835,1.674257252879766,0.5966532121963541,0.6101272780073337,1.1435659774957738,0.909111664354187,0.89,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.24499761810756004,0.26229304236491,0.7988286239230257,0.09944220203272576,0.6101272780073337,0.2872452367214912,0.909111664354187,0.82,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,1.5910752325236108,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.76,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(-0.07046681268810527,-1.2223845559270303,-0.952028633990455,-1.8894018386217877,-0.5042604443804907,-0.7369815316555913,0.909111664354187,0.71,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.8021872144091686,1.4170422854808635,-0.952028633990455,1.0938642223599824,-0.5042604443804907,0.8077539222901738,0.909111664354187,0.8,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.10406399273134952,0.26229304236491,-1.8274572629471952,0.09944220203272576,0.052933416813421515,0.8749163333312926,-1.0999748867047898,0.78,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.0639834225383509,0.4272572199529034,-0.952028633990455,0.5966532121963541,-0.5042604443804907,0.9252881416121347,0.909111664354187,0.84,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.3257796306675331,1.7469706406568504,-0.952028633990455,1.0938642223599824,0.052933416813421515,1.2778907995780144,0.909111664354187,0.9,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.2385142279578056,1.2520781078928702,1.674257252879766,0.5966532121963541,0.052933416813421515,1.412215621660255,0.909111664354187,0.92,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(2.023902852345352,2.076898995832837,0.7988286239230257,1.0938642223599824,0.6101272780073337,2.2181645541536983,0.909111664354187,0.97,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.7149218116994412,0.7571855751288902,-0.952028633990455,-0.3977688081309026,0.052933416813421515,0.6062666891668145,0.909111664354187,0.8,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.2785947981508043,0.9221497527168835,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,0.06896740083785215,0.909111664354187,0.81,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(-0.15773221539783266,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-0.199682243326629,-1.0999748867047898,0.75,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.8021872144091686,1.087113930304877,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.8581257305710129,0.909111664354187,0.83,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.9366374496356247,1.4170422854808635,0.7988286239230257,0.5966532121963541,0.052933416813421515,2.016677321030339,0.909111664354187,0.96,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.5067938262367422,-0.2325994903990701,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.5690755040527913,0.909111664354187,0.79,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(1.5003104360869879,1.087113930304877,0.7988286239230257,0.5966532121963541,0.6101272780073337,1.3954250188999753,0.909111664354187,0.93,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(1.3257796306675331,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.1435659774957738,0.909111664354187,0.94,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.36586020086053167,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,0.7741727167696144,0.909111664354187,0.86,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.6276564089897139,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.6101272780073337,0.25366403120093184,-1.0999748867047898,0.79,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.8021872144091686,0.09732886477691666,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.4887324698448536,-1.0999748867047898,0.8,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.41952842352701486,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.15292041463925066,-1.0999748867047898,0.77,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.15773221539783266,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-0.4347506819705508,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.681324631656197,-0.5625278455750569,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.5690755040527913,-1.0999748867047898,0.65,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.9431208397853792,-0.2325994903990701,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.7705627371761508,-1.0999748867047898,0.61,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-1.7285094641729257,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.1735372034228724,-1.0999748867047898,0.52,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.15773221539783266,-0.7274920231630502,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.57,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-1.6412440614631982,-1.3873487335150236,-1.8274572629471952,-1.8894018386217877,-0.5042604443804907,-1.9123237248751956,-1.0999748867047898,0.53,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.10406399273134952,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.1661010378060696,-1.0999748867047898,0.67,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.016798590021622126,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.06535742124438843,-1.0999748867047898,0.68,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.690219702968213,0.909111664354187,0.81,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,1.674257252879766,1.0938642223599824,0.6101272780073337,0.6230572919270941,-1.0999748867047898,0.78,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-1.2921824506242887,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,1.724515000395158,-0.45154128473083044,-1.0999748867047898,0.65,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-0.5522849012925116,-1.0999748867047898,0.64,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-2.0775710750118352,-1.7172770886910105,-0.952028633990455,-1.3921908284581592,0.6101272780073337,-1.3414432310256739,0.909111664354187,0.64,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.5067938262367422,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.0392123813406318,-1.0999748867047898,0.65,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.41952842352701486,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.9384687647789537,0.909111664354187,0.68,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(1.5003104360869879,1.582006463068857,1.674257252879766,0.5966532121963541,1.167321139201246,0.7909633195298942,0.909111664354187,0.89,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,0.7988286239230257,0.5966532121963541,1.724515000395158,0.8917069360915754,0.909111664354187,0.86,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.5403910062799865,0.9221497527168835,0.7988286239230257,0.5966532121963541,1.167321139201246,1.0596129636943752,0.909111664354187,0.89,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.36586020086053167,0.5922213975408968,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.6230572919270941,0.909111664354187,0.87,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.2785947981508043,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.4551512643242912,0.909111664354187,0.85,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(1.0639834225383509,1.9119348182448437,0.7988286239230257,1.0938642223599824,1.167321139201246,0.9420787443724145,0.909111664354187,0.9,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.1913293954410769,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,-1.0999748867047898,0.82,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.681324631656197,0.09732886477691666,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.8041439426967131,-1.0999748867047898,0.72,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.8558554370756518,-0.8924562007510436,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.5522849012925116,-1.0999748867047898,0.73,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.4667132560437435,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.7369815316555913,-1.0999748867047898,0.71,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.0303862424951067,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.30042585988831016,-1.0999748867047898,0.71,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-1.2071184089434333,-1.0999748867047898,0.68,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.24499761810756004,0.4272572199529034,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.3376170450023333,-1.0999748867047898,0.75,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.07046681268810527,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.46833188749111015,-1.0999748867047898,0.72,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.889452617118896,0.9221497527168835,0.7988286239230257,1.0938642223599824,1.167321139201246,0.8581257305710129,0.909111664354187,0.89,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.016798590021622126,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.13612981187897094,0.909111664354187,0.84,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.5875758387967152,1.7469706406568504,1.674257252879766,1.0938642223599824,0.052933416813421515,1.412215621660255,0.909111664354187,0.93,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.2385142279578056,1.2520781078928702,1.674257252879766,1.0938642223599824,0.052933416813421515,1.2778907995780144,0.909111664354187,0.93,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.6276564089897139,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,0.8077539222901738,0.909111664354187,0.88,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.6276564089897139,0.5922213975408968,1.674257252879766,1.0938642223599824,0.6101272780073337,0.9420787443724145,0.909111664354187,0.9,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.5403910062799865,0.4272572199529034,1.674257252879766,0.5966532121963541,1.724515000395158,0.6398478946873739,0.909111664354187,0.87,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.4531256035702591,1.087113930304877,1.674257252879766,1.0938642223599824,0.6101272780073337,0.572685483646252,0.909111664354187,0.86,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.6748412415064426,1.7469706406568504,1.674257252879766,1.0938642223599824,1.724515000395158,1.5633310465027752,0.909111664354187,0.94,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.07046681268810527,0.26229304236491,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.27045463396121155,-1.0999748867047898,0.77,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.8558554370756518,-0.06763531281107672,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.1325198322855102,0.909111664354187,0.78,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.9431208397853792,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,-0.5690755040527913,-1.0999748867047898,0.73,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,-0.952028633990455,0.09944220203272576,-1.0614543055744028,-0.45154128473083044,-1.0999748867047898,0.73,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.0766000050337147,1.0938642223599824,1.167321139201246,-0.2836352571280305,-1.0999748867047898,0.7,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.3322630208172874,-0.06763531281107672,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.15292041463925066,-1.0999748867047898,0.72,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(0.016798590021622126,-0.7274920231630502,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.0989386267649508,0.909111664354187,0.73,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.15773221539783266,0.4272572199529034,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.2332634488471884,0.909111664354187,0.72,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(2.023902852345352,2.076898995832837,1.674257252879766,1.0938642223599824,1.167321139201246,2.2013739513934185,0.909111664354187,0.97,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(1.5003104360869879,2.076898995832837,1.674257252879766,0.5966532121963541,1.724515000395158,2.1342115403522968,0.909111664354187,0.97,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.6412440614631982,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.0989386267649508,-1.0999748867047898,0.69,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.9030402695923805,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5933022724298738,-1.0999748867047898,0.57,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.15773221539783266,-1.3873487335150236,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-1.1903278061831537,-1.0999748867047898,0.63,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.5940592289464697,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.972049970299513,0.909111664354187,0.66,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.0303862424951067,-0.2325994903990701,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.7369815316555913,-1.0999748867047898,0.64,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.3794478533340162,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.8041439426967131,0.909111664354187,0.68,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(0.7149218116994412,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.7741727167696144,0.909111664354187,0.79,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.9767180198286235,0.4272572199529034,0.7988286239230257,1.5910752325236108,0.6101272780073337,0.908497538851855,0.909111664354187,0.82,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.8493720469258974,2.076898995832837,0.7988286239230257,1.5910752325236108,1.724515000395158,1.7816088823864173,0.909111664354187,0.95,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.4130450333772604,1.9119348182448437,1.674257252879766,1.5910752325236108,1.167321139201246,1.9830961155097766,0.909111664354187,0.96,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.2385142279578056,1.582006463068857,0.7988286239230257,1.0938642223599824,1.724515000395158,1.3786344161396955,0.909111664354187,0.94,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.1512488252480781,1.4170422854808635,1.674257252879766,1.5910752325236108,1.167321139201246,1.2778907995780144,0.909111664354187,0.93,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.4531256035702591,0.7571855751288902,0.7988286239230257,1.0938642223599824,1.167321139201246,1.1099847719752143,0.909111664354187,0.91,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.36586020086053167,0.26229304236491,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.8917069360915754,0.909111664354187,0.85,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.6276564089897139,0.4272572199529034,0.7988286239230257,-0.3977688081309026,0.052933416813421515,0.6230572919270941,0.909111664354187,0.84,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.41952842352701486,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.30042585988831016,-1.0999748867047898,0.74,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.3322630208172874,-0.7274920231630502,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.25366403120093184,-1.0999748867047898,0.76,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.07046681268810527,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.75,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.6276564089897139,0.9221497527168835,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.32082644224205065,-1.0999748867047898,0.76,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.7685900343659244,0.26229304236491,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.71,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.0303862424951067,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.6194473123336305,-1.0999748867047898,0.67,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.8157748668826532,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.9552593675392334,-1.0999748867047898,0.61,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.9431208397853792,0.4272572199529034,-0.952028633990455,0.09944220203272576,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.63,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.41952842352701486,0.4272572199529034,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.1157292295252305,-1.0999748867047898,0.64,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.10406399273134952,0.7571855751288902,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.11933920911869125,-1.0999748867047898,0.71,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.6276564089897139,0.5922213975408968,0.7988286239230257,-0.3977688081309026,-0.5042604443804907,0.690219702968213,0.909111664354187,0.82,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.3322630208172874,-0.5625278455750569,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.08575800359813185,-1.0999748867047898,0.73,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.1913293954410769,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.45154128473083044,0.909111664354187,0.74,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.41952842352701486,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.5522849012925116,-1.0999748867047898,0.69,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.117651645204834,-1.2223845559270303,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.8880969564981116,-1.0999748867047898,0.64,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(1.1512488252480781,0.9221497527168835,1.674257252879766,1.5910752325236108,0.6101272780073337,1.1939377857766158,0.909111664354187,0.91,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.8021872144091686,0.5922213975408968,1.674257252879766,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187,0.88,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.5966532121963541,1.167321139201246,0.9588693471326941,0.909111664354187,0.85,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(1.0639834225383509,1.087113930304877,1.674257252879766,1.0938642223599824,1.724515000395158,0.9924505526532535,0.909111664354187,0.86,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.5940592289464697,-0.5625278455750569,-0.0766000050337147,-1.3921908284581592,0.052933416813421515,-0.3843788736897117,-1.0999748867047898,0.7,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.1903278061831537,-1.0999748867047898,0.59,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-1.8157748668826532,-1.057420378339037,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-1.5429304641490347,-1.0999748867047898,0.6,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.016798590021622126,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.753772134415871,-1.0999748867047898,0.65,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.6276564089897139,1.2520781078928702,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.27045463396121155,0.909111664354187,0.7,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.7149218116994412,1.087113930304877,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.7405915112490521,0.909111664354187,0.76,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.24499761810756004,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.63,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.9767180198286235,0.4272572199529034,0.7988286239230257,0.5966532121963541,-1.0614543055744028,0.7070103057284927,0.909111664354187,0.81,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.07046681268810527,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.22008282568037243,-1.0999748867047898,0.72,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.199682243326629,-1.0999748867047898,0.71,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4551512643242912,0.909111664354187,0.8,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,0.5922213975408968,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.3879888532831724,0.909111664354187,0.77,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,-0.04856681848410872,0.909111664354187,0.74,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.07046681268810527,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.6734291002079332,-1.0999748867047898,0.7,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.10406399273134952,-1.2223845559270303,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.0989386267649508,0.909111664354187,0.71,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.5875758387967152,1.2520781078928702,0.7988286239230257,1.0938642223599824,1.167321139201246,1.8151900879069767,0.909111664354187,0.93,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,1.087113930304877,0.7988286239230257,0.5966532121963541,1.724515000395158,0.8749163333312926,-1.0999748867047898,0.85,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.8558554370756518,0.4272572199529034,0.7988286239230257,0.5966532121963541,1.167321139201246,-0.3843788736897117,-1.0999748867047898,0.79,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.681324631656197,-1.3873487335150236,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.76,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,-1.2223845559270303,-0.0766000050337147,0.5966532121963541,1.724515000395158,0.06896740083785215,0.909111664354187,0.78,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.8021872144091686,-0.8924562007510436,0.7988286239230257,1.5910752325236108,1.724515000395158,0.27045463396121155,0.909111664354187,0.77,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.2385142279578056,1.9119348182448437,0.7988286239230257,1.5910752325236108,1.167321139201246,1.244309594057455,0.909111664354187,0.9,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.889452617118896,0.09732886477691666,1.674257252879766,1.5910752325236108,0.052933416813421515,0.8917069360915754,0.909111664354187,0.87,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.41952842352701486,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.8545157509775522,-1.0999748867047898,0.71,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.7685900343659244,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.40116947644999135,0.909111664354187,0.7,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.6276564089897139,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-2.175842027962227,0.32082644224205065,0.909111664354187,0.7,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.7149218116994412,0.4272572199529034,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,0.27045463396121155,0.909111664354187,0.75,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,-0.8949798182945309,-1.0614543055744028,0.13612981187897094,-1.0999748867047898,0.71,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.2500540516074711,-1.0999748867047898,0.72,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.24499761810756004,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.7201909288953117,0.909111664354187,0.73,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.889452617118896,0.9221497527168835,0.7988286239230257,1.0938642223599824,1.724515000395158,0.908497538851855,-1.0999748867047898,0.83,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.7685900343659244,0.09732886477691666,0.7988286239230257,1.0938642223599824,1.724515000395158,-0.4347506819705508,-1.0999748867047898,0.77,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.9431208397853792,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.6362379150939101,0.909111664354187,0.72,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-1.553978658753471,-1.8822412662790038,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.54,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-1.990305672302108,-2.0472054438669973,-1.8274572629471952,-1.8894018386217877,-2.175842027962227,-1.610092875190155,-1.0999748867047898,0.49,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.41952842352701486,-1.3873487335150236,-1.8274572629471952,-2.386612848785416,-2.175842027962227,-0.9888405730597928,0.909111664354187,0.52,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.15773221539783266,-1.2223845559270303,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.0895841896214724,-1.0999748867047898,0.58,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.6062666891668145,0.909111664354187,0.78,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(1.0639834225383509,0.9221497527168835,1.674257252879766,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187,0.89,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.2785947981508043,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.03538619531728977,-1.0999748867047898,0.7,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.7685900343659244,-0.7274920231630502,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.1828916405663493,-1.0999748867047898,0.66,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-1.117651645204834,-0.8924562007510436,-0.952028633990455,-0.3977688081309026,0.6101272780073337,0.22008282568037243,-1.0999748867047898,0.67,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.5067938262367422,-0.8924562007510436,-0.0766000050337147,1.0938642223599824,0.6101272780073337,0.06896740083785215,0.909111664354187,0.68,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.016798590021622126,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.8581257305710129,0.909111664354187,0.8,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.41952842352701486,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.32082644224205065,0.909111664354187,0.81,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.36586020086053167,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,0.5055230726051333,0.909111664354187,0.8,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(2.023902852345352,0.7571855751288902,0.7988286239230257,1.5910752325236108,1.167321139201246,1.7816088823864173,0.909111664354187,0.94,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(1.2385142279578056,1.4170422854808635,1.674257252879766,0.5966532121963541,0.6101272780073337,1.1099847719752143,0.909111664354187,0.93,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(1.6748412415064426,1.7469706406568504,1.674257252879766,1.0938642223599824,0.6101272780073337,0.9924505526532535,0.909111664354187,0.92,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(0.6276564089897139,1.087113930304877,1.674257252879766,1.5910752325236108,1.167321139201246,0.8077539222901738,0.909111664354187,0.89,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.24499761810756004,-0.5625278455750569,0.7988286239230257,1.5910752325236108,1.724515000395158,0.7070103057284927,-1.0999748867047898,0.82,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.3322630208172874,0.26229304236491,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.6734291002079332,-1.0999748867047898,0.79,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5933022724298738,-1.0999748867047898,0.58,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-1.4667132560437435,-0.8924562007510436,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.223909011703713,-1.0999748867047898,0.56,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-1.2921824506242887,-1.3873487335150236,-0.952028633990455,-2.386612848785416,-1.618648166768315,-1.056002984100913,-1.0999748867047898,0.56,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.41952842352701486,-1.5523129111030172,-1.8274572629471952,0.09944220203272576,-0.5042604443804907,-0.7034003261350319,0.909111664354187,0.64,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.07046681268810527,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.46833188749111015,0.909111664354187,0.61,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(0.016798590021622126,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,-0.04856681848410872,-1.0999748867047898,0.68,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.5940592289464697,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.11933920911869125,-1.0999748867047898,0.76,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.2785947981508043,2.076898995832837,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.8581257305710129,-1.0999748867047898,0.86,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(1.1512488252480781,1.087113930304877,-0.0766000050337147,1.0938642223599824,1.167321139201246,1.076403566454655,0.909111664354187,0.9,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-1.0303862424951067,0.7571855751288902,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.08575800359813185,-1.0999748867047898,0.71,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.681324631656197,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-1.0056311758200724,-1.0999748867047898,0.62,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.1913293954410769,0.09732886477691666,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.27045463396121155,-1.0999748867047898,0.66,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.4531256035702591,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.2500540516074711,0.909111664354187,0.65,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.5403910062799865,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.08214802400466813,0.909111664354187,0.73,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.3322630208172874,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.2836352571280305,-1.0999748867047898,0.62,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.36586020086053167,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.3376170450023333,0.909111664354187,0.74,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.5403910062799865,0.4272572199529034,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.8413351278107333,0.909111664354187,0.79,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.6734291002079332,0.909111664354187,0.8,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.41952842352701486,0.09732886477691666,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.1157292295252305,-1.0999748867047898,0.69,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.7685900343659244,0.4272572199529034,0.7988286239230257,0.09944220203272576,-0.5042604443804907,0.0018049897967303734,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.23687342844065212,0.909111664354187,0.76,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.9767180198286235,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9756599498929738,0.909111664354187,0.84,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-0.5067938262367422,-0.06763531281107672,0.7988286239230257,1.0938642223599824,1.167321139201246,0.6734291002079332,0.909111664354187,0.78,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.3794478533340162,-1.2223845559270303,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.9384687647789537,-1.0999748867047898,0.67,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.0303862424951067,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-0.7873533399364304,-1.0999748867047898,0.66,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-0.7685900343659244,-0.5625278455750569,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.8880969564981116,-1.0999748867047898,0.65,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.6412440614631982,-1.057420378339037,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.54,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.4667132560437435,-1.3873487335150236,-1.8274572629471952,-2.386612848785416,-1.0614543055744028,-0.9888405730597928,-1.0999748867047898,0.58,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.6276564089897139,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-1.618648166768315,0.3376170450023333,0.909111664354187,0.79,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.889452617118896,0.9221497527168835,0.7988286239230257,0.09944220203272576,-0.5042604443804907,0.15292041463925066,0.909111664354187,0.8,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.016798590021622126,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,0.052933416813421515,-0.1661010378060696,0.909111664354187,0.75,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.5403910062799865,-0.5625278455750569,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.2668446543677508,0.909111664354187,0.73,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.24499761810756004,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.5522849012925116,-1.0999748867047898,0.72,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.0303862424951067,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.7034003261350319,-1.0999748867047898,0.62,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.15773221539783266,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,-0.45154128473083044,-1.0999748867047898,0.67,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.8021872144091686,1.4170422854808635,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.908497538851855,0.909111664354187,0.81,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-0.0766000050337147,-1.3921908284581592,-1.618648166768315,-0.972049970299513,-1.0999748867047898,0.63,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.9030402695923805,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.69,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.6276564089897139,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.2872452367214912,0.909111664354187,0.8,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-2.175842027962227,-1.1903278061831537,-1.0999748867047898,0.43,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.889452617118896,0.9221497527168835,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.10254860635841155,0.909111664354187,0.8,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.5067938262367422,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.8041439426967131,0.909111664354187,0.73,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.7685900343659244,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.6530285178541898,0.909111664354187,0.75,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.1913293954410769,0.09732886477691666,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.0989386267649508,0.909111664354187,0.71,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.08575800359813185,0.909111664354187,0.73,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.7149218116994412,0.5922213975408968,0.7988286239230257,0.5966532121963541,1.167321139201246,0.8581257305710129,0.909111664354187,0.83,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.1913293954410769,0.4272572199529034,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,0.32082644224205065,-1.0999748867047898,0.72,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(1.3257796306675331,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.462587429941097,0.909111664354187,0.94,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.5403910062799865,0.09732886477691666,1.674257252879766,0.5966532121963541,0.6101272780073337,0.23687342844065212,0.909111664354187,0.81,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.6276564089897139,-0.06763531281107672,1.674257252879766,0.09944220203272576,0.6101272780073337,0.10254860635841155,0.909111664354187,0.81,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.2332634488471884,0.909111664354187,0.75,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.8021872144091686,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.27045463396121155,0.909111664354187,0.79,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.7685900343659244,-0.2325994903990701,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.6026567095733507,-1.0999748867047898,0.58,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.0303862424951067,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.7873533399364304,-1.0999748867047898,0.59,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.9030402695923805,-1.8822412662790038,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-2.1138109579985565,-1.0999748867047898,0.47,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.07046681268810527,-1.5523129111030172,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.9626955331560363,-1.0999748867047898,0.49,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.117651645204834,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.610092875190155,-1.0999748867047898,0.47,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.553978658753471,-2.2121696214549904,-1.8274572629471952,-2.386612848785416,-2.7330358891561395,-2.1138109579985565,-1.0999748867047898,0.42,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.2921824506242887,-1.3873487335150236,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-2.2649263828410766,-1.0999748867047898,0.57,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-0.3322630208172874,-1.057420378339037,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.9384687647789537,-1.0999748867047898,0.62,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.10406399273134952,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5522849012925116,0.909111664354187,0.74,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.7149218116994412,0.4272572199529034,0.7988286239230257,0.09944220203272576,0.6101272780073337,0.11933920911869125,0.909111664354187,0.73,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.2049170479145614,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.9048875592583913,0.909111664354187,0.64,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.4667132560437435,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.7201909288953117,-1.0999748867047898,0.63,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.7285094641729257,-1.5523129111030172,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5597210669093144,-1.0999748867047898,0.59,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.016798590021622126,-0.2325994903990701,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8041439426967131,-1.0999748867047898,0.73,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.889452617118896,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.2872452367214912,0.909111664354187,0.79,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.3794478533340162,-0.5625278455750569,-0.952028633990455,0.09944220203272576,0.052933416813421515,-1.1903278061831537,0.909111664354187,0.68,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-0.24499761810756004,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.610092875190155,-1.0999748867047898,0.7,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.36586020086053167,-0.06763531281107672,-0.952028633990455,-1.3921908284581592,-2.175842027962227,-0.2668446543677508,-1.0999748867047898,0.81,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.724515000395158,0.06896740083785215,0.909111664354187,0.85,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.5003104360869879,1.4170422854808635,0.7988286239230257,0.5966532121963541,0.052933416813421515,1.580121649263055,0.909111664354187,0.93,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.8493720469258974,1.2520781078928702,1.674257252879766,1.0938642223599824,1.724515000395158,1.0596129636943752,0.909111664354187,0.91,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.9431208397853792,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.40116947644999135,-1.0999748867047898,0.69,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.5055230726051333,0.909111664354187,0.77,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.1512488252480781,1.087113930304877,0.7988286239230257,1.0938642223599824,-0.5042604443804907,0.9588693471326941,0.909111664354187,0.86,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,1.167321139201246,-0.4347506819705508,0.909111664354187,0.74,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.5067938262367422,-1.5523129111030172,-1.8274572629471952,-2.386612848785416,-1.0614543055744028,-1.9123237248751956,-1.0999748867047898,0.57,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-1.6412440614631982,-2.5420979766309775,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-1.2071184089434333,-1.0999748867047898,0.51,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-1.3794478533340162,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-0.5042604443804907,-0.9552593675392334,0.909111664354187,0.67,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187) DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 1.0)(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 0.0, 5, 1.0)(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; with (select state from test.model) as model select evalMLMethod(model, predict1, predict2, predict3, predict4, predict5, predict6, predict7) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00953_dataset_test.reference b/dbms/tests/queries/0_stateless/00953_dataset_test.reference new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00953_dataset_test.reference @@ -0,0 +1 @@ +1 diff --git a/dbms/tests/queries/0_stateless/00955_ml_test.sql b/dbms/tests/queries/0_stateless/00953_dataset_test.sql similarity index 97% rename from dbms/tests/queries/0_stateless/00955_ml_test.sql rename to dbms/tests/queries/0_stateless/00953_dataset_test.sql index 2df84c00d3f..2ade0fc412c 100644 --- a/dbms/tests/queries/0_stateless/00955_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00953_dataset_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.03, 0.00001, 2, 2.0)(target, param1, param2) as state from test.defaults; - -with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; +select ans > -67.0 and ans < -66.9 from +(with (select state + state + state from test.model) as model select evalMLMethod(model, predict1, predict2) as ans from test.defaults limit 1); diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.good_reference b/dbms/tests/queries/0_stateless/00953_ml_test.good_reference deleted file mode 100644 index ff9c61e403b..00000000000 --- a/dbms/tests/queries/0_stateless/00953_ml_test.good_reference +++ /dev/null @@ -1,580 +0,0 @@ -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -0.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.reference b/dbms/tests/queries/0_stateless/00953_ml_test.reference deleted file mode 100644 index 993fa484869..00000000000 --- a/dbms/tests/queries/0_stateless/00953_ml_test.reference +++ /dev/null @@ -1,580 +0,0 @@ -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6411012851604063 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.6882314202562039 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.4364572659523192 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6093243100848463 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.6997646999628921 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.5422581250564131 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6508734063103988 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.6985513111559237 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.45244725477787 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.6261675112820656 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7461838992404664 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.7018563514656831 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.36013871027066185 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.5238855727602139 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6804249705341022 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6050764770369429 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.6440334745784803 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5716205957425191 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.5311888217657855 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 -0.6986271931040996 diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference b/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference deleted file mode 100644 index a760c5b44b6..00000000000 --- a/dbms/tests/queries/0_stateless/00953_ml_test.rock_auc_reference +++ /dev/null @@ -1 +0,0 @@ -0.7692307692307693 diff --git a/dbms/tests/queries/0_stateless/00953_ml_test.sql b/dbms/tests/queries/0_stateless/00953_ml_test.sql deleted file mode 100644 index 8da2a81fb5c..00000000000 --- a/dbms/tests/queries/0_stateless/00953_ml_test.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE DATABASE IF NOT EXISTS test; -DROP TABLE IF EXISTS test.defaults; -CREATE TABLE IF NOT EXISTS test.defaults -( - param1 Float64, - param2 Float64, - param3 Float64, - param4 Float64, - param5 Float64, - param6 Float64, - param7 Float64, - target Float64, - predict1 Float64, - predict2 Float64, - predict3 Float64, - predict4 Float64, - predict5 Float64, - predict6 Float64, - predict7 Float64 - -) ENGINE = Memory; -insert into test.defaults values (2.096042154435875,-1.430135166863733,0.552002055283785,5.530269265662427,-2.724119998880863,-2.727060497877947,-2.6521663150493935,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.156034808051058,-0.4519877395933891,0.34558837162895817,2.2798791370166707,-1.2600139205601857,-2.314726182739184,-0.9176776519268379,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.0227012823747095,0.7073993763424218,-2.526579837235766,2.8884210818462503,-0.04921172682949959,-0.9351603686160936,-0.5773308731642317,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.461704796035435,1.2400054513675245,1.3110456913590716,-1.22465515713176,-0.7935030458046264,-1.103533329941002,0.5919719712269023,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.3957050452186377,-1.9316918657725441,0.9190142057288935,7.155955775162267,-2.8869703029890026,-3.0234929608286194,-4.304748904849194,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.392556430407127,-1.7794168780763924,2.1181012869348086,-0.6814309766916051,2.00404915245683,-1.7928635680687615,-2.425109137822439,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.9685507597915972,0.8408759652866196,-1.2607782469598254,-1.5515619975922614,2.3915793036512913,-0.8003752729444923,0.3318055683772181,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.365215205131582,1.6421911754887804,-0.470904627839269,-2.195888125979813,0.9714278325597505,0.5976321868124256,1.1540464822511913,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.3351152167766934,0.9498577915117139,-0.879126536282473,-2.971335010973352,2.468544204807239,0.5553774318661323,1.093198284507689,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.03912510876000452,-1.3322341365102917,1.6434865408453003,2.7281117051531183,-2.719490284062717,-1.2856678156526198,-1.087994719221058,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.8110134301050786,0.10305735724313725,-0.019183566058287527,1.478933303100145,-0.8948542269544303,-0.7185915708657821,-0.5378349211144934,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.013571717295999042,-2.1401875522838942,1.5751388914372026,2.869365994906071,-2.263892397950471,-1.5905392928904198,-1.317250564711623,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-1.3815235147212976,-0.9616053368120304,2.8150588272277965,0.14759793530998425,-1.620992799677878,0.20786388505596268,-0.9816032789320823,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.11407654661743705,0.768404354463356,-0.3930175233254567,2.3015784648119375,-1.7211987426998967,0.45519975382978,-0.6156907430410832,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.8478239086918133,1.5409911767774376,1.6994582902088935,-0.941221552716078,-0.5161849474607861,-1.0836831033224825,-0.4295520072868204,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.05455524769902653,-0.44441732196125217,2.708301849219744,-4.119367835878758,1.145934474605499,-0.7195943706636994,0.790664128197853,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.1969604043817803,-0.32118839886233386,0.23529133982375638,2.0406253994414003,-0.9957550724767615,-2.2235912952793635,-0.8800043260355785,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.8220150519058342,-0.09416361439372012,-3.047770316012948,5.034883266354364,-2.0143105832194625,-1.5733009655638288,-0.0222530409439472,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.0161176246725091,2.6217682547175736,0.9626736958220774,-7.396443060155276,3.4854283180461727,1.4376798844052319,2.2403875697818205,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(1.5082554497694574,1.8467142393208946,1.6327843990728441,-3.2881109608057573,-0.4321005482505421,-1.0603588475156511,1.8575619836721444,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.42260650162006874,0.41155861800999316,0.7982889881884394,-0.7237985064171936,-0.8285415729659753,-0.5825003405465955,0.7630457046521066,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(2.4984953879098306,-1.1006932402217684,-0.4488170035755814,5.409789404959963,-2.734678167398622,-2.9680022720016557,-1.6313962465437406,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.9436912987053148,-1.9262688389287774,1.314850116820961,6.396062133529162,-2.842471758246596,-1.7716503301033386,-4.152218598373375,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.16349909844947885,-2.1701452208414933,2.568526586668546,3.397671556920363,-0.8976577440476563,-0.7471631706579982,-4.256758308439956,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.43511790495037683,0.5111546228572755,1.5168239103908907,1.604718301244254,-2.095124808747114,-0.4602828633136912,-1.1177938053615741,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.5413156314344527,0.09335263935887883,0.5612958143676673,-3.7986008152463135,1.8342221950246018,-0.5809729319600001,1.6392301667689284,0.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-1.4504814727811615,1.3493103008673883,-0.04616646907891209,1.3117933064479026,-0.7702114172619944,2.2759289480635956,-1.3306427086061552,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.5130854076349335,0.6888754268554591,-0.24046616537106735,1.5838074220098308,-1.6445748079667983,0.6567869990109363,-0.10911343377083105,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(-0.24277413251186197,0.8473320183553533,0.13183067757383438,-1.285681114811781,0.8555624158828621,0.8394005656843551,-0.03496602415650052,1.0,2.2484776527244863,1.099880417196144,-3.288829727389001,5.753439524022788,-1.8752458625661363,-0.9823515324160276,-1.1222966894793052),(0.8369385120882685,-1.341251823971342,0.9554668074045201,1.4270151216516322,1.3962946241553666,-0.7795883140931273,-3.1902671851058684,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.1583479751809334,0.517409603059198,-0.6999515579272186,2.051960782143681,-1.715430664432116,-0.9939038452652763,0.23845436310251533,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.8595203894117056,1.586295759104766,3.24464432451852,1.7792981720712642,-3.5599729812558625,1.0339349200010899,-2.0761447233122485,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.2187879306043835,0.785516320747686,-0.2648586496544352,-2.8228486010789404,1.128464932373549,0.09723332542813223,1.7886949807027714,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.5027908312527922,1.299795068598311,-2.247265548686248,0.3568369726515874,0.3094133364610945,0.4849256444073516,0.9882861752504595,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-2.323680245156419,1.74815453644885,1.3056727348077939,0.19720821301977268,-1.3307294071180997,2.961691552540972,-1.1567709696086979,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-3.4660709804341914,3.0020058328582584,1.5532651665598032,1.5583662913164948,-1.817494404470051,5.014323195426371,-3.0261871799657434,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.07263506966702105,-0.9786215483869296,1.9521065048378694,-0.5412416965904013,-0.7526123488568063,-0.9097656582671574,-0.11616596119861677,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-1.1101210747955936,0.45690435659743034,1.0024061194024203,3.151090618784407,-3.1293373639055435,0.9063184859725469,-1.4156004860432896,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(3.126163478788228,-1.3873077921754309,-1.6696389941434133,2.6802469210649256,-0.681228435146825,-3.632607072537458,0.5151315701276392,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.35121315158298516,3.269898801839016,-0.3139240954702248,-3.3982176643392235,1.5943902174769407,1.665406096965063,0.9632634643458649,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.7468935350733565,2.1854201988656303,-1.5921771449650985,-1.9866930130946439,2.2487176483490816,1.088338402207399,0.5136328198882177,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.8336689441755065,1.9918308776801352,2.2772332104920645,-4.087683288038629,-1.0325983001724792,0.8849166354769218,2.286910253692919,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.977801713559557,2.047290687529743,-1.892163531069095,0.023277725464046682,1.5086179535693676,-0.02241979904892156,-0.3153319898124409,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.0518424311627248,1.8501419588702324,0.8505610339256306,-6.405529783623052,2.0897521277071087,0.570135066692417,3.065661906503785,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-3.467126967504096,3.5784474447980568,-1.593527155162049,6.595207715742785,-3.872578649012629,5.606447409075812,-3.4752544483201677,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.49490773800501286,1.595739466407145,0.28740296306486357,-3.824557248992501,-0.005517967878073571,0.6713599863888331,3.0557952294935538,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.544193867668699,2.3262231384923844,2.750917624599606,-3.510182442015632,-1.2164244818530026,-0.12870618351275448,1.4921405703258661,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.51316443936564,-1.2270576118491379,-0.1511873771860477,5.077623200702221,-2.47128253159166,-2.071110370778194,-1.938581109844371,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.6113192323231587,1.6659128724858379,-0.26101192082957914,-4.320443128005412,1.661337251012963,0.17282617602319883,2.521205470842835,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.8198275616708954,1.3675138581932453,2.4905089781034886,-4.065703441137424,-0.7766613572278701,-1.9487231810266057,2.467596447852433,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-1.9560716071750701,1.8563089934671257,-1.089371283526789,0.45302651466747346,0.5754832357256494,3.377112037476161,-1.1078516930515567,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.5014679676763512,1.46456490318075,3.74940663345368,-0.5180207050201467,-0.9701148885455172,-0.7947236401223874,-2.385191842660675,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.316853101423458,1.2491089344703392,2.3725759643289566,-2.9342129359065137,-0.4183076327718859,-1.155701368032073,0.9779293936805153,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(1.1849117352329739,1.3925299588445736,1.5695966090587818,-2.1311823024234813,-0.9067969456142655,-0.9769402104776256,1.3185069398877736,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(2.373297959341027,2.775778233617674,-3.987898143897202,4.1703153450619785,0.47977169869012415,0.5341339903160455,-1.8868105390404768,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(2.3482349418405724,-3.1159637626200545,1.322069359815815,2.229373710192031,0.1833587373393235,-3.6718200269675574,-2.167407144040195,0.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.8243075201573921,1.3348585688363546,-2.0351861522550223,0.44274131356886665,0.7582729504076067,0.4043388560881777,0.26562738440084566,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(0.9481666208581829,0.22905400262922648,-1.2625401200379784,0.01891167448317009,-0.23629041979461762,-0.8959552087654045,1.483311569076668,1.0,1.0910432278349973,1.4357221361554606,0.4817644424944769,-2.8601508919307315,0.1669223465869939,-0.6543849583116184,1.9832087369769236),(-0.06585868557878616,1.4576378617673251,0.7399321196221702,-5.557327993134892,2.0615711774643364,0.59937804443105,2.443312546568034,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.5617223747915407,-0.536515447514492,-0.9957168928986968,4.77783798052823,-3.0250516363531137,0.04763704320310812,-0.8503674789558922,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-3.34324723959496,4.3926424059948035,-0.0495291336313155,2.6333253919636106,-1.8973423593226126,5.962186949574377,-3.1074374428513205,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.49887278027307114,2.4772176483573447,0.8766144403424073,-4.412341348998718,-0.06544816902397033,0.17540887369438027,2.973618255958296,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.7781653022461528,1.6160279900558963,2.9043194289987406,-1.6138303698874787,-0.3568046596220451,1.4348863906315135,-1.472812006839362,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.0193028644873694,1.6299059681175168,0.7720871381731178,-6.526365022144807,3.602358868389331,0.05735615709042067,1.942603137953855,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.126058179631438,-0.08021399823747422,0.1845945629753224,0.17818816509562224,-0.738333890554967,-1.3667460232410276,0.6101098938191294,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.696410860620625,-0.6276802386587743,2.4836900187897752,-2.0850016187629534,0.24626466623836807,-1.3510098287109322,-0.044478444238072345,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-2.2180272120355253,2.4305553228334267,-1.5801744943687832,4.862275527923406,-2.2752200612907183,3.8805912201348205,-2.6384927064003305,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.7567743245952139,-0.34730069944053166,-0.8948025108160138,3.0380121675012406,-1.1828054695478198,-1.7157828402064659,-0.7250035618486275,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.8454701528107351,-1.4667747625694347,1.3994753234952881,0.14108982726971897,-1.4662061418653511,-2.2561833089066807,0.7712682192410636,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9311255806838445,0.30138652549697587,0.38513967479058675,1.3739433638375038,-1.148015783327944,-0.8064976661502308,-0.6120628161659272,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(3.364212163278218,-0.5777774492998544,-2.0960237073085235,2.7292130504797565,0.3929841930243696,-2.9133895273811254,-0.5391544963326877,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(1.0464711573814256,0.6301410336103881,0.6168596799831255,-1.032929924340855,-1.2787522510385279,-1.28640822590547,1.7388375253169488,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.422247332703442,1.3099920188712886,2.4073061721409297,2.1870630187898,-2.906653106438294,1.6982591159934275,-2.362573454685344,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(3.1695741682612937,-0.18516594373997697,-0.7713888778777602,3.1151308383183576,-3.0028825960507337,-3.641700075824226,1.1176723514330833,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.0201468439854502,2.0949741514552933,0.6385052523919061,1.8831849732743258,-2.2046121941585293,1.961396504470046,-1.341031552473416,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9381164870495406,0.7569235185409051,-0.04079716532568112,-1.0646216144008618,-2.1229314622801283,-1.4627720410887246,3.205645865534935,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9437251365046566,0.2476269059695898,0.04785469653893282,-3.162644357415593,1.5437021067561914,-0.853674727031123,1.7551166151989124,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7011087711254909,1.2035331930765993,-1.4398091375364501,-0.22767686518825167,0.8665559020317706,0.35056665369985957,0.3315069768001421,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7691595700548932,0.23226979363339084,-0.7524159985119943,-2.273159847018095,1.2051808874023429,-0.6613989835734112,1.904431917138825,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.9901267648253292,0.8314035869824183,0.9623028761759912,3.0463733919904152,-2.623962359372865,1.2107802811322752,-1.9252298613127752,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.5670331443146553,1.8504800423581038,-0.644940607788113,-2.7678230888952498,1.5881287762026992,0.6450884188501608,1.2333970014028715,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.7215290147887311,-0.8847639920373926,0.4904341287870997,1.0732294179644357,-0.08407257982238703,-1.0427528377077504,-1.0423316359603254,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-3.0571866679643755,3.3801167219727093,0.7666061453475292,-1.4047601244502173,1.2542122493912302,5.360634400210411,-2.408846721295774,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.14458899707407,0.806558148488993,0.9258314968497899,1.6039908714694096,-1.8099931519413055,1.3287669410436236,-1.2183570331221776,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.0029511283094880714,0.7392527584182871,2.271615106839793,-0.4594423088240106,-1.302932906147438,-0.024854290186172693,-0.6305929459060517,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-1.0262556462492007,3.106727638660441,1.552666143363748,-3.579169866499337,-1.4623529808205205,1.7247030376250396,2.395785937012022,0.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(0.9439810230045693,-0.03450351562051179,-1.8489916117037675,1.627016506901843,-0.2551150847440704,-0.7340241866844871,0.46366450521689084,1.0,-0.027051765610255796,-1.4990882375684091,3.3331673136920816,-2.748342229394801,0.7997536049262695,-1.1364348193148381,-0.48020428945931526),(-0.8995507828338771,2.637194803741764,0.5281828736349332,-5.263580235229065,0.7097535677602926,1.7093409623873352,3.1199605290151666,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.2331543227352126,0.576960304218676,-0.676727171313593,1.0171538582152717,-2.82527488357647,-2.6461049785824264,2.6088913588467775,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.884286499274555,1.7159327959050787,3.786765950812899,-6.121056390326268,2.333369727673255,2.6168319013890295,-0.5366786842960347,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.1382122858746933,-0.14299633489223185,0.8327531435987057,1.298580815498469,-0.8627965605758569,0.988030584240615,-1.3967521076705827,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.6303393796237344,4.358235812284331,2.280888586413079,-8.838648817770522,2.239906490938857,2.4513045936352977,2.990325780977093,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.4442835629793667,-1.5595422106625365,-0.14785351526730506,2.4592541040486275,-0.0735148069297793,-2.8435659780281113,-1.3676274520194718,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.4143700456566066,0.8204418264435885,0.967997405875176,0.42646086353492046,-1.564532879987763,-1.275739590687965,0.1318313864473809,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.993790451964731,1.3774074310286606,3.280200674941446,-1.341646747143973,-0.7045036833894341,-1.426903501445604,-1.2265179636048882,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.25515995427833005,-0.4671088714062114,2.2153588526087598,2.313329282416284,-3.5569628024009674,-0.8261756134416534,-0.7263653091644615,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.6355961932522634,-1.0282770582100191,-3.2173580488490123,4.559935052970455,-1.1214958228117986,-1.7827022934914223,0.07193385989494827,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.3283277042612722,3.4105121001777348,3.2195651165101515,-5.324711721749864,-0.9682526335929017,0.5004787785615196,2.2337122442476227,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.754679079237366,1.2099552379791747,-0.4385913525503159,-3.1077997316498673,1.9318023043436465,0.10670563866580032,1.3334679355779948,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.0317090865947613,0.8572264240668982,2.4095086017705816,-4.663118509638804,0.16709538369449373,-2.261736697516116,2.4428573077545996,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.1693473062725674,0.28205162253200255,-1.9303762140352645,0.9887844009255294,0.9897729061853578,-1.3590499520050627,-0.010177228789967074,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.0801920463321826,-0.4298481415473505,-0.33436737741767897,0.8097326513818011,-1.310248231723286,-1.6559624358526785,1.164300884735815,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.04021181298242671,0.22389963328779605,1.9968767300385086,-0.019382197954940554,-1.4497486951865157,-0.29417522140873087,-0.47838412801942587,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.1239921256001624,-0.8638540030084805,-1.0178241055718993,-2.2937149162466777,2.565762757868864,-1.2141062999841048,1.274422252538015,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.7413970807889825,1.5875817859558181,0.8403835779082484,-0.06969468265303144,-2.0112826998053173,0.9991342650707755,0.5897487899339218,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.21012246579494498,0.7349291140125731,1.1564215797263593,3.067109745050948,-3.8072019508231905,-0.4458351151041659,-0.6775773369205058,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-0.2786193776514114,0.8391330674680333,-0.4026891923466751,-1.3731305159290677,-0.8305074905865648,0.169874931175302,2.3132805058219574,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-1.2328709703392624,2.7597725867233383,0.5684016239686696,-2.9566618506267175,-1.5157478752904878,1.7699608909022329,2.8392511093116637,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.6871398306249665,-1.4103987067510992,1.0274161223406697,-0.5072792317407046,0.16697719764934948,-1.5964973105562557,0.07247594534487489,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.988330670186111,-0.5258004908649867,0.857816493019688,2.905878095316476,-0.3238823556705246,-0.7203927872533037,-3.1935613280291166,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.4322721114721757,0.30561297616901784,-1.5190220731160726,1.3743262473426763,-0.37180525132367603,-2.018098080706224,0.6319351503875634,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.4632563423687737,0.5381126931941951,0.9013515836533991,-0.4868930388692965,-0.8036249563776104,-1.424272458154115,0.4989428610329456,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.9759142028783296,0.0963990665555634,1.080300923613975,-3.059378549550568,1.7637552314639664,-0.8307617709909302,0.5002521536297346,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(0.8451444217468322,2.675124983592143,1.8034394339920048,-6.24356070906137,-0.1404077934628427,-0.4290049368154296,4.083301092855288,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(1.7832957038087498,0.46583490546204087,-2.8377296298346213,1.7314321239250723,1.4637196588786066,-0.5551666584209051,-0.560342527910989,1.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(2.0305985048097615,-0.8136835491751737,-1.5375629006726204,0.23344540733313246,-0.38312070583511015,-2.6407899536879547,2.2682169302221693,0.0,0.09011944877063804,0.4347954089652697,0.9137579529403927,-0.48385631481051244,-1.1073840104411428,-0.29844954258155465,0.6258307943091245),(-4.450198579702571,3.8044895601982978,1.340371422770127,3.236568823054465,-2.7997133244581374,6.476201660322862,-4.069014914211333,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.4825506606818901,1.8932394950918274,-1.6402434007292597,-0.6438070488741744,1.5377697938617518,0.2190653369274579,0.10746474982298349,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.12865647469516983,-0.03277446362082159,0.3789672161429233,0.13234961251820676,0.10865846661989931,0.1899002744334014,-0.6210816810053859,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.7483525163782037,1.911632146474509,1.0237857931937804,-5.939983118898138,0.18095426014013039,0.7464913363725915,4.2349290686151395,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.4639789336512659,-1.487762211307613,1.2333792712082898,-0.5819847984553231,1.367105196681563,-1.9311626412059815,-1.1352946822318226,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-2.716437954263598,3.2172228184755456,2.486899575348391,-0.27826500422738343,-1.496858928573759,4.189036022930514,-2.271237075436395,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(2.0984679507408304,-0.39222671785000096,-0.00929742777138598,2.4355790415042984,-1.2773465142555198,-2.2069415614400536,-0.7601011284502681,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-2.3851061122725956,1.2652524519794195,1.2056559497342312,0.2301402557556724,-0.13853039522345567,3.166739303466531,-2.143757701306856,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.912501321700246,1.0668955351482894,0.031154669474161678,-0.2922639794504092,0.1586320914087691,1.5749108653175503,-0.4654455435433783,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.6897500753524755,-1.5877093887419145,-1.7611534048954183,2.033285149958932,-0.45562387935528914,-2.4572133028294783,0.9117001207364435,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.03279016425268144,-0.553487415980487,1.5178285275445653,-1.756383753660862,-1.6424327750282592,-1.3694706413196136,2.3514036487381236,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.58004120787043,-0.1972292963993476,-0.13424999439900343,0.0644658482737472,-0.5669375045425562,-0.8960436704764648,0.8194123344316495,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.3142690816498883,1.9522135610917537,1.3104586637571347,-3.120340694946515,-0.7990786213674381,0.031103936415356134,2.1367311835504337,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.2711769727288555,1.0981021590638618,-1.7957098361193409,0.11763102112672769,0.8889146120013874,-0.1919397644256007,0.4140737388483293,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.2753034616688934,0.5396168159983519,-0.25856295996037804,-0.8784121825809064,0.6222845940416049,0.6514517789151233,0.268334498274877,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.054143446852892296,-1.6609882776935554,1.6234667989235132,3.3387697001507917,-0.9389121245324956,-0.5846606129339186,-3.4424309279299794,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.26621832805226675,-0.18078638381031364,2.933879140489032,-0.46282747535339114,-1.7199780636897413,-1.01998740911614,-0.406866592293917,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.04897174356182843,-0.3676084862290635,0.9387028981245669,0.8918277660343057,-0.7366479777100163,-0.33317336104618817,-0.9185779389595495,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-0.21696194123607038,0.21555874139491749,-0.005133162761840726,4.209335205163436,-2.985056254482762,0.1462920409430946,-1.4879483835912106,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.1919697926532478,-0.06899302259156948,1.011479220945279,-2.6782330940108325,1.4957262168280048,-1.167204400077594,0.5412644793623882,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.797384096830145,-2.8858544823493006,1.4613598752639518,4.082334904310998,-0.48025789276661146,-1.8693084187642843,-3.9155728821524383,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.8513327899828025,0.7458930410858058,-0.7732225705417501,-1.4870005874864665,0.6145060572057287,-0.45127579686900166,1.5047009176226747,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.2510116832256535,0.2754714151780169,-2.265757658761317,1.229877962757745,0.7099703142373317,-0.5550915813556282,0.20254867074113803,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.02808083853107,-0.040629553520089345,0.8900206816703727,-1.3480875179776237,1.3442347323117394,-0.7538223926536042,-0.6342339871101205,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(2.695776681946838,-0.8864088092399576,-0.0789578748776445,2.0458434092506015,-0.970225560557315,-3.0770089140411643,-0.3020299079680173,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.1631434432249037,0.2854532336635398,-2.390500707033707,1.7344940763151517,0.6923406830495642,-0.36218796498051203,-0.21341989806423345,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(-1.6503048195027281,0.5243299697796613,0.2251840345614935,3.781488078646145,-2.8118176812215054,1.6996229508611647,-1.7849702798837712,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.7841357579086083,1.4436543212940578,-4.6726465448085035,6.434459937635292,-0.5846417872195009,0.2849453543668835,-2.0775372719522043,1.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(1.0822211355799545,0.9994266546847871,1.0465138567217758,2.0558098640968043,-2.639498177967953,-0.8840583888113261,-0.6825001012379466,0.0,1.0707345643119455,1.5197069890176385,0.15944323972018903,-3.33715397951527,1.1562569334087802,-0.31728557033406735,1.7330782711294181),(0.848338734345929,-1.4745072026687287,0.37318698837288045,6.0929889409953235,-2.860229206267653,-1.4979288865033067,-3.1150236297626157,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.2995339588833392,1.2407288550263273,2.640609187687466,-5.723460643589443,2.7512517947788786,1.946472506752308,-0.012081582228990029,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.9946726154312155,1.5401885333052683,3.32058260159335,-2.7680757902230586,-1.5330279328773837,-1.0093823869079046,0.8835422971914466,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.1653969392564758,1.8477252075676,1.5154492658344962,-1.5050500138182235,-0.4399475400838969,1.8901940665945647,-0.3337717224590103,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.3410474945205646,0.9406941157522144,-0.31346932922698456,-0.5250458393014832,-0.5348245647633945,-1.952646624466109,1.3913067179555951,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.4376595283129783,0.12884481167739992,-0.7153536782631447,2.2980804863380264,-4.310130247410337,-3.425970247693062,3.0425484210457308,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.4242822094686205,-0.6739175649059916,-1.6207631956139514,0.9215275442056382,-0.2255601728743668,-1.7552758751749484,1.3017469600205345,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.5634426551277789,-1.5471077082024784,2.4165088824982957,-0.07551896335863666,0.7259879191915617,-1.19324872205996,-2.252728223170336,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.4438980206249631,3.2154267346236893,4.344033519574632,-7.789482359991429,0.27392642950548796,0.2323729828915657,2.58660101167189,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-1.8266978944375327,2.764653149219914,0.44269893736952115,-1.448029334618218,-0.14573666828341858,3.209923834413559,-0.1568551995293309,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.49796742294949103,0.38611648047359515,0.947852631250811,1.921055938334201,-1.6442237026351973,-0.3807946252730803,-1.3171989797300596,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.2825028600006064,2.4079617426078688,1.3943677343584104,-5.068702752063692,0.3262485206507727,0.361686441352446,2.7646386524149182,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.22492901625026118,2.487212601897629,0.26524983577107275,-3.2366605539208284,-0.6423312073077014,0.4599935245385812,2.860371878492055,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.04824496005648782,-0.41434421911898167,3.2271022590248886,-1.7830389885935827,-1.0845055278057123,-0.9148118678714859,0.10175737670186669,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.2494445038361341,-1.2605077919460772,-0.5919596470609547,2.65848661076861,-1.137208814184975,-1.89192004138945,-0.36297989181266965,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.9368152698009182,1.4026143232862036,2.654968484232417,-0.48052468015489747,-1.4353801796778478,-1.471326764204455,-0.8054078742203845,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.1144180116920606,1.9104663145213592,2.66246604484307,-5.074755087317627,-0.19811341338412658,-0.9123477120908239,2.440556004826056,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.39453752442584944,-0.07366743472831994,1.9655786401195567,0.030511897442377315,-1.4873612106122647,-0.15769770005697964,-0.39586406801516416,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.13705225566650903,-1.066340745793812,2.247663742284547,-2.2163700069902466,1.650571100968139,-0.34030614914782426,-1.086715918625918,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.257058965850754,-0.4841613444620174,0.11928070954945669,5.903325224092789,-3.2500639441872186,-1.4374965938334754,-2.6101536572472206,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.3338018044957725,-0.25783497499040453,-1.912097518989901,1.7897855693470501,0.6967346574866409,-1.8049321045768083,-0.3259566366550859,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(1.1597881133675316,0.18269125188689506,0.8486870733972146,0.9187771036928764,-1.3457464656817628,-1.263601970316707,-0.28154047796298953,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.3007389767680182,0.46484767063945054,-0.4886824605041771,-2.4201895447056203,1.3963201084273231,-0.007673513374869891,1.4417809458190534,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.24963563676970935,2.146378372977968,0.7902446346235774,-5.6573637067026645,1.9861496459522696,0.7047213943168629,2.3463141909563427,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.5836918839436678,1.3008666070056107,0.598629993661711,-0.10362396303302328,-1.5961048239125133,-0.3129853796094125,0.7514037918744904,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(-0.5229752172383009,0.24565782730994223,0.6095967557050924,0.688197893976115,-1.2881263450703708,0.3444699274985082,-0.15860735569730788,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.713159371718102,0.590874479989717,1.8556281124000433,-1.0879792739972094,-0.885690863908573,-0.8000805235607321,0.1725076813209897,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(2.8728203729298416,-0.8175386138217031,0.21256366729230014,1.4640205139258353,-1.175325702074738,-3.3996480522044146,0.24937101097686643,0.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.26386100804843426,-0.681937012093828,0.8719546263837685,0.6595807560020865,-1.0334232838287962,-0.9176670256552146,-0.13807803400017815,1.0,2.1588268729540068,-0.12806427617611837,-2.1775450174444995,3.1817127002444545,-0.4258797833112491,-1.683360836803028,-0.46622958963287386),(0.551767614016228,0.7109567026227261,-2.4802658442092,4.901977885732814,-3.066882464644468,-0.2414288804598717,0.13906877696470232,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.9756434098282215,1.5177936333128244,1.0475803709656935,1.4474573922263465,-1.7751753583320031,1.6220531518629306,-1.4700570193599187,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.47763046455062,0.7743296610978223,-2.5287652392342297,0.7391934469677471,2.226326518880974,0.02544798983127873,-0.7676730030660792,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.610702152006014,0.42910678217008225,3.0903157899137983,-5.390224952610268,1.3934337695947003,0.31851454704530224,1.054856662581439,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(3.0958554477794293,-1.4621148020869976,-0.5551243999064688,4.452619430630248,-1.379337013287443,-3.473330945653575,-1.677775172150648,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(3.362080810136683,-1.1400452123643188,0.6638526272830326,4.3778813924145785,-2.415943199028577,-3.8808958633487163,-1.7763856761782737,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9515114782428997,2.5786148051977067,-1.4363545275647995,-0.6681291822406065,1.442317050314664,1.1465667088200706,-0.3269300577214689,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-2.847938296751167,2.712497525564083,1.1348510423230198,-2.2420055180148903,1.4487652612218769,4.619765374911169,-1.766502892457076,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.8552096265177644,-0.12433378867180744,0.06127441497123598,0.13124974598382613,0.21864608825429177,0.8516308714702762,-0.507455045151372,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9413220120743674,-0.6671836871322345,1.1048795184969697,-0.251817589817712,-0.10041503067356516,-1.389149792100333,-0.26046842750699295,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.8515854524357955,-1.7456600581314028,-0.03925421048801203,1.5179974737998816,0.921332613668205,-2.223550296257367,-1.5207136810245006,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.8801336233511907,-0.4540198439328891,-0.07161754150108735,2.585913277189122,-2.060344360858858,-2.3122434286920814,-0.05721742141110542,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.1565930942796394,2.450186149747695,-0.36499519602591257,-2.6865164333840843,1.7817709621251276,0.5854922377125512,0.5256974003979489,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.285833909861166,0.28691651999098333,-1.099897735586095,0.9901853501724588,-0.6044670039367862,-2.050143304937507,0.8657679727222412,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.445814401245838,0.617451576980906,-3.6857076155185244,5.807368947766343,-0.7232837434835624,-1.0478351431241741,-1.7664121491248945,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.5724051967604904,1.043672733945267,-2.0466438205717346,1.4988175635419767,-0.022443970841448557,-0.5668460356271273,0.202681936318985,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.767326428923734,1.3282660371650246,0.6148708858259404,-5.476743033106995,0.10974913440714529,-1.9823302577814652,4.841465646867359,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.267326496231199,1.617557661552171,-0.15134447708394183,-3.488157628617435,0.05177221139688082,-0.9171772512777149,3.3253618318584692,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.0726650800289255,1.8463940170697746,-0.8554291334165234,0.2971150824858356,-0.9787305516015852,-0.15059128685897505,0.9251737194989748,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.6000678810964989,0.009464861555371407,0.32537504910087334,0.8785831725401735,-1.7720188770580114,-1.041503294055527,0.6853035439619124,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.31903474892623174,-1.9161472026304565,3.249115661818257,-2.064008784693295,2.2511539463109678,-0.4181721655528234,-2.50536511723279,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.27724311948888514,2.269876913502752,-1.0362588939415787,-0.4240851576553433,1.2557043908056547,2.115539216914462,-0.8397651617945024,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.6204471977858825,-0.7472757671052046,-0.44286591935948816,4.984083392550257,-3.765441418069141,-2.3924356302645933,-0.39967559303850064,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(2.4553901093631776,-1.401190635652457,-2.3384856201428965,2.7925686994223646,0.5230823350598678,-2.536900987998952,-0.31452413492174003,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(0.9908721193084293,0.33504947512645533,-0.15004041559882886,1.9914202896753672,-2.15972930497663,-1.1173470973110544,0.2876627916908172,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-0.4268729371404919,0.0476100000649724,0.7234066075866292,0.9640920579044465,-0.8390128813007733,0.36362579291343516,-0.9290133023411948,1.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.7223130581227628,-1.5033618740143198,-1.0063691155313,3.7129996091186506,-0.18424839092347522,-1.9124490582287537,-1.9006188557753505,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.3863018949780674,-0.8118812038086545,-0.06824465995756457,2.3605677632827864,-1.9190940321241714,-2.074049594905443,0.10164582500649044,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(1.122137640295668,-0.7053791921624009,0.5001218626585733,2.202098650241533,-2.13406560335504,-1.846073420077453,-0.13442355611826817,0.0,0.20030571699179767,0.7574556531157274,-0.9544060121022918,-0.8745823460205342,-0.1314920389612082,0.019391277336385543,1.6943624790905165),(-2.612008274681875,2.9273962705582894,-0.6255802858328701,4.821435572962468,-3.6682637014042756,4.076926276736118,-2.3267975850725797,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.14722476209464985,0.7169962280383986,1.30877628107509,0.2902560870390723,-0.5278822077282794,0.2523150652935394,-1.279708896388758,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.7291366403013744,-0.5270029128179039,1.3646324243209347,0.22878411183186387,-0.6994553559333184,0.18645848628858827,-0.7164866293982425,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.3179603782898544,-1.8426294837876296,-2.0930634395627186,2.2618833621656558,0.4353521009755007,-2.8422362994637034,0.2651206458970319,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.16403922504683877,4.218117350808432,-1.464621892755238,0.4525429538867001,-1.1098371609469235,2.24664042651435,0.36048324675723487,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.3213609724022466,-0.025854561408853893,2.639880414243348,-2.0411613386965612,-0.2566331978960029,-0.15905221997635197,-0.12531363631323988,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.5267173926293351,-1.2061059553159688,1.0942381290703467,5.103189751648365,-3.4155924589635265,-0.4164954791259518,-2.502649328522689,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.4855645347515395,0.23735171533067967,-0.5003708194846357,1.7804232308433463,-0.7957779583467628,0.6944973953194824,-0.7601873835159783,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-2.3971333169627815,2.1868183332652453,3.3450712958825215,-4.719603701036977,1.4718198666990285,3.3830233233505638,-0.9827919370657879,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.11857678473749,-0.2366895620149072,1.2347293251374487,2.4546831756152896,-1.8039261811587064,-2.269262710480983,-1.4811644132395334,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.9259627347147839,-1.2059713052048235,1.6474462871354079,0.788474193584277,0.4987767692224161,-1.2387227304804325,-2.2836695458167746,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-3.000029275289839,2.924265303236554,1.5287904697666397,1.8091750655228505,-2.173785091949717,4.4352889084307785,-2.7944599158598593,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.509417258150962,0.9345200865941814,-1.2065038607091274,-0.7231863787024786,0.529992343413479,0.12208026281018039,1.064059623279838,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.843381208944096,-0.7839641420793553,1.1047338725131475,3.200498581509832,-3.6879624786217464,-1.9826767010553936,-0.17031233402775825,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.6996453363330898,1.834603462699156,-1.9563488472181594,-0.8078842985019533,1.603757579443418,0.9023581741197092,0.4157203160510998,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.8780698333418597,1.5711743895099697,-1.1532301645027747,-0.1279147199475934,0.3940852348745265,-0.6780554823489231,0.47599660994228743,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(4.074460008738832,-0.7586132247609974,-0.40680550183518793,2.80044141991812,-1.3520950083731564,-4.299897567538348,-0.23018611363621466,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.537343474263246,-2.346504411277027,1.0696587867609815,-0.09139515915291577,2.6976348801496677,-2.9037343661704513,-2.358064375853471,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.13810538048698184,0.4972293743727757,0.5170017632088637,3.8074275771962216,-3.441529620481504,-0.2520767485969924,-1.1460977221077522,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.3716927651804762,1.5264964546073356,1.4116615829468997,-3.2696400437607975,-0.44330241396466785,0.5126776429602927,1.8969558924443808,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-3.914146075904356,2.642868730715806,0.756953442096455,4.602054020453453,-3.1534100284140263,5.342012379341791,-4.033424004180775,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.6610025539601961,0.47098027882213267,0.09948302448982482,-3.936612690667609,2.4394531934109507,-0.2612419251520717,1.4621079847055367,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.7686849946406735,2.704509185058657,1.3450572364169955,-7.822928994397781,2.9044544260546163,1.9358105418972935,2.7734907448226678,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.080539638439189,-2.1322877957031263,1.6986178322913714,0.36371624049923845,1.429812500230177,-1.7326917232712606,-2.4425242014940247,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-1.167900481192102,0.1355097193610142,2.9097040430835177,-3.6404520903908724,0.9713474861844931,0.8816977448790321,-0.15831403216669404,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(-0.45514503610371104,-1.9645298836180913,2.3714681761255285,2.487263886450227,-1.4334710076423254,-0.7560866446214036,-2.677795087997294,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(2.205533638434593,0.1522422005591213,-1.2695825588015412,2.5717611851063906,-2.15564597325238,-2.3135028542159386,1.0008109723209975,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.1514247059211036,-1.0644545346285557,0.889971896861668,-0.8027781017855179,0.612875597105246,-1.7103926464884456,-0.014562305063810954,0.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(0.9177035463916016,1.3689702950747875,-1.3645490052164024,0.12947308667161297,0.383804924036368,0.15022529478155294,0.3474568882561838,1.0,-0.27127739049078037,1.2031874008603718,1.7773167215990346,-7.727460299109753,2.3889506493244994,0.3060921998513676,3.489168955680098),(1.0510311481075103,1.6986541281639824,1.4298397013825055,-2.24828571804734,-0.6193865199766544,-0.5672340485010048,1.131261958671076,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.10475037404319854,1.9826630391809927,-0.4359458701822585,-1.9789206321994306,-0.5553707561694275,0.7295103208665263,2.2600055064016873,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.43499110833343724,1.5870101815511446,0.9402541543282176,-2.933159361296762,-0.5955365826478517,0.6100236545656817,2.1125115594475554,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(2.4357050136448253,-0.5731495595770033,0.16933618049977095,-1.7352638099045383,2.4501836994395925,-2.140306061138697,-0.24355599298923802,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.9152646709544332,-1.1044398743526131,0.7264309168930094,2.751047949593423,-1.2155360000324171,-2.376314205559085,-1.5965277293217528,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.563555126365538,1.5905399716363626,-2.054401768001512,0.12558226223380958,1.579243827915478,0.11405592777658333,-0.21982342334862204,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.730455784283673,0.6917046084758414,-0.7228104495687078,3.170055958828353,-1.447442840589877,1.2822906006373609,-1.5715790666666658,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.5567147832410433,-0.38074277886588925,-0.7250043310190759,2.9890681820702665,-1.7854730460169494,-0.8300350245815701,-0.38466093931103296,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.160113601533908,-2.0739287822796264,0.8656089350937013,2.5598075614900306,-0.4549159561400836,-2.039598659196028,-2.035308932344324,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.7301212300757651,1.7905058319133835,2.4785558633754987,-3.285854075731725,-0.2969054302783658,-1.2196278928218516,0.9665388396475895,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.15809910063242794,2.086280383850715,0.4267158940755982,-5.777388598503115,2.932621582965904,1.0770137767265244,1.8492278105417443,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.4346732485474898,0.6310734941541358,-1.404853676310947,-1.1002807120165736,1.4475439430359827,0.2545978186733911,0.8147445978455613,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.7111994909007124,-1.2485377736456615,0.00888551426993378,-2.6270035371594207,1.5232308527755958,-1.511116569724326,1.8232379971332986,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.7009681274533355,-2.098511498004252,0.49402451683802484,0.28198081101179506,1.092044026606271,-2.5049127881573976,-0.7737045360739153,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.350857441471699,-0.9080776890873943,0.4192135312704207,1.0335209980632558,0.5496545069678738,-1.424954540304835,-1.4810527974238206,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.6110098767879673,-0.19648138768779044,0.6976256713944607,0.7330099435441839,-0.4509443081740856,-0.6919587079193924,-0.7985836940346585,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.7120668607049034,1.9568572093714138,1.0113558871394959,1.03831694531311,-1.3192489094050812,1.7439853418610345,-1.6131748737045164,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.025810229759270387,-1.1821577183920273,1.3502904597295187,3.316741043641779,-2.023622604735853,-0.7820762681282083,-2.2180784244243403,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.4823313839367841,0.9550640446662372,0.7796517614669789,-6.113481580673545,3.141750466778539,0.037999576976416934,2.1678622639783702,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.3198057040263189,1.067353282335374,-0.03774758522041055,-4.276016524189581,2.3619524359005077,0.3465583522342412,1.734889684984254,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.3206279075878253,2.9104551041192077,2.29210751642639,-5.248625098223054,-0.558629284361523,-0.6422444653370927,2.973566459413637,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.2335520332662372,-1.3483862701781133,1.6523781388128378,2.032580021967608,-1.9769743403072197,-1.351134129026289,-1.0913704298839408,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-0.006197780146330656,1.5659161747636117,0.47428711078179253,-4.163105473654435,0.7532395776393404,0.41101356739081774,2.5389845366598145,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(-1.653872981072018,2.150652366216212,-0.682391413932038,1.0683573143849745,0.1041132013079018,3.2579744909035644,-1.7333419946625157,1.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.1929822852229999,0.6893229432312034,3.666180819002058,-0.8739189672652259,-1.4699333333739455,-1.292656078547559,-1.1401278912126873,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.155136793407768,1.556608797804812,2.6765890234500116,-6.068904790037338,0.06903301027490838,-1.3072077729905347,3.3564000590548333,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.21045240367371898,2.426324089796932,2.0395576967297147,-5.872734043014707,-0.09982516278127862,0.12243072729230661,3.4253409716774006,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(3.17277330610435,-0.4559861433811748,-1.4534816279072529,5.475931755644249,-2.7552146063412866,-3.221196770695242,-0.8814034920122698,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(1.6588973963601246,0.8461887027217563,0.18477915861912242,-3.5310792828384088,0.25782571964298096,-1.7173208517757454,3.2150078520616185,0.0,0.533518024888681,-1.374203575705224,3.332835310287897,-5.6590997182051685,2.4511299738745937,-1.608623021211426,0.9323095857175738),(0.17118349950674683,1.118995662564974,1.4568293787618913,-0.5051347078771523,-1.7022847156761762,-0.1348235263823884,0.47918217936316587,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.22222924383517895,0.11857662096295907,0.07650096299472098,2.0379158249219897,-1.471446181869702,0.1853732522038508,-0.7926848379983182,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.3949446302922746,1.370416982034507,-0.3726578951573005,-1.507865895566473,-0.619512343610795,-1.0233127750108155,2.253197907579775,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.1892991131649973,0.2446002905843807,1.5298718807562723,-2.099232339908538,-0.5056025526011423,-1.5804405058815307,1.378631760774571,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.9397609220772734,0.14612060976419405,0.003327490192374327,1.4823264748097986,-2.108057107017595,-2.2375080799048814,0.8543685258649079,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-1.9375716302148769,1.8574155817438662,2.006982221925343,-2.0459560007405906,0.6658052443469802,2.9620627786230567,-1.5001878399436688,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.2402192482549249,0.8729678849935101,2.1191043260999765,-1.8209285767011751,0.0702401507261432,0.5135562190468611,-0.5577240325203157,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.797645624903333,-1.5347261778272303,-1.4584107801210373,6.541970409599133,-2.25967473302527,-3.1433214379816197,-2.1371760232834607,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.2101207627001906,0.8178658070050348,1.345409305335169,-1.9521840925844323,-0.8292096750094382,-1.3207710619636854,1.5018732200296,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.6843456669089063,0.48885992756272634,-2.6849559269116936,4.369671523773933,-1.4771168062402,-0.9821022416444716,-0.4805026737266491,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.23784839921057732,1.3535111387210395,0.05320924751207967,-1.9541402009569646,-0.3500510709804364,0.5463348385111396,1.7919768604357116,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.13128543053550334,0.6798074445687711,-1.6368443198221256,4.528049001062067,-3.362666984877701,-0.02382357706983641,-0.014886019488387747,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.4538532345705868,-1.726862620300886,1.7759464630443889,0.9705528654666244,-0.49477289232990296,-1.4722744644269066,-1.4293619756392357,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.4801653855390309,-0.47453344733200986,-0.09260586995290043,2.687518390442803,-3.092103825000628,-2.3227047457368974,0.8704218574790192,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.5218708026806307,-0.06967317420230557,0.7596210580022738,1.4711668879037785,-2.2608212537809083,-1.0556984545567896,0.1697181766634217,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.4686426053930823,-0.6876980688572898,-2.318133723758386,4.0906358440061625,-2.2111071372497046,-1.888548462638197,0.6761113150287794,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.4655020791006943,-0.18262886630424446,1.9618533997695677,0.8126903231715692,-1.989649844992524,-0.17976489249510838,-0.6676474866827617,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.6720786039475946,0.30664618627008156,-1.7819670224326658,3.342376634237586,-2.127744178113725,-2.492973506799871,0.6527115800200574,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.7709544863051466,2.089208572308133,1.43733785954422,-3.1347865929904026,-0.7427482316186719,-0.29003767369798433,1.9880762501233427,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.004914193301878,0.8836225844754194,-2.8167544354447296,3.730548925991903,-0.14698284122574812,-0.6606442717965159,-1.1677908246516493,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.178670695122552,-0.37343176507494813,1.6102782889058491,-0.289668173735893,-0.5685426730499268,-2.544466773299166,-0.14330590112211938,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.450240693081766,-1.7077791947369563,-0.29053907727783956,3.1577977578818204,-1.574125943917932,-3.3781022323795638,-0.35494151519927786,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.7949700874472329,-0.6895749747428475,0.5374981044761692,3.165455372090398,-1.3991901354081273,-1.017110351525864,-2.011720496675317,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.9997776221443948,2.602928645773437,-0.6342952955734563,-2.148426258044219,1.4364180609082342,0.8128055918648491,0.4823811597366997,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.5142831732503337,0.39128528101053817,0.9008320554174565,2.720050611707023,-3.1508830104429366,0.18317686511736905,-0.7187511553625723,1.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(-0.24024843070289092,-1.3426586516159533,1.698263715427241,4.97158422740088,-3.607946860074412,-0.8589087656970434,-2.6384582242582013,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(2.0649229275070042,-0.8691362909724218,0.06127110963748894,-2.4577692790862034,1.3553513321670838,-2.5767544706205916,1.8244096384210655,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(0.0388578224017484,1.569409049304232,1.55168058988638,-2.7338899094060074,-0.4317685880775276,0.28142214179950714,1.2299760646928444,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.083150208364903,1.0544201332588858,0.4849275584677891,0.030545098979075733,-0.9479940248019967,-0.675804210647968,0.2250820171268385,0.0,-0.3194215339922578,0.7255222206183422,1.5762774480142578,1.1418654331056297,-2.496329543369968,0.14373598354206546,-0.4739282527711546),(1.321939824236789,-1.7325735166420875,-0.1953762072802312,5.922742281805113,-3.438389085025568,-2.409237434210855,-1.6126418088678278,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.08186040177412857,-2.5585139391025904,3.3632598057046548,-0.37100416034089057,1.3575022880583072,-1.1842671469006207,-3.156866442574128,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6532751173456468,-0.1563829566175261,0.38904035718586505,-2.0827142213294705,-0.505080151941329,-1.3800157395745356,2.528797835185646,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.315159218931961,-0.09574244146296951,-2.870390868688257,5.331430959491889,-1.6278329123179232,-1.819930686484162,-0.8286246222285059,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.235231767737936,0.7854330832954342,-2.148601058467422,1.895492977094104,0.5666083244157072,-1.056258020890489,-0.5215948847904226,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(4.241292917178763,-0.9860709778639231,-2.0009845087092635,0.962148112338849,1.76426913823527,-3.885947965014016,0.1282356911817848,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.1263292028928795,-2.4050273682272323,2.9554910083536323,1.7828090923807403,0.9076886004084566,0.3679450599509102,-4.839058422078569,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.7101470672682688,2.847398191594129,-0.5856330427022973,2.8707227771069346,-2.014245686136327,3.3640164995655213,-1.8361445565243186,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.38581091755503416,0.5780440904400403,-0.5071088914742421,-0.6090146252730738,0.060807864136913636,-0.12211047185114299,0.8896074381060197,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.5231754402233766,1.9421603486454766,-1.7729788908428823,2.3753911110055963,-1.5997916313255445,-0.3262735124330241,0.2706188768556723,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(2.820843966643821,-0.10692047584327335,0.9321887238014344,1.719981242218561,-1.5089437086452422,-2.919276123151345,-0.6623159052278418,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6180585065606545,-1.7250090425434537,3.183283866457158,0.6566647784968032,-1.9066003341979854,-1.0063287837463553,-1.1432711661139228,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.8520873302590414,0.9591953810947647,0.12676127726500885,0.5343659255630722,-1.8092748172332644,-0.7540690279448913,0.9279444910129341,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.31530621506647705,0.12176928364261552,-1.2806898307327894,7.142595241207153,-3.5977212186784424,0.5510238558258297,-2.725111194146174,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.3886220250322657,1.8576914505484492,-0.43244838707799194,-4.044760393601628,2.2839267628076234,0.8096845168000543,1.6330072957261046,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6675726022935767,0.20087089318493057,0.6845200898058594,3.6937800329175112,-5.330865424937081,-1.706760651701588,0.9784018600546389,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6116081865842736,0.6341537797659369,2.8798713181168587,1.1828301568793216,-2.9571969765156374,0.24906758002449095,-1.2907026715079555,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.6989473726151247,1.2498504500564895,0.2060774042696093,1.1690938756831124,-1.5014992194769494,-0.14794637691692877,-0.2834799610847376,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.5273671236385944,0.9999544767906874,2.7703496758203627,1.207722028899153,-2.501911705844986,1.5436946481674476,-1.9786310839177188,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.702511351487795,-0.34203109814603394,0.7835851548168504,-1.5405081514894055,0.2849694967382024,-2.0575090526779283,0.9992013412095553,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.9665214110949041,-0.19155552919216534,0.7199622529149727,2.9073996081407234,-1.9527120616051468,-1.1166708078512677,-1.5156463719764512,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.1972926334458771,0.28276647040138503,-0.5192444905278686,-2.5476955695233556,1.8593101847023514,0.12004744459504944,1.1846881329737942,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.0321665520706136,1.9966732155667404,-1.4686236794986778,2.3902186300815456,-4.092727086591983,-0.7734708607085561,2.4499981678087295,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.2698946255416441,-1.1605905587383079,0.4187489725358793,2.835484738320932,-0.68793046490086,-1.5864754446600542,-2.017976019601487,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(0.4416798285809602,0.24811827480851545,1.0654898348977437,-0.4024036574325009,-1.0692237349365254,-0.7179061516427682,0.48702102541566117,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(1.6907373915312665,0.5782488154633239,0.599945149500958,-0.2547283719058139,-1.1602651261549966,-1.7138182985715615,0.9289975810399699,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.21388172717674148,0.3670796032199588,1.8010065450197448,-1.5292034217343784,-0.10056573944930569,0.13923292684787758,-0.17493465232059124,0.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.8249165562810634,0.8118811935227044,2.3634010952575495,-8.883011395212582,2.455323134835944,0.3640943002357488,4.16121831002304,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-1.6123614832674,1.0270743358787555,2.4191824925784884,2.264244528945494,-2.9165944742592664,1.7064826406612614,-2.3591040913743972,1.0,1.391800054486797,2.431427847224013,1.7830407589721604,-3.4889040923857064,-1.6192782127145382,-1.062097100908419,2.899791227533008),(-0.6856967207299276,1.7525897024574661,-1.1579023328670028,2.2589448355407176,-1.2312457357134239,1.8006792346334546,-0.8430752755923367,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.8165914912002683,0.8803866404425429,2.316672635369382,-1.1810808635080954,-0.7924349556466443,1.8423790039564922,-0.7807611895668487,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.5010244046779506,0.34523810497714713,1.3435520505455572,2.1639508161221426,-1.970858397807827,1.4462679112274643,-1.9102916382971258,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5635922598273722,1.4033442818530633,1.683062562422878,1.0596983259384716,-2.158976282461896,-0.1331177596503839,-0.9781682769599302,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.28304003232809394,0.7811221245610349,-1.3923039114076419,3.99712372860234,-3.032968329036988,-0.08346940774160802,-0.044461198603807706,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.173115613211947,-0.45623120871027734,2.175888858443627,2.470563591949725,-1.8629450889871788,-2.445235352837583,-2.2353945966210875,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-2.202431357080454,1.7546984246056434,1.1591425658354584,3.296837897884164,-2.99390938476279,2.901907693620618,-2.5643861199437623,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2507060234279137,2.247796821591938,1.6608145081255743,-4.7160328360136115,-0.29001991756211454,-0.8166791671531242,2.9931321130155855,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.15573258355460207,2.172215007412987,1.8398328672983983,-9.111886152079743,3.1988497003563268,0.5434197773241329,3.727484292533844,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.8328725961197609,-0.6837726198347411,2.9609894373395536,0.8541802329628736,-3.0704598054272783,-0.5282371583328125,-0.3954644151370479,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.2305590281166081,2.1714878997598683,1.7808987263571887,-9.091214440959869,4.142077261397787,1.2804508330843913,2.7234893852433366,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.8464950859920972,1.8457460443518234,-0.7052530209199774,-0.8099187003486551,-0.49123726501052833,0.00934840017523153,1.4156707278241676,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.7264984103515051,1.58762223148286,1.2543531688970304,-4.576041107988799,2.0471164338092316,1.556043827297222,0.7698900485966396,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.6310968833126964,-1.1557887631194408,1.8551643762629424,-1.3835655412181143,1.9814966914722598,-0.8322607453940875,-1.7817987572702223,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.1199173655735954,1.0316065570986357,-0.7388254953223654,-1.5610525631124597,1.5291161750630256,-1.1331188201036435,0.6838798263486152,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5793958654817044,1.1370197985890995,-0.42699818741119544,0.451226751321184,-1.1762866346999212,-0.17284061128496353,0.7719883664743177,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.8052991708512645,-1.1543441822283065,-0.3079753774879235,0.7547558056367234,-0.39720293791911077,-3.439804665164511,0.8189837917408398,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.4024940524681682,0.7830543837865398,-0.11283237135740953,-1.5985039318124916,-0.026048812102019037,-1.1984529193448816,1.7287177333060695,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(3.0147217767070127,-1.0200781629431939,-0.7724586754852318,-1.6645919990450377,1.9943933870089592,-3.191360642502209,1.3263216762617858,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-0.13531722708660943,1.9535028451727992,-0.04964794910170134,-4.546755747571752,1.8947915970446751,1.1248070457112436,2.0824716923788533,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.5780057561867775,2.4389883284494083,-0.06177856070697829,-2.748621215287728,0.45812115038086476,0.6152223729044103,1.5886901010362529,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.0546518884657923,0.18234244286557466,0.11030325399538321,3.2191661811958934,-2.36593743964414,-1.0692768734441718,-0.976407733545978,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2933529177327734,-0.30513242091723924,-0.5615862663372806,1.3659303219726464,-1.362414397386018,-1.6806085153310848,0.8272333759272421,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.2391823930807615,0.4859918391655791,-0.4928502195038118,3.3616731079156708,-4.091655429873027,-1.7086947303342366,1.1409546244149862,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.5054439327223408,-1.8924109686046506,2.5786138973436095,3.887056714146377,-1.6860332497357198,0.5234956471939621,-4.2927091788856995,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(-1.3147049070042374,2.9550742125471636,2.0805292078567885,-9.458984787991394,2.8909817970255327,2.2781958951820305,3.6332132074095567,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(0.1283229732783333,-1.5808489621836723,0.8581958490255427,5.390836449848271,-2.2509658655011426,-0.782618186639205,-3.5335726851924387,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.3314464140423534,0.8129182143050286,-0.8520617594080788,-1.0575404326246254,0.7809407543778316,-0.7064459840496876,0.9995381008322716,1.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(2.880225665985992,-1.0411359815296204,0.0510449350726625,-0.3878704148669313,1.401121588230164,-2.981523988078325,-0.2104726020045955,0.0,1.0567599957823515,1.5799941153962338,-1.4881062038692663,0.47637932703969943,0.16580318903746272,0.14603942213942162,0.2584430082763295),(1.1046212143302618,0.987236550938289,-0.42669185582239033,-4.241325872971698,3.3415739009279566,-0.08424468577629528,1.2092562055909368,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.973789947376512,0.8223402130701964,1.304490015055944,-0.8651390659470903,0.41682754650717646,2.4517085988221443,-1.4055044396931808,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.06981536179516334,-1.2065227695226142,2.2774676130672953,-1.1447098015872619,-0.7121456855990037,-1.304068586802913,0.28777483307132834,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.9795069078477965,-1.4473444569218747,0.8422773780928017,0.6313697742033327,1.7025648211172815,-2.0075492615530264,-2.333059370251311,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-2.0600652063829266,-0.6333837621853073,3.468536748603692,-0.8913322423271115,-1.757462156010717,0.812572213213716,-0.6022907633519164,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.98791867951561,3.031826514239644,-0.7924161436687038,0.12654610966629276,0.7081579465881396,4.176833422654864,-1.6699406256082212,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.8426115606298852,1.521152762657554,-0.1337230146189129,-1.4434995314881074,-0.2896581375563225,-0.2428413848621396,1.4665671078648115,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-0.7284609427171894,-0.0633581959686611,1.1837577791819778,1.4350302630784448,-1.685312280726362,0.3762055904421248,-0.9917669857292509,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.13284448420444384,0.48989059418620295,0.649707339140327,3.1534094899577343,-3.2386106987041243,-0.31590614582047116,-0.7870427657819528,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.2813990054292852,1.8372801264131764,-2.379643406798959,1.3652576471003457,0.8512744869758768,0.5316461788691897,-0.6156053305262073,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.2891125617289863,-1.034466590177339,-0.8528073168005216,0.25565750615528443,0.9498395616806752,-2.48113303573229,0.3410176709625573,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.1906881283588873,-1.056056540973113,1.3574824118581417,0.6476728621753428,-0.1322934876060734,-1.6819740111315091,-1.2235936957518294,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.3905684814071666,1.2466198898609266,2.259663679830063,-4.14763740755883,1.900848972347196,2.0483451909922756,-0.4555035477919126,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.007915404964254469,0.9420317471279528,0.294832519263326,2.582719495108136,-2.3945080639778853,0.28592816588339703,-0.9237809797403697,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.583521877945629,0.5331277730352217,-0.48721239763332447,-0.9498752906318381,0.346744013775807,-0.30613068397450366,0.9852227565956533,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.3038572775603694,1.8199226286216352,1.7209044780887788,-5.871244361704007,0.03082808989632535,-0.3313693128329034,3.8557824350560352,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.4668677560682444,0.615864357805121,1.7525182699336228,-0.8210346671163282,-0.06020757379664965,1.6749795990476146,-1.2205165325854055,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.6437634561464207,0.46869838369521777,0.2512633646181748,-4.172634394188566,1.8972887815402877,-0.5040107496571128,2.1281248265853847,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-2.566685802269739,1.3703937592515176,0.5522319795313368,4.714571322966261,-3.304529843224266,3.1700807408713936,-3.0669517754857556,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.4321320759545988,-0.5852717998212875,0.9344530828549473,2.2230574005646426,-3.0763883080523486,-2.405005631784908,0.40557678200484926,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(0.9641855971738517,1.5212499636636303,0.6152159628327369,-0.6607640817743697,-1.6102751585503117,-0.6616239847898601,1.3104820483943997,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.7048725942936547,1.6561110071176048,-1.6410777840461575,-0.021542409537615766,0.8497272700517364,-0.27637230275554314,0.29379908986403824,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.3877637394253206,-1.260106166916444,0.24240366155067983,3.254511285225256,-0.3359126390530982,-2.495451370201776,-2.4430734577527575,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.7159795394991253,2.058479403961047,-1.0298338285959132,3.8830429726396325,-1.9236847469944287,3.092667652752938,-2.2573319930263267,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.61157813457322,-2.4629468072718197,0.5947853311127764,2.611227042557338,1.956298392040809,-2.746393521796805,-3.94414512547543,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.100378156997694,-1.0254193606740454,-0.3383292598098695,3.2522179469555192,-0.9092591620666294,-2.3140923190362463,-1.4339917844306427,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-1.5793051540109753,1.6188751709051976,1.3848844184755469,1.166034226400195,-1.1259010183836429,2.4684572651406573,-2.3025016844857564,1.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(-0.16989054765279876,3.48842017914546,1.9300555017851737,-4.960543036879973,-0.584002148725781,1.2038222628858277,2.568256118525951,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(1.3846175270079646,2.145798875875564,0.1748386720212266,-4.796962390806608,0.5073503830831803,-0.7852786914681317,3.731869923790979,0.0,0.5800002689945974,-2.1615756870411738,2.5269458208248503,1.9798771742587695,0.21887790707228438,-1.3414848698386221,-3.75764168088647),(2.463498091505543,-1.641948347672444,0.014419220996607973,1.2485427665891868,-0.4093101695125,-3.315069785949253,0.14698377443441846,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3015458148717531,2.4084218001678828,-1.9377479084764957,0.1461762550285925,1.181541855937334,0.7614544555573661,-0.3175290393124959,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1995047619542676,-0.5685997445105482,-0.7780001688368265,-0.4208529275293881,0.5408090529552546,-1.441434337645698,1.0491529750596622,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.2789267591912103,-0.24431600650961838,-1.7008831850097177,-0.3956028703382682,2.2778328150392717,-0.6617441978281935,-0.01943996576935536,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.4426854749839935,-0.4544872588795166,-1.5961072511292693,0.12966802768765306,1.393550473376669,-1.1771061322845136,0.352301270605195,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.3811254347865457,1.3090655871933126,-0.27688380534200907,-3.0070886914719375,1.064692283384284,0.222022515151732,1.8721838900322956,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1193434289666437,-0.6252656232912621,0.23118248743666925,2.685581337005184,-2.153833997930418,-1.6998262419123031,-0.4037349176707249,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.929529577814512,-1.7024107022914883,1.2488247870677989,1.2738796125012244,-0.5345104518047759,-1.8796928677805893,-1.1427878473451383,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.8362075518180005,1.1085707711145794,0.9854067590709947,-1.314041820148795,-0.7016240360391046,-0.5921632413160102,0.8578333456580334,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(3.5781343752139643,-1.756334316490143,-1.8913637043295912,3.8207236620641587,0.5041362860876586,-3.5985748597254386,-1.4898228334981138,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.3438720049323608,-0.24833525627533626,-0.8346231392283516,-1.5319164096905173,0.7676105738102315,-0.5790077722354865,1.78082722778547,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(3.0647342782436895,-1.0260134932323655,-1.2844635442292494,4.455520074360008,-0.33555784108704956,-2.780046271993584,-2.251683378416552,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.1706511098490927,1.427297039001016,0.16198610469672814,-4.678308717576381,1.9758795045738022,0.4947574282507664,2.2002784569922085,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.562622677878104,1.7307650405142323,0.30622820821123853,-2.7159606100756912,2.3010271547514884,2.9293712371855865,-0.7525506989141675,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3230332705184404,0.43074369107629307,-1.012178677869002,0.3764842669438245,-0.08467152822680513,-0.9691680411489616,0.6840966010729281,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-0.6935320192169789,0.7446618818491898,0.09665333347742111,2.668069679850536,-1.4079283621598315,1.2190489986881268,-1.877269359035067,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.6615988715176795,1.4283536020765286,1.1939007488960722,-0.8584576982487286,-0.9666534542260612,-1.1587443010384395,0.44873555048520886,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.3850989235975144,-1.321996217461353,0.6533355400578518,3.765014097672636,-1.0657673636987341,-1.7288501469488284,-2.7515588732367537,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.679404226498682,0.4488111266798771,-0.09194107232644777,-0.1276070545791313,-0.6321422212401715,-1.5847461579670379,0.9576005483141299,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.04659758707243,-0.09637025410588262,-0.5301580315997092,2.3882076811218886,-1.1488798805266265,-1.9448358030407187,-0.4760994417763218,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.9502778204515043,1.560900513420219,2.6139226644509987,-0.17703081525604314,-1.3385353345210982,-0.31964658388963124,-1.4084087880151692,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.7064636980022851,0.7232269304349839,2.122895762364635,-0.16484613782968235,-0.5171650348762113,1.962539190063468,-1.877610385342741,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-0.27650843111684753,0.8824040605554635,-0.30196780207451157,-2.686121134883907,-0.17986243753961562,0.1554027845787418,2.9180254329681845,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(0.4055828873228918,-1.686704469180161,2.267279261928881,1.4120459259316966,0.32553090572843124,-0.9591177085579479,-3.2406871412917724,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.7528205900707885,-0.7838213498913917,0.42720475600569097,2.4810550424721343,-2.2722544267653983,-3.448555825513464,0.07050855537470957,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.1680246800757323,-0.40872210452552404,-0.4508203946039193,1.8115932970624247,-1.3903370815714982,-1.5343584504031225,0.30070498273072843,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.641411139391031,0.13066169098555191,0.013403427494233067,1.5312226380139464,-1.797441178406297,-1.830627427150842,0.4303846195173422,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(1.955478907567246,-1.719506740185793,0.762082256889067,0.1866756780988265,-0.9744041434997593,-3.309776136185275,1.0986283866533104,1.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(2.029214776852436,-0.2878096697019167,0.4084705542378164,1.7382336286765805,-0.6833067762076729,-1.9810690593038442,-1.0883122722276921,0.0,1.695701231263981,-0.16867063677601735,0.5908825136117914,2.718573366080039,-1.3127841726517615,-1.5975869051979485,-1.7507584239074343),(-1.560341449711872,1.5663634023069921,1.0471848595431368,0.1098488111202763,-0.7390036919795584,2.3112166370786724,-1.236752105743788,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.2089307327631884,1.9964256833116285,1.226378416624192,-2.4725235681126247,-0.8107018052923085,0.30001515631040365,1.5070634835647967,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.9128041176239442,1.8895100577112083,2.2886808335130913,-3.820954170467079,-0.6052835544037938,-0.623305490142599,1.866033800845503,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.993453919875277,-0.901133069473183,-0.0373521979721787,4.2922014798199974,-1.4822374048552227,-3.057711957842002,-2.1409987015165632,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.6766898453496916,-0.5261764912138024,0.7312972156077737,3.9581515737988227,-3.6502190772987513,-1.4820841451981968,-0.7891414274310181,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.14295833912761002,1.6231233113707968,0.18467857172572733,-5.3244744678874545,2.795954007446923,0.8238138676166966,1.929063833460194,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.7984907565135961,-0.08748991514172744,-1.908421605424304,1.0997506504768602,0.0193869641026021,-1.6007691098789487,0.9508597268855666,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.4795447177170868,1.558265108527901,2.9519444855092285,-1.7082112440267474,-1.5242435982351923,-1.2321506790399888,0.17024643186890942,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.1397560857395845,0.9929628562316919,0.5750597254679413,-5.175405133250185,1.9970886299361146,-0.8051594629268625,2.6421930794939943,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.2740780719977765,1.1197184976428955,0.651490056121677,-4.4266113109917935,0.15736308604688132,-1.390854468713751,3.651477122782289,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(-1.0402991953119143,-2.06533833303297,3.758708846819417,3.6643483716116036,-1.9836502961873896,-0.15018640286882878,-4.728987719679379,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.388042546834122,0.6351311476333177,0.3087393130542635,-0.9747105355778285,-1.2058573277731863,-1.5810825745871568,1.9467994460089018,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.6408026773429794,1.4879283180814786,1.547058272073475,-1.3451802114196914,-1.1447992224936614,-1.2638772850029756,0.7853236881637284,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.0708542922701993,1.2711484350719897,1.4339591134115544,-0.16035643681145156,-1.184129814417774,-1.5691360483142587,-0.16642233400730944,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.8610958818630077,-1.8798623440397844,0.017309940244927047,1.5547116910354313,-1.2884818488253607,-2.214675539259715,0.5772827870563995,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.31017681214048487,-0.5669909849550294,1.9488706008510093,0.8765489312330507,-1.1971421401945954,-0.8532090545239664,-1.265147944962231,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.18497775560572882,0.4850151901864863,-0.6551824564727529,4.63982714028508,-3.2551402962092797,-0.09431469092158731,-1.0924304335485553,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.4669444008351666,1.859760910530527,-0.10218608993775513,-2.7065907109099916,-1.0087009804989429,-2.1344551850779685,3.6376693906822846,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.8238485766287365,-0.3526798936194202,1.5512566546145274,-0.783457568001856,-0.609118220503116,-1.3676361438381344,0.25775920670818486,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.4279886506498394,-1.318933410675522,1.786893864552341,2.319001466307592,-1.3636960802506595,-1.2080158126691145,-2.140891357760963,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(2.3245577743791705,-1.655861652943644,-0.5357071043474062,3.763999930078965,-0.8970789230750165,-2.833502507806386,-1.5072610448030646,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.285195766833195,1.6783115876604113,1.513434891521249,-2.2682980117838745,-0.45638868017239276,-0.7418730885738332,0.9488865767818059,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.3481586273438384,0.5174277441556074,0.8785338801961253,2.8147248395427154,-1.9625677135620347,-1.0292085195161238,-1.7895813340376878,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.6954065675726984,-1.3664621081516608,1.5476108546333234,2.180283590956567,-1.293895789561963,-1.5096513815855221,-1.7765071005868003,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.38827399019045394,-0.49792022753587073,1.0198058264078862,-1.5037569154998438,0.6543768219469193,-0.7437803404718291,0.2098285257737864,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(-0.3404731340559216,1.2427923266757308,-0.16300461061876503,0.2831612899496902,-0.34457609890571084,1.0720599628234369,-0.3514992450509097,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.3161748863138345,0.997351948912386,-1.0801295751777644,0.7571521026186296,0.0016508799060777068,0.48479285742246886,-0.13508160168753358,1.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.12681720829445697,0.11855714969664732,-0.9104184710851837,-1.085292209788002,-0.36232862899070417,-0.46951670408525054,2.366122573967455,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(0.7054632977954634,1.2572176853681154,0.860029635692299,-2.674401827682585,-0.6939897336698935,-0.6804162818791725,2.3309482151237217,0.0,-1.0528115875410609,1.2730779347336945,-0.28721494237508716,4.5331973204986475,-3.0601851835154528,1.6773444164064266,-2.050095126191308),(1.07976657146411,-1.4207183531564556,2.0010660824353304,-3.194648928592429,3.2399872347286767,-1.3523756841739691,-1.1253482654531937,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.23610519315312728,-1.7449703241490164,1.6819741303788158,-0.10873160707117276,0.05416324589686572,-1.3123804509649377,-0.7907457427267194,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(3.0428333674190866,-1.0841060957114639,0.17243967022211515,-2.377637313997145,4.364469885879871,-2.4605659936454316,-1.2447560474503905,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.6701855712395437,0.2928301757559636,-1.5428673307968002,1.287330415870048,0.2727252075767579,-1.0692518489650513,-0.035616454995755165,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-3.4800819804037824,2.977389692948332,1.8517753132543673,-0.19008504775532553,-0.7707879065175474,5.033813816903953,-2.5333706554638304,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.140202012142074,2.378634968895875,2.7556348176530534,-5.2834702463746215,-0.3652107320195507,-0.7350150171567257,2.5581641229084484,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.0981169615204438,-1.0119127261725325,2.2820770387227434,-1.9614013769844154,-0.5644666042090782,-2.284934214852611,1.078012639576424,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.8517786531323737,3.6302113892867838,-2.0029871207282746,0.2619852928861331,0.17390567848052974,1.6325105715744603,0.09423329683760107,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.4165800771742705,1.1149308340527142,-2.271387795418956,0.24518100275596663,1.6930308923123703,0.0011584811148082907,-0.08553747108993615,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-2.0053022769813875,1.9109759825293087,2.773376480448724,-4.517202660362165,1.395196983263658,2.817448384076263,-0.39825181111140695,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.5355188940690749,0.6018680914829695,0.7541924354853773,1.0775908586661713,-1.0907319838063005,0.7639886786882052,-1.0624390472003777,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6595797552374167,-0.294809475541403,-0.9630206945978195,-1.5012079340321822,1.0098225390572804,-0.8157334681048121,1.6881542023624867,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.720237261284876,0.11277874103206109,1.844572508290903,3.1533623636012984,-3.9104997386815334,0.9943897606151588,-1.3654061835218285,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6922463463083346,-0.35073899252145635,1.9626145160108819,0.08179158347355334,-0.9530812260330679,-1.159859309462594,-0.7170911906049338,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.6413378935676259,0.1773899280357525,2.490383604140318,-3.8237997263323082,0.3863233217240887,-1.1052859279962846,1.309165949800489,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.918763813284105,1.203162397621166,2.561321396321196,-0.3779626409007189,-2.283467449993765,0.8127359401206152,-0.31172201669053634,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-0.41808616994891934,0.6297437830552794,-0.43519990266235187,0.8152590429422543,-0.4861773114380574,0.7939395653553468,-0.2700384949502228,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.0589503046935691,1.1096474018520084,0.8430477162065145,1.017463543138896,-1.8449195206430737,0.23001103979814566,-0.41668386521379497,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(0.7035305093965771,1.852386714172002,-0.8581310953858379,-2.7047073013316734,1.7544323773483619,0.5857189112040242,1.2179049628159166,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-2.404521999474064,1.956856261585237,2.743662957828813,-3.763120660309916,1.2341598733468144,3.336518429323325,-1.0843551531070281,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.5787514548491495,0.9043297397824689,0.3647966016141414,1.5615325941265177,-1.2949689138659002,1.9742065688305668,-1.2806827013749367,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(-1.0235078222978835,3.0475095656963602,1.4758089211909295,-8.183689162345186,2.311408931029436,2.0996841788530536,3.4655603211752783,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.4171153313833007,1.5601837547522388,-1.788047063738159,0.6536070698420184,0.03991294542935109,-0.23285562477977859,0.5515980511199634,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.5943012663247385,0.768939524488533,-4.7102725616072085,6.878524574598383,-0.5433735742893244,-0.8204559726610645,-2.151320262569758,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.095928691139254,-1.5364598955767699,-3.539396767334079,9.353427912472746,-5.3917492321240745,-3.143207068564544,0.002434375177712278,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.1733973608839687,-0.4779398907232715,-0.8222573364108066,0.5741388087269558,-0.8233349828146013,-1.6623616225589888,1.4089015715206914,1.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.5968720217016728,-1.561183647496414,-0.5368548320897575,4.563481344641381,-1.1935320996872132,-2.9643545782562257,-2.0430397264366764,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.714041736048137,0.026319558085377337,2.358390982988962,1.3832961478997392,-1.1938325736946396,-2.6210410239146587,-2.0630733441327145,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(1.0224268255603193,-0.3251567068096688,-0.3890143766789398,4.248774781294234,-1.7156272804262211,-0.9098747934249555,-2.0634504893495587,0.0,1.040593452517384,0.4586921394256398,-0.12933873458544443,-0.318904627037739,-1.0558656645886797,-1.1779996974209512,1.531220594505215),(2.2466469802152655,-0.6104373122047839,0.013869093684521272,1.4174148121004353,-0.9299675669968678,-2.588397575094862,0.05056310478616921,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-3.734598766339932,4.357711910775082,1.8063222011726097,0.5647484734204162,-1.2668904831697467,6.168350149687059,-3.383175902767071,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.5075416946835463,2.826260938878084,1.6757291381825439,-7.312162195113464,0.5879313407461273,0.9973913776640214,4.309180001467237,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.46423411343145,-0.6005198090658379,0.9652261368365875,2.779552976547825,-2.60911189484479,-2.1363879310601983,-0.68726399922343,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-2.1740091482509643,1.7158438812483352,1.207751628708825,2.1653318489129973,-1.9385559871567524,3.0041298293453407,-2.4842256171560244,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.7576001841832798,-0.007594954223985706,1.0139997501431828,3.0324645799871592,-2.8287853572848425,0.352236350020044,-1.3663697410958096,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.22682005310878983,0.17882393778738837,0.6852239252823532,0.6996858648832547,-1.1005329373372745,-0.33694671576753815,-0.2923121947217511,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.6420808677485317,-1.567375548263394,1.3596455396410332,-3.18643779804509,2.6618463434153123,-2.2371667201597454,0.22533544015338114,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-2.4762355913130216,2.18020271868241,1.3238107587214825,3.0782376854873186,-3.2670188241062785,3.2966864834016447,-2.424026089867702,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.4681164581671533,2.7802016066061546,2.4377514573974084,-3.504681185661089,-0.33038317365035264,0.576740491675048,0.6678482697206392,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5911030428508862,-0.16060250554086664,-0.01306065642624099,3.934006680488941,-2.120769002361267,-0.6016009232082299,-1.8031712223115948,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.174745604954626,-0.4965423351198456,0.5943755851379704,-1.1052321260476299,0.2661649679666236,-1.5726083173913104,0.718004049467069,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.7412751177208392,2.1327090440707304,1.194964453595523,-8.044195522762877,2.831742609518064,1.4456391207259371,3.4658128935875947,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.4728274623052195,-1.4446871431555646,-1.473077006061342,4.962183982602092,-0.877344961449386,-2.5959492339011856,-1.96852347020304,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.4964109038216507,0.20917901186206578,0.033859363997187364,-0.5696525703041693,-1.37076844681051,-1.950833571036897,2.1420942100235636,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.45583852223057186,0.9139217880820522,-0.503312639124806,0.5499114765531566,-1.2222692214056665,-0.20147776675726137,0.8599714517914723,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.2737373806536043,1.27270826072556,0.4760375405877796,-1.801901825509861,-0.692130105318383,0.44709954001227903,1.6095875372621724,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-1.347794187900541,0.2524553675565264,2.1003710485812177,-2.9225590783504978,1.4128230662455974,1.4304610174764638,-0.6822127662589081,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5871361479153822,-0.8417339321943338,1.1995718501271524,0.8202523967506464,-2.301137318093607,-1.774115856891251,0.8098563835220876,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-0.21508659002268615,1.569888963274912,0.03986115298828641,-3.9601982606129926,0.9380243205292723,0.7121236564430702,2.5119291735464375,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.7941481129839723,-1.0798806957539784,0.025240123668783254,2.633977218875101,1.0284753931360715,-2.3842856430416517,-3.002641820170753,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.21207162097481735,0.4647940297522595,0.46295798512172415,0.3232524421339397,-1.6159135710807149,-0.42882666161264194,0.7335086616487765,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.4929756391749678,-1.155157311134643,-3.4806846906158686,4.0693214517288965,0.35597074350303237,-1.2793994744342176,-0.6586972623541594,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.6854581171681562,0.1834002919426212,2.0365519468046482,3.858832265773903,-2.607252553631471,-1.5355541412174958,-3.1426914316979495,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(2.8327800893646486,-1.7343614197962078,-0.38324008318772385,4.214850202134405,-0.7612512185075357,-3.2089289677127355,-2.1597330449132066,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.07122882463582014,-0.6138287383249159,2.384026551347024,-1.7146604393110776,0.6628743724080095,-0.5031775744589227,-0.8780321112073121,0.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(0.5714623898190813,1.8499637809618559,-1.6528766898390757,0.7922648746756872,0.009123352945717644,0.7920546495067624,0.05588645257506697,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-3.2633273539187027,1.911289368256512,2.065182047264482,1.922313389116063,-1.9358969584812344,4.156853974629493,-3.297822591979971,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(-1.0527594231003512,0.11046706857150712,-0.17034216295607751,2.002056902252602,-1.3909207669150798,0.9854200330466844,-0.729769914147927,1.0,-1.7952716016373547,0.7183349106068199,3.3300598259286227,-1.2033149160706158,-0.7588744068250339,1.7666798904766734,-1.6882292349201322),(1.9857432393597216,-0.797559664346102,-1.8628229075290526,0.7912416658605166,1.1189706285668513,-1.890957287869455,0.41557152949411214,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.504762737846811,2.1769977714122506,2.57992693306698,-1.8747939851770445,0.46865410489106774,3.7026137438952347,-2.2438143549852185,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.41886628561756134,1.997961493652824,0.45098865921149955,-3.9240951571422404,0.6720821012238447,1.1131211300973887,2.1496317763658626,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-1.269058850471455,0.9113128779485802,-0.987609614890711,5.17453944944951,-2.792635641455655,1.8633254768112497,-2.225434601190937,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.60221516530219,0.8573873954567277,-1.2532323321502234,1.4586670560212756,-1.2872866648841212,-1.184906097673008,0.88142213963169,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.664945717778535,1.7074410216455105,-0.9164942360480002,-1.7328352122931063,1.042439944629323,0.4681254075262177,1.034268339879112,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-1.0229129860675013,-2.780448032379326,3.2847626195180495,2.509568320419263,-0.8239377084416294,-0.47304522543584926,-3.9581559499963603,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.357349140742531,-2.30529006767782,0.09791220462993844,5.626021471718858,-1.5946347715827764,-2.1607839211751037,-3.248371527799422,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.19008566471204968,0.9075514438212983,-1.8650607875027787,-0.8680513536341087,0.7997443732584267,0.45238678503301627,1.526885288707088,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.9254711696053395,2.1750597750267042,2.1933277965486973,-2.4693963476817404,0.3973459599348179,3.9233999600808573,-1.2357640687177518,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.233619763358607,0.9913146965561134,2.3973693810536236,-0.8070564887140679,-1.45741017327986,-1.1664320360973062,-0.13201085846744465,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.3161303390254758,0.3276995534451512,-0.02889035651373595,-0.8230808482804979,-0.5319352491047409,-0.47967360079060634,1.36719581140463,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.5317287425894308,1.208735839267825,0.08407141955287045,-2.4813609730490715,-0.8888470073318796,-0.6122551141011588,3.060645109675252,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.07298769165290997,0.819808188036161,2.0384919882650516,-7.748399227191985,2.2435939891188377,-0.18719747936307643,3.6016374001334093,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.7901852621466418,0.5145825360308702,4.637957908386738,-6.150836801745065,1.3912229090534307,0.440132724867259,0.3252310211529108,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.831671718235779,0.5977438753380795,-2.321886357828979,2.9104235559256404,-1.017343884238508,-1.1877468146597532,0.22300620292739104,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-2.1539924701669846,1.883675370067507,-1.7680881855073274,5.807546701204832,-2.7646119804927913,3.473472133586789,-2.7200321903160463,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.756348176804372,1.7615764405819676,-1.5388289669836195,0.07080621692501461,0.6426698929723338,-0.3106612170666746,0.277797622658288,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.2487545187544351,2.609229589371483,1.8882144277890807,-6.154774232631951,-0.5638199006934052,0.43112941318589476,4.2027303973580565,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.10955533675333518,0.9087196837335013,0.1136664013383859,-4.1472494266956055,2.014924031822069,0.3431702042196298,1.8459002928252932,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.6652930532149404,1.197530864301426,0.9169919325624285,-5.961473613444594,1.8351066038331625,0.8272159997488158,2.950791256392912,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(2.9316838982943185,-0.6964392952831678,-1.1502529215081365,1.4921077726597665,-0.5780146627368032,-3.196356469849491,0.85907655235715,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(2.600077692763368,-1.2623740481307253,-0.8962595005959539,1.9679383389242255,1.2790953056015506,-2.4139441686510956,-1.6329167452667077,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.452791564760785,0.41146795445009166,0.14392806279219328,0.17108543131200796,-1.029600784845083,-1.469443131098191,0.8077470058618661,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.727098084005239,-2.5546937777149403,1.5105485872014457,-0.29443260630992396,1.1439390403078158,-1.9439707234539425,-1.1506513582879956,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.7021391905991415,2.4414499286754787,0.8074093066989305,-6.070712605446909,3.5191034192402006,0.9707334993431298,1.1288619039998729,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.9308026588402101,2.57928079368376,1.0748311675888704,-8.529095009719802,3.699706292413457,2.1444358957249268,2.9816820943899875,1.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(1.2360219692964298,-0.8921138259532037,1.324707218340896,-0.13529792443717042,0.03483533664127236,-1.7310071987282634,-0.5952741360978552,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(0.9580721326511403,1.515267173693862,0.9547831554732867,-3.792366629532976,0.14805240219415627,-0.6733000064089022,2.4871576141650023,0.0,0.13732503547731956,-0.3180335699548478,-1.6556599602211124,-1.1968994248078457,1.4860353840717266,-0.10837465708089232,1.4595607106322794),(-0.11224442995910122,1.6882722404753472,1.7161782543665778,-2.9486619700579975,-0.6165883797519401,0.3909989063485372,1.4200766219929295,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4004498564816448,-0.5483306586274586,0.6884992629346187,1.6860799533920177,-2.4028921057076675,-2.221265193101131,0.4912576499341499,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.239942383240145,-1.5480563981269437,1.8577874744757454,0.7272933808052509,-0.9344450764118416,-2.3269279460451013,-0.7435854860482998,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4542570156828636,-0.27176912816457977,-0.3618604064197557,-1.502224358768631,0.9678737333818738,-1.5496348751441344,1.2748010290281975,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.1468076270806558,1.2322052468347184,-1.7602650358096363,0.7212280541208039,0.024643216826090497,-0.1814752483470614,0.561492706792226,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.5077003347535025,1.088513118264028,1.7551210104319521,-0.736441038595527,-1.3056362875092131,-1.3166156974158438,0.2511173359195177,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.288389962747996,0.36332653636764256,1.6656089747619136,-0.571105661353323,-1.1612868506911342,-0.5432082064452731,0.11792111797788773,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.9995296056005114,1.3529339664784819,-2.3981864910916855,2.9849134331502665,-0.7407438786500962,-0.7264517691858112,-0.3538463287395124,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.08579858389687023,1.7161890418770884,-0.06656951353461293,-4.105281638118306,1.5285630478172285,0.8775192894752291,2.1152291309916,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.9661724849567914,-0.40445855460769375,-0.8984041426116092,-0.036985924898836356,-0.8750620577241204,-1.5780799558007883,2.1207161932972505,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.8699336332979304,0.6851162561092408,-0.9012433467548683,-1.8635864465365037,1.9301898676639888,-0.0891783038473156,0.689996751808305,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-3.390371025284407,4.3362614916709905,1.1553623702701241,-0.5402753273558951,-0.7164467112290367,5.759960343500196,-2.098251841172708,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.3121549519106877,-0.49079106810872064,1.0874868101059274,1.8775100736563255,-1.832698844916588,-2.771227001345358,-0.5639729980991646,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.5317909834339799,-0.31402050735813103,1.5222379228128546,1.1028560181554226,-2.2574716049926096,-1.2763341078397625,-0.0682234152133977,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.3489372887473756,-1.902965890195,-1.1058115737668315,6.444396538850495,-1.3013307250524164,-2.59335014865392,-3.2826286389085126,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.10352282484992748,1.7763521706893264,-0.98957323888984,-3.092145229794725,2.3159326671997436,1.2326770331559804,1.1091309782040397,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.6781201591090096,-1.2017056619726723,3.1386436103718722,-1.4826197651366986,0.7413994646513105,-0.061222556588136814,-1.8011807696190751,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.3088071867454587,-0.9058060170486686,-1.533795865471077,4.443254383671029,-2.2143075168348214,-1.767491483116837,-0.3779098725243084,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.42758387794542607,1.3840546035724883,-0.10889830402413547,-3.1754775666120802,1.2232929860961135,0.25803202005775294,1.7027079999027905,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.1914622420587,1.6808636178618053,0.5565573242166482,-1.954492290078305,-0.9510650933441838,0.14161140375081846,1.868522343287696,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(2.327521800555288,1.707072587638922,-0.3408892551572401,-0.7841366540150495,-0.30706125962166064,-1.403400095559777,1.139293148033613,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-1.6870712174917015,1.691651631532742,-2.288473035077086,4.52043452758501,-1.8935449916089768,2.9237857364797977,-1.609566360393679,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-1.733708401198054,1.3041639797022042,1.400544122440466,-1.9741481668869392,0.4617729940086308,2.3114245726840337,-0.5274602470044196,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.7575715367081157,0.3753135909060661,-1.2693308636208644,0.5371878918731451,0.5384575757585188,-1.153326220541941,0.20366235231148166,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.4883842771922242,1.7515504950397989,1.038220064787369,-1.3034051909539248,-1.3740421429605687,-1.0453541069418544,1.3316370102880164,0.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.816707826258376,0.9334850907564992,-2.7235167200741737,2.561614634752468,0.5749390983559122,-0.42892177674740073,-0.8151907044116287,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.922399180978037,-0.47398744746047616,-1.086455344591692,0.5421631590354696,-0.17489100087797138,-2.141675253309839,1.1382797565150389,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(-0.4370945240496815,0.7406706373308528,2.3817851052918986,-1.5970867983837052,-0.5383146950358882,0.43966344292078025,-0.39121212011259565,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(1.5227791882404937,0.032628064555142666,-2.7346852692959223,3.6243268586724393,-0.4338687119554254,-0.8963076772737661,-0.5620760681630759,1.0,-1.8640115706592102,-0.40916214327036304,2.2813656654619234,4.344613955177877,-5.128071412845289,0.6023055734635931,-1.5913288564396306),(0.6925555904243851,2.2660402104433004,0.571879255854077,-5.136520159556465,0.23388977994347782,-0.21095746484974373,3.839104184046647,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.6170807446057736,1.1618050798356736,-0.3318054593493467,6.307458106404423,-4.152242368795466,1.164412152487124,-2.6433851880918566,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.09933841297654922,-1.3009113230097453,2.3763024813118814,4.843663490637228,-2.7335802864430874,-0.8152959702787319,-4.019613642468096,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.29723257606972664,1.534048303390355,-0.9278630836202846,4.548220911132926,-2.2312916467625055,1.4265140750671224,-2.3032786031118535,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.8723473627536515,0.9717287860436329,2.3847715433643724,0.7344463319711535,-1.8629044282929315,1.9783943683566731,-1.8140411081153947,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.3005647919287311,0.3806355736171525,-0.27869848922330487,-0.8799959881301632,0.3995051923334578,-0.09156717805815423,0.6758278798998893,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.5955050165131914,1.450567042185088,-0.9897943065169226,2.737681953113439,-0.7663788673735875,1.811148094805718,-1.854983423784701,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(2.9669296357978334,-1.3324159367684048,-3.104836225416732,5.208190995197741,-0.8202049866634673,-2.9861699841871703,-0.7016133155919906,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.228016828510732,1.1216551175944176,-0.8558209427875334,4.258437071067928,-2.7976936142573496,1.759131670682027,-1.4539872453038518,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.2339963699690584,-0.2804755708218589,1.4715087228456836,-2.9261144609808616,0.355595728180802,-1.8268629783014674,1.6411674193628243,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.9659087122503214,-0.2548687699578174,2.104950827672197,-6.076161419668977,2.9878426404779534,-1.2192738796045464,1.5970699410759703,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.22061418917082676,1.7175054727901158,-0.5033501522353456,-3.8353548758394256,2.331439472843757,0.9401634108615404,1.4604187484921587,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.309907365358922,-0.12990852843173584,1.0737239270579344,0.7337127225434502,-1.246715098799017,-1.6078875928365746,-0.25052374133607436,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.36721164916342697,-1.7079119599701718,3.0068461711549523,0.14826986026046768,-0.8186880144087275,-0.9349454628893296,-1.5313812357768914,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.6398796287916704,-0.2454439388782933,-0.3454790010819664,2.792239227481451,0.15344573827886987,-1.0493634503221692,-2.4336157756640855,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7847363960073463,0.7363916664271204,-1.0119432855225785,-1.9544812667283535,1.277543003992446,-0.2529346594821023,1.5342034566540081,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(1.2232936134800012,-1.163429305152226,1.8203348565681234,-1.2313360448785429,1.1074565407265085,-1.7093423514569264,-0.9078154994566392,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7585110515783027,1.565377477710182,2.027749458360845,-5.369019478696252,-0.3380358319830341,-0.9500514254177758,3.588791253857626,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.7362390304804842,-1.2017843711210685,0.8926545968864157,1.2399265238688837,-0.050827310016290705,-1.198605392602416,-1.5046056364379843,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.6451221517395296,-2.0484424552178737,0.6171428263446541,6.422100778753815,-2.577636468051222,-1.4890401115179508,-3.785907231054817,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.765086441069906,0.3886895405231462,2.731661900411207,-1.3069068417000809,-0.19766973479399452,1.6879242979289697,-1.449585901495793,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.18985291006333638,-1.0740273879437814,1.2843531782256652,2.9867201516109323,-2.853724333474166,-1.267483825267256,-0.9631441174041762,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.9871628788591412,1.8534178483912092,-1.2805384917990295,-1.092147064487189,1.0822665318842248,0.4024378429492361,0.6510218029229897,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.3717600489367091,0.7167856864650772,-0.7499821639105004,-2.1169534465406232,-0.870825637391141,-0.7319917041438911,3.6275089929559368,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.34781014325513526,-0.42631045215441477,2.276403265265107,-1.7872802807090558,0.6460091472975253,-0.6707279710261537,-0.7145197261034959,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(0.6978341324237667,0.44583514954616277,2.5487409237553997,-3.883754805256149,-0.5331862190361614,-1.3497349443383184,2.16910621644326,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.42196177110466704,2.16561337972615,1.3262059312894516,-5.6286300261936,-0.08711234527451972,0.5828901807272211,3.841164934415239,0.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-1.16389008844843,1.2429168032114994,1.1288227844364782,-0.8914746299219967,-0.12326393212364906,1.7336169885979524,-0.6957687675851021,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706),(-0.97426704102067,-0.06480324801411252,1.2488895732194991,1.6784228029603945,-2.2987446544566623,0.42970828101052566,-0.7140097535913854,1.0,0.707294952739537,1.5034945173873893,-0.27126234266043536,-1.5739737031307273,-0.23896124879655845,-0.1412674512572589,1.6695598574688706) -DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LogisticRegressionState(0.005, 2, 2.0)(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; -with (select state from test.model) as model select evalMLMethod(model, predict1, predict2, predict3, predict4, predict5, predict6, predict7) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00954_ml_test.reference b/dbms/tests/queries/0_stateless/00954_ml_test.reference index 8575e00f538..d00491fd7e5 100644 --- a/dbms/tests/queries/0_stateless/00954_ml_test.reference +++ b/dbms/tests/queries/0_stateless/00954_ml_test.reference @@ -1 +1 @@ --66.98005053600168 +1 diff --git a/dbms/tests/queries/0_stateless/00954_ml_test.sql b/dbms/tests/queries/0_stateless/00954_ml_test.sql index 932924672d6..6152053f17a 100644 --- a/dbms/tests/queries/0_stateless/00954_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00954_ml_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.01, 1, 2.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.03, 0.00001, 2, 2.0)(target, param1, param2) as state from test.defaults; - -with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) from test.defaults; +select ans > -67.0 and ans < -66.9 from +(with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) as ans from test.defaults limit 1); diff --git a/dbms/tests/queries/0_stateless/00955_ml_test.reference b/dbms/tests/queries/0_stateless/00955_ml_test.reference deleted file mode 100644 index 8d19c2c21f6..00000000000 --- a/dbms/tests/queries/0_stateless/00955_ml_test.reference +++ /dev/null @@ -1 +0,0 @@ --70.73127165094067 diff --git a/dbms/tests/queries/0_stateless/00960_dataset_test.sql b/dbms/tests/queries/0_stateless/00960_dataset_test.sql deleted file mode 100644 index 1b065afdecb..00000000000 --- a/dbms/tests/queries/0_stateless/00960_dataset_test.sql +++ /dev/null @@ -1,22 +0,0 @@ --- CREATE DATABASE IF NOT EXISTS test; --- DROP TABLE IF EXISTS test.trainset; --- CREATE TABLE IF NOT EXISTS test.trainset --- ( --- param1 Float64, param2 Float64, param3 Float64, param4 Float64, param5 Float64, param6 Float64, param7 Float64, param8 Float64, param9 Float64, param10 Float64, param11 Float64, param12 Float64, param13 Float64, param14 Float64, param15 Float64, param16 Float64, param17 Float64, param18 Float64, param19 Float64, param20 Float64, param21 Float64, param22 Float64, param23 Float64, param24 Float64, param25 Float64, param26 Float64, param27 Float64, param28 Float64, param29 Float64, param30 Float64, param31 Float64, param32 Float64, param33 Float64, param34 Float64, param35 Float64, param36 Float64, param37 Float64, param38 Float64, param39 Float64, param40 Float64, param41 Float64, param42 Float64, param43 Float64, param44 Float64, param45 Float64, param46 Float64, param47 Float64, param48 Float64, param49 Float64, param50 Float64, param51 Float64, param52 Float64, param53 Float64, param54 Float64, param55 Float64, param56 Float64, param57 Float64, param58 Float64, param59 Float64, param60 Float64, param61 Float64, param62 Float64, param63 Float64, param64 Float64, param65 Float64, param66 Float64, param67 Float64, param68 Float64, param69 Float64, param70 Float64, param71 Float64, param72 Float64, param73 Float64, param74 Float64, param75 Float64, param76 Float64, param77 Float64, param78 Float64, param79 Float64, param80 Float64, param81 Float64, param82 Float64, param83 Float64, param84 Float64, param85 Float64, param86 Float64, param87 Float64, param88 Float64, param89 Float64, param90 Float64, param91 Float64, param92 Float64, param93 Float64, param94 Float64, param95 Float64, param96 Float64, param97 Float64, param98 Float64, param99 Float64, param100 Float64, param101 Float64, param102 Float64, param103 Float64, param104 Float64, param105 Float64, param106 Float64, param107 Float64, param108 Float64, param109 Float64, param110 Float64, param111 Float64, param112 Float64, param113 Float64, param114 Float64, param115 Float64, param116 Float64, param117 Float64, param118 Float64, param119 Float64, param120 Float64, param121 Float64, param122 Float64, param123 Float64, param124 Float64, param125 Float64, param126 Float64, param127 Float64, param128 Float64, param129 Float64, param130 Float64, param131 Float64, param132 Float64, param133 Float64, param134 Float64, param135 Float64, param136 Float64, param137 Float64, param138 Float64, param139 Float64, param140 Float64, param141 Float64, param142 Float64, param143 Float64, param144 Float64, param145 Float64, param146 Float64, param147 Float64, param148 Float64, param149 Float64, param150 Float64, param151 Float64, param152 Float64, param153 Float64, param154 Float64, param155 Float64, param156 Float64, param157 Float64, param158 Float64, param159 Float64, param160 Float64, param161 Float64, param162 Float64, param163 Float64, param164 Float64, param165 Float64, param166 Float64, param167 Float64, param168 Float64, param169 Float64, param170 Float64, param171 Float64, param172 Float64, param173 Float64, param174 Float64, param175 Float64, param176 Float64, param177 Float64, param178 Float64, param179 Float64, param180 Float64, param181 Float64, param182 Float64, param183 Float64, target Float64 --- ) ENGINE = Memory; --- DROP TABLE IF EXISTS test.testset; --- CREATE TABLE IF NOT EXISTS test.testset --- ( --- param1 Float64, param2 Float64, param3 Float64, param4 Float64, param5 Float64, param6 Float64, param7 Float64, param8 Float64, param9 Float64, param10 Float64, param11 Float64, param12 Float64, param13 Float64, param14 Float64, param15 Float64, param16 Float64, param17 Float64, param18 Float64, param19 Float64, param20 Float64, param21 Float64, param22 Float64, param23 Float64, param24 Float64, param25 Float64, param26 Float64, param27 Float64, param28 Float64, param29 Float64, param30 Float64, param31 Float64, param32 Float64, param33 Float64, param34 Float64, param35 Float64, param36 Float64, param37 Float64, param38 Float64, param39 Float64, param40 Float64, param41 Float64, param42 Float64, param43 Float64, param44 Float64, param45 Float64, param46 Float64, param47 Float64, param48 Float64, param49 Float64, param50 Float64, param51 Float64, param52 Float64, param53 Float64, param54 Float64, param55 Float64, param56 Float64, param57 Float64, param58 Float64, param59 Float64, param60 Float64, param61 Float64, param62 Float64, param63 Float64, param64 Float64, param65 Float64, param66 Float64, param67 Float64, param68 Float64, param69 Float64, param70 Float64, param71 Float64, param72 Float64, param73 Float64, param74 Float64, param75 Float64, param76 Float64, param77 Float64, param78 Float64, param79 Float64, param80 Float64, param81 Float64, param82 Float64, param83 Float64, param84 Float64, param85 Float64, param86 Float64, param87 Float64, param88 Float64, param89 Float64, param90 Float64, param91 Float64, param92 Float64, param93 Float64, param94 Float64, param95 Float64, param96 Float64, param97 Float64, param98 Float64, param99 Float64, param100 Float64, param101 Float64, param102 Float64, param103 Float64, param104 Float64, param105 Float64, param106 Float64, param107 Float64, param108 Float64, param109 Float64, param110 Float64, param111 Float64, param112 Float64, param113 Float64, param114 Float64, param115 Float64, param116 Float64, param117 Float64, param118 Float64, param119 Float64, param120 Float64, param121 Float64, param122 Float64, param123 Float64, param124 Float64, param125 Float64, param126 Float64, param127 Float64, param128 Float64, param129 Float64, param130 Float64, param131 Float64, param132 Float64, param133 Float64, param134 Float64, param135 Float64, param136 Float64, param137 Float64, param138 Float64, param139 Float64, param140 Float64, param141 Float64, param142 Float64, param143 Float64, param144 Float64, param145 Float64, param146 Float64, param147 Float64, param148 Float64, param149 Float64, param150 Float64, param151 Float64, param152 Float64, param153 Float64, param154 Float64, param155 Float64, param156 Float64, param157 Float64, param158 Float64, param159 Float64, param160 Float64, param161 Float64, param162 Float64, param163 Float64, param164 Float64, param165 Float64, param166 Float64, param167 Float64, param168 Float64, param169 Float64, param170 Float64, param171 Float64, param172 Float64, param173 Float64, param174 Float64, param175 Float64, param176 Float64, param177 Float64, param178 Float64, param179 Float64, param180 Float64, param181 Float64, param182 Float64, param183 Float64 --- ) ENGINE = Memory; - -SET send_logs_level = 'trace'; --- SET log_queries = 1; --- SET max_threads = 4; - --- drop table if exists test.model; --- create table if not exists test.model engine = Memory as select LinearRegressionState(0.0000001, 4, 2.0)(target, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, param21, param22, param23, param24, param25, param26, param27, param28, param29, param30, param31, param32, param33, param34, param35, param36, param37, param38, param39, param40, param41, param42, param43, param44, param45, param46, param47, param48, param49, param50, param51, param52, param53, param54, param55, param56, param57, param58, param59, param60, param61, param62, param63, param64, param65, param66, param67, param68, param69, param70, param71, param72, param73, param74, param75, param76, param77, param78, param79, param80, param81, param82, param83, param84, param85, param86, param87, param88, param89, param90, param91, param92, param93, param94, param95, param96, param97, param98, param99, param100, param101, param102, param103, param104, param105, param106, param107, param108, param109, param110, param111, param112, param113, param114, param115, param116, param117, param118, param119, param120, param121, param122, param123, param124, param125, param126, param127, param128, param129, param130, param131, param132, param133, param134, param135, param136, param137, param138, param139, param140, param141, param142, param143, param144, param145, param146, param147, param148, param149, param150, param151, param152, param153, param154, param155, param156, param157, param158, param159, param160, param161, param162, param163, param164, param165, param166, param167, param168, param169, param170, param171, param172, param173, param174, param175, param176, param177, param178, param179, param180, param181, param182, param183) as state from test.trainset; - -select LinearRegressionState(0.0000001, 4, 2.0)(target, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, param21, param22, param23, param24, param25, param26, param27, param28, param29, param30, param31, param32, param33, param34, param35, param36, param37, param38, param39, param40, param41, param42, param43, param44, param45, param46, param47, param48, param49, param50, param51, param52, param53, param54, param55, param56, param57, param58, param59, param60, param61, param62, param63, param64, param65, param66, param67, param68, param69, param70, param71, param72, param73, param74, param75, param76, param77, param78, param79, param80, param81, param82, param83, param84, param85, param86, param87, param88, param89, param90, param91, param92, param93, param94, param95, param96, param97, param98, param99, param100, param101, param102, param103, param104, param105, param106, param107, param108, param109, param110, param111, param112, param113, param114, param115, param116, param117, param118, param119, param120, param121, param122, param123, param124, param125, param126, param127, param128, param129, param130, param131, param132, param133, param134, param135, param136, param137, param138, param139, param140, param141, param142, param143, param144, param145, param146, param147, param148, param149, param150, param151, param152, param153, param154, param155, param156, param157, param158, param159, param160, param161, param162, param163, param164, param165, param166, param167, param168, param169, param170, param171, param172, param173, param174, param175, param176, param177, param178, param179, param180, param181, param182, param183) from test.trainset; - --- with (select state from test.model) as model select evalMLMethod(model, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15, param16, param17, param18, param19, param20, param21, param22, param23, param24, param25, param26, param27, param28, param29, param30, param31, param32, param33, param34, param35, param36, param37, param38, param39, param40, param41, param42, param43, param44, param45, param46, param47, param48, param49, param50, param51, param52, param53, param54, param55, param56, param57, param58, param59, param60, param61, param62, param63, param64, param65, param66, param67, param68, param69, param70, param71, param72, param73, param74, param75, param76, param77, param78, param79, param80, param81, param82, param83, param84, param85, param86, param87, param88, param89, param90, param91, param92, param93, param94, param95, param96, param97, param98, param99, param100, param101, param102, param103, param104, param105, param106, param107, param108, param109, param110, param111, param112, param113, param114, param115, param116, param117, param118, param119, param120, param121, param122, param123, param124, param125, param126, param127, param128, param129, param130, param131, param132, param133, param134, param135, param136, param137, param138, param139, param140, param141, param142, param143, param144, param145, param146, param147, param148, param149, param150, param151, param152, param153, param154, param155, param156, param157, param158, param159, param160, param161, param162, param163, param164, param165, param166, param167, param168, param169, param170, param171, param172, param173, param174, param175, param176, param177, param178, param179, param180, param181, param182, param183) from test.testset; \ No newline at end of file From c93aae67416133f135b1f7b136ba5fb05da8de03 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Tue, 9 Apr 2019 01:40:37 +0300 Subject: [PATCH 041/194] linear regression --- .../AggregateFunctionMLMethod.h | 8 +- .../AggregateFunctions/IAggregateFunction.h | 2 +- dbms/src/Columns/ColumnAggregateFunction.cpp | 17 +- dbms/src/Functions/evalMLMethod.cpp | 129 +++--- ...test.reference => 00935_ml_test.reference} | 0 .../{00950_ml_test.sql => 00935_ml_test.sql} | 0 ...test.reference => 00936_ml_test.reference} | 0 .../{00951_ml_test.sql => 00936_ml_test.sql} | 0 ...test.reference => 00937_ml_test.reference} | 0 .../{00952_ml_test.sql => 00937_ml_test.sql} | 0 ...reference => 00938_dataset_test.reference} | 0 ...ataset_test.sql => 00938_dataset_test.sql} | 0 ...test.reference => 00939_ml_test.reference} | 0 .../{00954_ml_test.sql => 00939_ml_test.sql} | 0 .../0_stateless/00952_ml_test.good_reference | 370 ------------------ .../0_stateless/00952_ml_test.norm_reference | 1 - 16 files changed, 62 insertions(+), 465 deletions(-) rename dbms/tests/queries/0_stateless/{00950_ml_test.reference => 00935_ml_test.reference} (100%) rename dbms/tests/queries/0_stateless/{00950_ml_test.sql => 00935_ml_test.sql} (100%) rename dbms/tests/queries/0_stateless/{00951_ml_test.reference => 00936_ml_test.reference} (100%) rename dbms/tests/queries/0_stateless/{00951_ml_test.sql => 00936_ml_test.sql} (100%) rename dbms/tests/queries/0_stateless/{00952_ml_test.reference => 00937_ml_test.reference} (100%) rename dbms/tests/queries/0_stateless/{00952_ml_test.sql => 00937_ml_test.sql} (100%) rename dbms/tests/queries/0_stateless/{00953_dataset_test.reference => 00938_dataset_test.reference} (100%) rename dbms/tests/queries/0_stateless/{00953_dataset_test.sql => 00938_dataset_test.sql} (100%) rename dbms/tests/queries/0_stateless/{00954_ml_test.reference => 00939_ml_test.reference} (100%) rename dbms/tests/queries/0_stateless/{00954_ml_test.sql => 00939_ml_test.sql} (100%) delete mode 100644 dbms/tests/queries/0_stateless/00952_ml_test.good_reference delete mode 100644 dbms/tests/queries/0_stateless/00952_ml_test.norm_reference diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index f17572a5928..dd3c2c35f23 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -459,10 +459,10 @@ private: template < - /// Implemented Machine Learning method - typename Data, - /// Name of the method - typename Name + /// Implemented Machine Learning method + typename Data, + /// Name of the method + typename Name > class AggregateFunctionMLMethod final : public IAggregateFunctionDataHelper> { diff --git a/dbms/src/AggregateFunctions/IAggregateFunction.h b/dbms/src/AggregateFunctions/IAggregateFunction.h index 2c784c6ab74..694a5955310 100644 --- a/dbms/src/AggregateFunctions/IAggregateFunction.h +++ b/dbms/src/AggregateFunctions/IAggregateFunction.h @@ -152,7 +152,7 @@ public: IAggregateFunctionDataHelper(const DataTypes & argument_types_, const Array & parameters_) : IAggregateFunctionHelper(argument_types_, parameters_) {} - virtual void create(AggregateDataPtr place) const override + void create(AggregateDataPtr place) const override { new (place) Data; } diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 6a33a98f7ef..8deaee1991e 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -84,16 +84,11 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const * AggregateFunction(quantileTiming(0.5), UInt64) * into UInt16 - already finished result of `quantileTiming`. */ -// if (const AggregateFunctionState * function_state = typeid_cast(func.get())) -// { -// auto res = createView(); -// res->set(function_state->getNestedFunction()); -// res->data.assign(data.begin(), data.end()); -// return res; -// } -// -// MutableColumnPtr res = func->getReturnType()->createColumn(); -// res->reserve(data.size()); + + /** Convertion function is used in convertToValues and predictValues + * in the similar part of both functions + */ + MutableColumnPtr res; if (convertion(&res)) { @@ -114,8 +109,6 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col return res; } - /// На моих тестах дважды в эту функцию приходит нечтно, имеющее data.size() == 0 однако оно по сути ничего не делает в следующих строках - auto ML_function_Linear = typeid_cast *>(func.get()); auto ML_function_Logistic = typeid_cast *>(func.get()); if (ML_function_Linear) diff --git a/dbms/src/Functions/evalMLMethod.cpp b/dbms/src/Functions/evalMLMethod.cpp index 2585c2ae1c9..cacc72d88e2 100644 --- a/dbms/src/Functions/evalMLMethod.cpp +++ b/dbms/src/Functions/evalMLMethod.cpp @@ -25,84 +25,59 @@ namespace DB /** finalizeAggregation(agg_state) - get the result from the aggregation state. * Takes state of aggregate function. Returns result of aggregation (finalized state). */ - class FunctionEvalMLMethod : public IFunction +class FunctionEvalMLMethod : public IFunction +{ +public: + static constexpr auto name = "evalMLMethod"; + static FunctionPtr create(const Context &) { - public: - static constexpr auto name = "evalMLMethod"; - static FunctionPtr create(const Context &) - { - return std::make_shared(); - } - - String getName() const override - { - return name; - } - - bool isVariadic() const override { - return true; - } - size_t getNumberOfArguments() const override - { - return 0; - } - - DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override - { - const DataTypeAggregateFunction * type = checkAndGetDataType(arguments[0].get()); - if (!type) - throw Exception("Argument for function " + getName() + " must have type AggregateFunction - state of aggregate function.", - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); - - return type->getReturnType(); - } - - void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override - { -// const ColumnAggregateFunction * column_with_states = -// typeid_cast(static_cast(&*block.getByPosition(arguments.at(0)).column)); - - - // завести МЛ_аггр_функции как отдельный класс, чтобы тут сразу это проверять, а не делать это внутри predictValues() - -// const ColumnAggregateFunction * column_with_states -// = typeid_cast(&*block.getByPosition(arguments.at(0)).column); - - - const ColumnConst * column_with_states - = typeid_cast(&*block.getByPosition(arguments.at(0)).column); - - - if (!column_with_states) - throw Exception("Illegal column " + block.getByPosition(arguments.at(0)).column->getName() - + " of first argument of function " - + getName(), - ErrorCodes::ILLEGAL_COLUMN); - -// const ColumnArray * col_array = checkAndGetColumnConstData(block.getByPosition(arguments[1]).column.get()); -// if (!col_array) -// throw std::runtime_error("wtf"); - -// const IColumn & array_elements = col_array->getData(); - -/* - std::vector predict_features(arguments.size()); - for (size_t i = 1; i < arguments.size(); ++i) - { -// predict_features[i] = array_elements[i].get(); - predict_features[i - 1] = typeid_cast(block.getByPosition(arguments[i]).column.get())->getValue(); - } - block.getByPosition(result).column = column_with_states->predictValues(predict_features); -*/ - block.getByPosition(result).column = - typeid_cast(&*column_with_states->getDataColumnPtr())->predictValues(block, arguments); - } - - }; - - void registerFunctionEvalMLMethod(FunctionFactory & factory) - { - factory.registerFunction(); + return std::make_shared(); } + String getName() const override + { + return name; + } + + bool isVariadic() const override { + return true; + } + size_t getNumberOfArguments() const override + { + return 0; + } + + DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override + { + const DataTypeAggregateFunction * type = checkAndGetDataType(arguments[0].get()); + if (!type) + throw Exception("Argument for function " + getName() + " must have type AggregateFunction - state of aggregate function.", + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + + return type->getReturnType(); + } + + void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override + { + const ColumnConst * column_with_states + = typeid_cast(&*block.getByPosition(arguments.at(0)).column); + + + if (!column_with_states) + throw Exception("Illegal column " + block.getByPosition(arguments.at(0)).column->getName() + + " of first argument of function " + + getName(), + ErrorCodes::ILLEGAL_COLUMN); + + block.getByPosition(result).column = + typeid_cast(&*column_with_states->getDataColumnPtr())->predictValues(block, arguments); + } + +}; + +void registerFunctionEvalMLMethod(FunctionFactory & factory) +{ + factory.registerFunction(); +} + } \ No newline at end of file diff --git a/dbms/tests/queries/0_stateless/00950_ml_test.reference b/dbms/tests/queries/0_stateless/00935_ml_test.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00950_ml_test.reference rename to dbms/tests/queries/0_stateless/00935_ml_test.reference diff --git a/dbms/tests/queries/0_stateless/00950_ml_test.sql b/dbms/tests/queries/0_stateless/00935_ml_test.sql similarity index 100% rename from dbms/tests/queries/0_stateless/00950_ml_test.sql rename to dbms/tests/queries/0_stateless/00935_ml_test.sql diff --git a/dbms/tests/queries/0_stateless/00951_ml_test.reference b/dbms/tests/queries/0_stateless/00936_ml_test.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00951_ml_test.reference rename to dbms/tests/queries/0_stateless/00936_ml_test.reference diff --git a/dbms/tests/queries/0_stateless/00951_ml_test.sql b/dbms/tests/queries/0_stateless/00936_ml_test.sql similarity index 100% rename from dbms/tests/queries/0_stateless/00951_ml_test.sql rename to dbms/tests/queries/0_stateless/00936_ml_test.sql diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.reference b/dbms/tests/queries/0_stateless/00937_ml_test.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00952_ml_test.reference rename to dbms/tests/queries/0_stateless/00937_ml_test.reference diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.sql b/dbms/tests/queries/0_stateless/00937_ml_test.sql similarity index 100% rename from dbms/tests/queries/0_stateless/00952_ml_test.sql rename to dbms/tests/queries/0_stateless/00937_ml_test.sql diff --git a/dbms/tests/queries/0_stateless/00953_dataset_test.reference b/dbms/tests/queries/0_stateless/00938_dataset_test.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00953_dataset_test.reference rename to dbms/tests/queries/0_stateless/00938_dataset_test.reference diff --git a/dbms/tests/queries/0_stateless/00953_dataset_test.sql b/dbms/tests/queries/0_stateless/00938_dataset_test.sql similarity index 100% rename from dbms/tests/queries/0_stateless/00953_dataset_test.sql rename to dbms/tests/queries/0_stateless/00938_dataset_test.sql diff --git a/dbms/tests/queries/0_stateless/00954_ml_test.reference b/dbms/tests/queries/0_stateless/00939_ml_test.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00954_ml_test.reference rename to dbms/tests/queries/0_stateless/00939_ml_test.reference diff --git a/dbms/tests/queries/0_stateless/00954_ml_test.sql b/dbms/tests/queries/0_stateless/00939_ml_test.sql similarity index 100% rename from dbms/tests/queries/0_stateless/00954_ml_test.sql rename to dbms/tests/queries/0_stateless/00939_ml_test.sql diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.good_reference b/dbms/tests/queries/0_stateless/00952_ml_test.good_reference deleted file mode 100644 index 5ad7a9176a4..00000000000 --- a/dbms/tests/queries/0_stateless/00952_ml_test.good_reference +++ /dev/null @@ -1,370 +0,0 @@ -0.72 -0.72 -0.72 -0.72 -0.72 -0.72 -0.72 -0.72 -0.72 -0.72 -0.72 -0.72 -0.72 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.79 -0.79 -0.79 -0.79 -0.79 -0.79 -0.79 -0.79 -0.79 -0.79 -0.79 -0.79 -0.79 -0.39 -0.39 -0.39 -0.39 -0.39 -0.39 -0.39 -0.39 -0.39 -0.39 -0.39 -0.39 -0.38 -0.38 -0.38 -0.38 -0.38 -0.38 -0.38 -0.38 -0.38 -0.38 -0.38 -0.38 -0.34 -0.34 -0.34 -0.34 -0.34 -0.34 -0.34 -0.34 -0.34 -0.34 -0.34 -0.34 -0.34 -0.47 -0.47 -0.47 -0.47 -0.47 -0.47 -0.47 -0.47 -0.47 -0.47 -0.47 -0.47 -0.56 -0.56 -0.56 -0.56 -0.56 -0.56 -0.56 -0.56 -0.56 -0.56 -0.56 -0.56 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.78 -0.78 -0.78 -0.78 -0.78 -0.78 -0.78 -0.78 -0.78 -0.78 -0.78 -0.78 -0.73 -0.73 -0.73 -0.73 -0.73 -0.73 -0.73 -0.73 -0.73 -0.73 -0.73 -0.73 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.62 -0.62 -0.62 -0.62 -0.62 -0.62 -0.62 -0.62 -0.62 -0.62 -0.62 -0.62 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.96 -0.46 -0.46 -0.46 -0.46 -0.46 -0.46 -0.46 -0.46 -0.46 -0.46 -0.46 -0.46 -0.53 -0.53 -0.53 -0.53 -0.53 -0.53 -0.53 -0.53 -0.53 -0.53 -0.53 -0.53 -0.49 -0.49 -0.49 -0.49 -0.49 -0.49 -0.49 -0.49 -0.49 -0.49 -0.49 -0.49 -0.49 -0.76 -0.76 -0.76 -0.76 -0.76 -0.76 -0.76 -0.76 -0.76 -0.76 -0.76 -0.76 -0.64 -0.64 -0.64 -0.64 -0.64 -0.64 -0.64 -0.64 -0.64 -0.64 -0.64 -0.64 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.71 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.77 -0.77 -0.77 -0.77 -0.77 -0.77 -0.77 -0.77 -0.77 -0.77 -0.77 -0.77 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.89 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.82 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.84 -0.91 -0.91 -0.91 -0.91 -0.91 -0.91 -0.91 -0.91 -0.91 -0.91 -0.91 -0.91 -0.91 -0.67 -0.67 -0.67 -0.67 -0.67 -0.67 -0.67 -0.67 -0.67 -0.67 -0.67 -0.67 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 -0.95 diff --git a/dbms/tests/queries/0_stateless/00952_ml_test.norm_reference b/dbms/tests/queries/0_stateless/00952_ml_test.norm_reference deleted file mode 100644 index dea24ee3047..00000000000 --- a/dbms/tests/queries/0_stateless/00952_ml_test.norm_reference +++ /dev/null @@ -1 +0,0 @@ -0.00676015 From 12132b8fdf8dafc745259baf52d44a4397349903 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Mon, 15 Apr 2019 02:57:14 +0300 Subject: [PATCH 042/194] fix in evalMLMethod --- dbms/src/Functions/evalMLMethod.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dbms/src/Functions/evalMLMethod.cpp b/dbms/src/Functions/evalMLMethod.cpp index cacc72d88e2..37e872bf00b 100644 --- a/dbms/src/Functions/evalMLMethod.cpp +++ b/dbms/src/Functions/evalMLMethod.cpp @@ -49,6 +49,9 @@ public: DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override { + if (!arguments.size()) + throw Exception("Function " + getName() + " requires at least one argument", ErrorCodes::BAD_ARGUMENTS); + const DataTypeAggregateFunction * type = checkAndGetDataType(arguments[0].get()); if (!type) throw Exception("Argument for function " + getName() + " must have type AggregateFunction - state of aggregate function.", @@ -59,12 +62,15 @@ public: void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override { + if (!arguments.size()) + throw Exception("Function " + getName() + " requires at least one argument", ErrorCodes::BAD_ARGUMENTS); + const ColumnConst * column_with_states - = typeid_cast(&*block.getByPosition(arguments.at(0)).column); + = typeid_cast(&*block.getByPosition(arguments[0]).column); if (!column_with_states) - throw Exception("Illegal column " + block.getByPosition(arguments.at(0)).column->getName() + throw Exception("Illegal column " + block.getByPosition(arguments[0]).column->getName() + " of first argument of function " + getName(), ErrorCodes::ILLEGAL_COLUMN); @@ -80,4 +86,4 @@ void registerFunctionEvalMLMethod(FunctionFactory & factory) factory.registerFunction(); } -} \ No newline at end of file +} From 19021e76bb7406dbf17ed9cd021706817d93c2fa Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Mon, 15 Apr 2019 03:16:13 +0300 Subject: [PATCH 043/194] style --- .../AggregateFunctionMLMethod.cpp | 23 +++++++++++-------- .../AggregateFunctionMLMethod.h | 4 ++-- dbms/src/Columns/ColumnAggregateFunction.cpp | 6 +++-- dbms/src/Functions/evalMLMethod.cpp | 3 ++- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 7a4d5d731d2..d217511b2bc 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -25,9 +25,7 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( for (size_t i = 0; i < argument_types.size(); ++i) { if (!WhichDataType(argument_types[i]).isFloat64()) - throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " - + std::to_string(i) + "for aggregate function " + name, - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); + throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " + std::to_string(i) + "for aggregate function " + name, ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } Float64 learning_rate = Float64(0.01); @@ -55,17 +53,22 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{1.0}) { wu = std::make_shared(); - } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{2.0}) + } + else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{2.0}) { wu = std::make_shared(); - } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{3.0}) + } + else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{3.0}) { wu = std::make_shared(); - } else { + } + else + { throw Exception("Invalid parameter for weights updater", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } - } else + } + else { wu = std::make_unique(); } @@ -73,10 +76,12 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( if (std::is_same::value) { gc = std::make_shared(); - } else if (std::is_same::value) + } + else if (std::is_same::value) { gc = std::make_shared(); - } else + } + else { throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index dd3c2c35f23..5b6cb5b02db 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -483,8 +483,8 @@ public: l2_reg_coef(l2_reg_coef), batch_size(batch_size), gc(std::move(gradient_computer)), - wu(std::move(weights_updater)) { - } + wu(std::move(weights_updater)) + {} DataTypePtr getReturnType() const override { diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 8deaee1991e..8f92ccbd96a 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -120,7 +120,8 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col ++row_num; } - } else if (ML_function_Logistic) + } + else if (ML_function_Logistic) { size_t row_num = 0; for (auto val : data) @@ -128,7 +129,8 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col ML_function_Logistic->predictResultInto(val, *res, block, arguments); ++row_num; } - } else + } + else { throw Exception("Illegal aggregate function is passed", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); diff --git a/dbms/src/Functions/evalMLMethod.cpp b/dbms/src/Functions/evalMLMethod.cpp index 37e872bf00b..ffdad6cf26e 100644 --- a/dbms/src/Functions/evalMLMethod.cpp +++ b/dbms/src/Functions/evalMLMethod.cpp @@ -39,7 +39,8 @@ public: return name; } - bool isVariadic() const override { + bool isVariadic() const override + { return true; } size_t getNumberOfArguments() const override From 9ed740e3ea819df2cec8912c91256dd0aa620953 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Mon, 15 Apr 2019 04:10:39 +0300 Subject: [PATCH 044/194] style --- dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 5b6cb5b02db..d6b0bd25981 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -123,7 +123,7 @@ public: derivative *= target; derivative = exp(derivative); - (*batch_gradient)[weights.size()] += learning_rate * target / (derivative + 1);; + (*batch_gradient)[weights.size()] += learning_rate * target / (derivative + 1); for (size_t i = 0; i < weights.size(); ++i) { (*batch_gradient)[i] += From a2a9d4b513ff8ccc2d9c6507262e39ba000f1d57 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Mon, 15 Apr 2019 10:59:56 +0300 Subject: [PATCH 045/194] style --- .../AggregateFunctionMLMethod.h | 4 +- .../queries/0_stateless/00901_mytest.sql | 46 ------------------- 2 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 dbms/tests/queries/0_stateless/00901_mytest.sql diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index d6b0bd25981..a7d2837abfa 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -475,9 +475,9 @@ public: Float64 learning_rate, Float64 l2_reg_coef, UInt32 batch_size, - const DataTypes & argument_types, + const DataTypes & arguments_types, const Array & params) - : IAggregateFunctionDataHelper>(argument_types, params), + : IAggregateFunctionDataHelper>(arguments_types, params), param_num(param_num), learning_rate(learning_rate), l2_reg_coef(l2_reg_coef), diff --git a/dbms/tests/queries/0_stateless/00901_mytest.sql b/dbms/tests/queries/0_stateless/00901_mytest.sql deleted file mode 100644 index f6bf6a5978f..00000000000 --- a/dbms/tests/queries/0_stateless/00901_mytest.sql +++ /dev/null @@ -1,46 +0,0 @@ -CREATE DATABASE IF NOT EXISTS test; -DROP TABLE IF EXISTS test.defaults; -CREATE TABLE IF NOT EXISTS test.defaults -( - param1 Float64, - param2 Float64, - target Float64, - predict1 Float64, - predict2 Float64 -) ENGINE = Memory; --- -- insert into test.defaults values (2.533, 0.543, 3.181), (1.999, 1.765, 0.470), (0.631, 2.580, -1.845), (-1.164, 0.889, 0.640), (2.110, 0.768, 2.519), (1.251, 0.483, 2.659), (-3.958, 1.299, -1.576), (-2.152, -1.316, 4.556), (3.269, 1.441, 1.753), (4.206, -1.635, 8.373), (-3.479, -0.544, 2.349), (4.006, 0.167, 4.670), (-4.478, 2.400, -4.039), (1.856, 0.256, 3.417), (1.470, 1.685, 0.366), (-4.052, 2.326, -3.678), (-0.971, -0.969, 4.453), (0.881, -1.848, 7.137), (-1.551, -1.766, 5.756), (-0.988, -0.945, 4.395), (-4.636, 1.074, -1.466), (-4.074, -1.486, 3.934), (0.754, 2.627, -1.877), (1.035, 0.889, 1.738), (3.707, -1.281, 7.415), (-2.215, 1.110, -0.327), (-2.965, -1.316, 4.150), (-3.581, 1.063, -0.917), (0.548, 0.343, 2.588), (3.023, -0.870, 6.251), (4.053, -1.441, 7.909), (-0.750, 0.639, 1.348), (-4.411, 1.636, -2.477), (1.786, 0.398, 3.096), (-2.514, 0.033, 1.676), (4.935, -0.840, 7.148), (1.075, -0.921, 5.380), (-3.418, 2.177, -3.063), (3.122, 1.883, 0.795), (-2.254, -1.389, 4.650), (-4.603, 2.909, -5.119), (-1.886, -1.220, 4.497), (-0.509, -1.498, 5.741), (2.192, 1.882, 0.332), (4.056, -1.108, 7.244), (-1.918, 0.230, 1.581), (4.867, 1.516, 2.401), (-0.993, -0.011, 2.526), (-0.757, -1.192, 5.006), (-4.161, 2.059, -3.198), (2.258, 1.157, 1.814), (-3.878, -0.052, 1.165), (1.915, 2.998, -2.038), (-2.164, 2.379, -2.841), (-0.114, -1.914, 6.772), (3.812, 2.138, 0.630), (-1.863, 1.508, -0.947), (-2.964, 0.398, 0.722), (-2.046, -0.193, 2.363), (-1.525, -0.836, 3.910), (-4.557, -0.582, 1.886), (1.031, -0.461, 4.437), (-0.802, 0.699, 1.201), (3.982, 2.084, 0.824), (-2.243, 2.726, -3.573), (-3.989, -0.803, 2.611), (4.900, 0.253, 4.944), (-1.208, -1.587, 5.571), (0.370, 2.579, -1.972), (2.824, 0.964, 2.484), (-1.290, -0.128, 2.611), (0.190, 2.058, -1.021), (4.058, 2.122, 0.784), (4.879, 0.945, 3.549), (1.119, 1.992, -0.424), (4.050, 2.005, 1.015), (-0.064, 1.485, -0.002), (-2.496, 0.456, 0.840), (-1.835, 1.586, -1.090), (0.603, 1.856, -0.411), (-3.062, -0.966, 3.401), (-3.351, 0.430, 0.465), (-2.724, -1.331, 4.299), (3.291, -1.027, 6.699), (-4.263, 0.785, -0.701), (-3.289, -0.886, 3.128), (4.627, 1.331, 2.651), (-0.618, 0.602, 1.486), (0.056, 1.778, -0.528), (4.823, 1.154, 3.103), (-3.983, 0.509, -0.010), (-4.474, -1.400, 3.563), (-3.782, 2.996, -4.883), (4.515, -0.656, 6.569), (1.269, 2.592, -1.549), (-1.710, -0.241, 2.627), (2.171, 1.453, 1.180), (-1.931, -1.845, 5.726), (1.767, -1.798, 7.480), (4.352, 2.369, 0.438), (-4.498, 2.611, -4.472), (0.067, 0.517, 2.000), (4.151, 0.624, 3.827), (0.409, -0.969, 5.142), (0.193, -1.713, 6.522), (-2.487, 2.827, -3.898), (-4.363, 2.011, -3.203), (-2.383, 2.554, -3.299), (-4.457, -0.958, 2.687), (3.342, -0.360, 5.392), (0.902, 2.978, -2.505), (4.073, -1.524, 8.084), (3.036, 1.672, 1.173), (2.169, -0.564, 5.213), (-4.780, 0.962, -1.313), (-1.815, 2.096, -2.100), (-1.445, 0.458, 1.362), (1.891, -1.437, 6.820), (1.942, -1.761, 7.493), (-4.613, -1.551, 3.795), (-3.472, -1.110, 3.485), (-2.026, 1.961, -1.935), (0.091, -0.961, 4.967), (3.902, -1.336, 7.622), (-3.483, -0.769, 2.796), (-0.066, -1.233, 5.433), (2.597, 2.789, -1.280), (-1.657, -1.842, 5.856), (0.232, -1.420, 5.957), (-3.321, 1.609, -1.879), (2.673, 2.781, -1.226), (0.869, 0.072, 3.291), (1.444, -1.271, 6.264), (1.190, 1.460, 0.675), (3.497, 0.870, 3.008), (-2.884, -1.303, 4.163), (3.620, 0.381, 4.047), (2.594, 0.247, 3.803), (-3.902, -1.315, 3.678), (-4.753, -1.005, 2.634), (0.881, 0.675, 2.091), (0.414, 2.071, -0.935), (3.458, -0.920, 6.568), (-2.986, -0.411, 2.329), (3.076, -1.960, 8.458), (2.951, 2.988, -1.501), (2.408, 1.301, 1.603), (4.725, 0.366, 4.631), (4.924, -1.762, 8.985), (3.719, 0.970, 2.920), (-0.295, 0.257, 2.340), (-4.607, 2.548, -4.400), (0.288, 1.953, -0.761), (-3.311, 0.844, -0.344), (3.679, -0.642, 6.123), (-2.310, -0.838, 3.522), (-4.397, -0.226, 1.254), (-4.366, -0.024, 0.864), (2.405, 1.458, 1.286), (-4.296, -1.071, 2.994), (0.452, -1.901, 7.028), (-0.214, -0.467, 3.827), (2.559, 1.547, 1.185), (0.990, 1.539, 0.417), (0.478, -0.089, 3.417), (-2.734, -1.007, 3.646), (3.483, 0.247, 4.247), (3.507, 2.727, -0.701), (-4.399, 2.437, -4.073), (3.785, 0.036, 4.820), (-0.824, 2.417, -2.245), (-2.588, 0.369, 0.968), (-3.037, -1.639, 4.759), (4.531, -0.499, 6.264), (4.742, -1.161, 7.693), (-0.063, -0.595, 4.159), (0.697, 2.281, -1.212), (0.413, 0.607, 1.992), (-4.081, 0.383, 0.194), (0.712, 2.638, -1.920), (-1.620, 1.092, 0.006), (-3.425, -0.911, 3.109), (-0.124, 1.711, -0.484), (4.347, 1.387, 2.399), (-3.237, -0.900, 3.182), (-3.961, 0.358, 0.304), (4.326, -0.068, 5.298), (3.846, 1.725, 1.473), (-2.089, 0.953, 0.049), (-1.025, -1.470, 5.428), (2.061, -0.156, 4.343), (1.547, -1.827, 7.427), (2.786, 0.460, 3.473), (0.076, 0.659, 1.720), (3.597, 1.966, 0.866), (-0.933, -1.180, 4.894), (4.647, 1.190, 2.943), (-0.032, 0.544, 1.896), (4.461, -1.806, 8.843), (-0.586, 1.821, -0.934), (3.725, 1.715, 1.432), (-2.091, 2.714, -3.474), (4.494, -1.494, 8.236), (3.766, -0.209, 5.301), (-1.991, 1.776, -1.548), (-4.992, -0.742, 1.989), (-2.400, 1.828, -1.855), (-1.329, 0.143, 2.050), (1.954, 1.759, 0.459), (-4.422, 1.507, -2.224), (-2.243, -1.126, 4.131), (4.417, -1.080, 7.368), (1.737, -1.144, 6.157), (2.661, -1.084, 6.498), (-3.198, 0.443, 0.515), (4.191, -1.250, 7.596), (-2.419, -0.163, 2.116), (1.910, -1.173, 6.301), (-0.241, 1.902, -0.925), (-4.415, 2.479, -4.165), (3.307, -0.465, 5.583), (-2.382, 1.364, -0.920), (-3.154, 2.953, -4.483), (-2.562, 2.803, -3.888), (3.076, 0.195, 4.149), (-0.101, 0.896, 1.157), (-2.067, 1.120, -0.273), (-4.680, 2.756, -4.851), (-4.283, -0.607, 2.072), (4.013, -1.072, 7.150), (-4.401, -0.896, 2.591), (4.544, 2.498, 0.276), (4.075, -1.204, 7.445), (-3.463, 1.242, -1.216), (3.992, 2.782, -0.568), (-4.503, 0.239, 0.270), (-3.095, 1.161, -0.870), (0.768, -0.904, 5.192), (1.255, 2.870, -2.112), (-1.537, -0.049, 2.330), (2.851, -1.182, 6.789), (1.974, -0.922, 5.832), (4.447, 2.719, -0.214), (-3.413, 0.555, 0.184), (4.943, 2.120, 1.231), (3.645, -0.413, 5.648), (-4.776, 0.079, 0.453), (1.991, 1.565, 0.866), (2.413, 1.793, 0.620), (4.245, 2.663, -0.205), (-2.022, -1.180, 4.350), (-2.285, -1.246, 4.350), (2.276, 0.488, 3.162), (2.582, -0.037, 4.365), (-4.875, 1.468, -2.374), (-2.492, 2.730, -3.706), (2.696, -1.833, 8.013), (4.618, -1.127, 7.563), (-4.156, 0.987, -1.053), (1.873, -1.566, 7.068), (1.699, 0.794, 2.262), (-3.181, 1.640, -1.871), (-3.225, 1.526, -1.664), (-2.679, -1.811, 5.281), (3.717, 1.532, 1.794), (1.288, -0.999, 5.642), (-1.057, 0.044, 2.384), (-0.147, 1.108, 0.711), (-3.827, -1.139, 3.365), (0.872, -1.482, 6.399), (1.982, 0.286, 3.418), (-1.381, 2.374, -2.439), (-1.091, 2.010, -1.565), (-1.192, 2.751, -3.097), (1.468, -0.992, 5.718), (2.249, 0.949, 2.228), (3.064, 0.911, 2.711), (-1.576, -1.584, 5.380), (2.130, -1.489, 7.043), (4.386, -1.284, 7.761), (1.662, -1.645, 7.121), (-3.395, 1.784, -2.265), (4.618, 1.951, 1.406), (-0.299, 0.378, 2.095), (-2.911, 2.131, -2.717), (0.876, 2.869, -2.301), (-1.785, 0.961, 0.186), (-4.188, 2.442, -3.977), (-1.128, 0.127, 2.181), (1.755, -1.215, 6.307), (-2.276, 0.596, 0.669), (-4.630, 1.978, -3.272), (-0.454, 0.275, 2.224), (-1.950, -1.385, 4.794), (-0.889, 2.696, -2.837), (-4.832, -0.038, 0.661), (3.738, 0.604, 3.662), (-0.224, -0.465, 3.819); --- -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); --- -- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1),(-3.273, -1.452, 4.267, 20.0, 1) -insert into test.defaults values (1,2,1,1,2), (1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2),(1,2,1,1,2) --- insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); --- -DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LogisticRegressionState(0.1, 5, 1.0)(target, param1, param2) as state from test.defaults; --- -- select toTypeName(state) from test.model; --- -- --- -- DROP TABLE IF EXISTS test.tests; --- -- CREATE TABLE IF NOT EXISTS test.tests --- -- ( --- -- predict1 Float64, --- -- predict2 Float64, --- -- state1 AggregateFunction(LinReg(0.01), Float64, Float64, Float64) --- -- ) ENGINE = Memory; --- -- insert into test.tests select 20.0, 40.0, LinRegState(0.01)(target, param1, param2) from test.defaults; --- -- select evalLinReg(state1, predict1, predict2) from test.tests; --- --- --- --- -- DROP TABLE IF EXISTS test.prediction; --- -- CREATE TABLE IF NOT EXISTS test.prediction --- -- ( --- -- predict1 Float64, --- -- predict2 Float64 --- -- ) ENGINE = Memory; --- --- --- -- insert into test.prediction values (20.0, 40.0); --- --- -- select multiply(param1, param2) from test.defaults; --- --- -- select evalLinReg(LinRegState(0.01)(target, param1, param2), 20.0, 40.0) from test.defaults; -select evalMLMethod(state, predict1, predict2) from test.model cross join test.defaults; From b6d2c9f4d296483533ae982e4bcb3a821a14bd7a Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Sun, 21 Apr 2019 02:22:42 +0300 Subject: [PATCH 046/194] some review fixes --- .../AggregateFunctionMLMethod.cpp | 43 ++++--- .../AggregateFunctionMLMethod.h | 115 ++++++++++-------- .../AggregateFunctions/IAggregateFunction.h | 7 ++ dbms/src/Columns/ColumnAggregateFunction.cpp | 29 +++-- dbms/src/Core/Field.h | 1 + 5 files changed, 113 insertions(+), 82 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index d217511b2bc..2e863134984 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -17,23 +17,28 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( const std::string & name, const DataTypes & argument_types, const Array & parameters) { if (parameters.size() > 4) - throw Exception("Aggregate function " + name + " requires at most four parameters", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + throw Exception("Aggregate function " + name + " requires at most four parameters: learning_rate, l2_regularization_coef, mini-batch size and weights_updater method", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); if (argument_types.size() < 2) - throw Exception("Aggregate function " + name + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + throw Exception("Aggregate function " + name + " requires at least two arguments: target and model's parameters", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); for (size_t i = 0; i < argument_types.size(); ++i) { - if (!WhichDataType(argument_types[i]).isFloat64()) - throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " + std::to_string(i) + "for aggregate function " + name, ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); +// if (!WhichDataType(argument_types[i]).isFloat64()) +// throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " + std::to_string(i) + "for aggregate function " + name, ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); +// if (!WhichDataType(argument_types[i]).isNumeric()) + if (!isNumber(argument_types[i])) + throw Exception("Argument " + std::to_string(i) + " of type " + argument_types[i]->getName() + " must be numeric for aggregate function " + name, ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } - Float64 learning_rate = Float64(0.01); - Float64 l2_reg_coef = Float64(0.01); + /// Such default parameters were picked because they did good on some tests, + /// though it still requires to fit parameters to achieve better result + auto learning_rate = Float64(0.01); + auto l2_reg_coef = Float64(0.01); UInt32 batch_size = 1; - std::shared_ptr wu; - std::shared_ptr gc; + std::shared_ptr weights_updater = std::make_unique(); + std::shared_ptr gradient_computer; if (!parameters.empty()) { @@ -52,15 +57,15 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( { if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{1.0}) { - wu = std::make_shared(); + weights_updater = std::make_shared(); } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{2.0}) { - wu = std::make_shared(); + weights_updater = std::make_shared(); } else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{3.0}) { - wu = std::make_shared(); + weights_updater = std::make_shared(); } else @@ -68,18 +73,18 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( throw Exception("Invalid parameter for weights updater", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } } - else - { - wu = std::make_unique(); - } +// else +// { +// weights_updater = std::make_unique(); +// } if (std::is_same::value) { - gc = std::make_shared(); + gradient_computer = std::make_shared(); } else if (std::is_same::value) { - gc = std::make_shared(); + gradient_computer = std::make_shared(); } else { @@ -87,7 +92,9 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } - return std::make_shared(argument_types.size() - 1, gc, wu, learning_rate, l2_reg_coef, batch_size, argument_types, parameters); + return std::make_shared(argument_types.size() - 1, + gradient_computer, weights_updater, + learning_rate, l2_reg_coef, batch_size, argument_types, parameters); } } diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index a7d2837abfa..5e022ec410a 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -39,14 +39,13 @@ public: virtual ~IGradientComputer() = default; /// Adds computed gradient in new point (weights, bias) to batch_gradient - virtual void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, + virtual void compute(std::vector & batch_gradient, const std::vector &weights, Float64 bias, Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) = 0; - /// Now we should use predict_block function instead of predict - virtual void predict_block(ColumnVector::Container &container, - Block &block, const ColumnNumbers &arguments, - const std::vector &weights, - Float64 bias) const = 0; + virtual void predict(ColumnVector::Container &container, + Block &block, const ColumnNumbers &arguments, + const std::vector &weights, + Float64 bias) const = 0; }; @@ -56,48 +55,55 @@ public: LinearRegression() {} - void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, + void compute(std::vector & batch_gradient, const std::vector &weights, Float64 bias, Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) override { Float64 derivative = (target - bias); for (size_t i = 0; i < weights.size(); ++i) { - derivative -= weights[i] * static_cast &>(*columns[i]).getData()[row_num]; +// auto value = static_cast &>(*columns[i]).getData()[row_num]; + auto value = (*columns[i])[row_num].get(); +// if ((*columns[i])[row_num].getType() == Field::Types::Float64) + derivative -= weights[i] * value; +// else +// derivative -= weights[i] * (*columns[i])[row_num].get(); } derivative *= (2 * learning_rate); - (*batch_gradient)[weights.size()] += derivative; + batch_gradient[weights.size()] += derivative; for (size_t i = 0; i < weights.size(); ++i) { - (*batch_gradient)[i] += - derivative * static_cast &>(*columns[i]).getData()[row_num] - - 2 * l2_reg_coef * weights[i]; +// auto value = static_cast &>(*columns[i]).getData()[row_num]; + auto value = (*columns[i])[row_num].get(); + batch_gradient[i] += derivative * value - 2 * l2_reg_coef * weights[i]; } } - void predict_block(ColumnVector::Container &container, - Block &block, - const ColumnNumbers &arguments, - const std::vector &weights, Float64 bias) const override + void predict(ColumnVector::Container &container, + Block &block, + const ColumnNumbers &arguments, + const std::vector &weights, Float64 bias) const override { size_t rows_num = block.rows(); std::vector results(rows_num, bias); for (size_t i = 1; i < arguments.size(); ++i) { - ColumnPtr cur_col = block.getByPosition(arguments[i]).column; + ColumnPtr cur_col = block.safeGetByPosition(arguments[i]).column; for (size_t row_num = 0; row_num != rows_num; ++row_num) { const auto &element = (*cur_col)[row_num]; - if (element.getType() != Field::Types::Float64) - throw Exception("Prediction arguments must be values of type Float", +// if (element.getType() != Field::Types::Float64) + if (!DB::Field::isSimpleNumeric(element.getType())) + throw Exception("Prediction arguments must be have numeric type", ErrorCodes::BAD_ARGUMENTS); results[row_num] += weights[i - 1] * element.get(); } } + container.reserve(rows_num); for (size_t row_num = 0; row_num != rows_num; ++row_num) { container.emplace_back(results[row_num]); @@ -112,28 +118,28 @@ public: LogisticRegression() {} - void compute(std::vector * batch_gradient, const std::vector &weights, Float64 bias, + void compute(std::vector & batch_gradient, const std::vector & weights, Float64 bias, Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) override { Float64 derivative = bias; for (size_t i = 0; i < weights.size(); ++i) { - derivative += weights[i] * static_cast &>(*columns[i]).getData()[row_num]; + auto value = static_cast &>(*columns[i]).getData()[row_num]; + derivative += weights[i] * value; } derivative *= target; derivative = exp(derivative); - (*batch_gradient)[weights.size()] += learning_rate * target / (derivative + 1); + batch_gradient[weights.size()] += learning_rate * target / (derivative + 1); for (size_t i = 0; i < weights.size(); ++i) { - (*batch_gradient)[i] += - learning_rate * target * - static_cast &>(*columns[i]).getData()[row_num] / (derivative + 1) - - 2 * l2_reg_coef * weights[i]; + auto value = static_cast &>(*columns[i]).getData()[row_num]; + batch_gradient[i] += learning_rate * target * value / (derivative + 1) + - 2 * l2_reg_coef * weights[i]; } } - void predict_block(ColumnVector::Container & container, + void predict(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const std::vector & weights, Float64 bias) const override @@ -143,17 +149,19 @@ public: for (size_t i = 1; i < arguments.size(); ++i) { - ColumnPtr cur_col = block.getByPosition(arguments[i]).column; + ColumnPtr cur_col = block.safeGetByPosition(arguments[i]).column; for (size_t row_num = 0; row_num != rows_num; ++row_num) { const auto &element = (*cur_col)[row_num]; - if (element.getType() != Field::Types::Float64) - throw Exception("Prediction arguments must be values of type Float", - ErrorCodes::BAD_ARGUMENTS); +// if (element.getType() != Field::Types::Float64) + if (!DB::Field::isSimpleNumeric(element.getType())) + throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS); results[row_num] += weights[i - 1] * element.get(); } } + + container.reserve(rows_num); for (size_t row_num = 0; row_num != rows_num; ++row_num) { container.emplace_back(1 / (1 + exp(-results[row_num]))); @@ -164,30 +172,35 @@ public: /** * IWeightsUpdater class defines the way to update current weights -* and uses class GradientComputer on each iteration +* and uses GradientComputer class on each iteration */ class IWeightsUpdater { public: virtual ~IWeightsUpdater() = default; - virtual void add_to_batch(std::vector * batch_gradient, std::shared_ptr gc, + /// Calls GradientComputer to update current mini-batch + virtual void add_to_batch(std::vector & batch_gradient, IGradientComputer & gradient_computer, const std::vector & weights, Float64 bias, Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) { - gc->compute(batch_gradient, weights, bias, learning_rate, l2_reg_coef, target, columns, row_num); + gradient_computer.compute(batch_gradient, weights, bias, learning_rate, l2_reg_coef, target, columns, row_num); } + /// Updates current weights according to the gradient from the last mini-batch virtual void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & gradient) = 0; + /// Used during the merge of two states virtual void merge(const IWeightsUpdater &, Float64, Float64) {} + /// Used for serialization when necessary virtual void write(WriteBuffer &) const {} + /// Used for serialization when necessary virtual void read(ReadBuffer &) {} }; @@ -275,13 +288,13 @@ public: Nesterov(Float64 alpha) : alpha_(alpha) {} - void add_to_batch(std::vector * batch_gradient, std::shared_ptr gc, + void add_to_batch(std::vector & batch_gradient, IGradientComputer & gradient_computer, const std::vector & weights, Float64 bias, Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn ** columns, size_t row_num) override { if (accumulated_gradient.empty()) { - accumulated_gradient.resize(batch_gradient->size(), Float64{0.0}); + accumulated_gradient.resize(batch_gradient.size(), Float64{0.0}); } std::vector shifted_weights(weights.size()); @@ -291,7 +304,7 @@ public: } auto shifted_bias = bias + accumulated_gradient[weights.size()] * alpha_; - gc->compute(batch_gradient, shifted_weights, shifted_bias, learning_rate, l2_reg_coef, target, columns, row_num); + gradient_computer.compute(batch_gradient, shifted_weights, shifted_bias, learning_rate, l2_reg_coef, target, columns, row_num); } void update(UInt32 batch_size, @@ -353,14 +366,14 @@ public: Float64 l2_reg_coef, UInt32 param_num, UInt32 batch_capacity, - std::shared_ptr gc, - std::shared_ptr wu) + std::shared_ptr gradient_computer, + std::shared_ptr weights_updater) : learning_rate(learning_rate), l2_reg_coef(l2_reg_coef), batch_capacity(batch_capacity), batch_size(0), - gradient_computer(std::move(gc)), - weights_updater(std::move(wu)) + gradient_computer(std::move(gradient_computer)), + weights_updater(std::move(weights_updater)) { weights.resize(param_num, Float64{0.0}); gradient_batch.resize(param_num + 1, Float64{0.0}); @@ -372,7 +385,7 @@ public: const auto &target = static_cast &>(*columns[0]).getData()[row_num]; /// Here we have columns + 1 as first column corresponds to target value, and others - to features - weights_updater->add_to_batch(&gradient_batch, gradient_computer, + weights_updater->add_to_batch(gradient_batch, *gradient_computer, weights, bias, learning_rate, l2_reg_coef, target, columns + 1, row_num); ++batch_size; @@ -422,9 +435,9 @@ public: weights_updater->read(buf); } - void predict_block(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments) const + void predict(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments) const { - gradient_computer->predict_block(container, block, arguments, weights, bias); + gradient_computer->predict(container, block, arguments, weights, bias); } private: @@ -482,8 +495,8 @@ public: learning_rate(learning_rate), l2_reg_coef(l2_reg_coef), batch_size(batch_size), - gc(std::move(gradient_computer)), - wu(std::move(weights_updater)) + gradient_computer(std::move(gradient_computer)), + weights_updater(std::move(weights_updater)) {} DataTypePtr getReturnType() const override @@ -493,7 +506,7 @@ public: void create(AggregateDataPtr place) const override { - new (place) Data(learning_rate, l2_reg_coef, param_num, batch_size, gc, wu); + new (place) Data(learning_rate, l2_reg_coef, param_num, batch_size, gradient_computer, weights_updater); } void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override @@ -516,7 +529,7 @@ public: this->data(place).read(buf); } - void predictResultInto(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments) const + void predictValues(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments) const override { if (arguments.size() != param_num + 1) throw Exception("Predict got incorrect number of arguments. Got: " + @@ -525,7 +538,7 @@ public: auto &column = dynamic_cast &>(to); - this->data(place).predict_block(column.getData(), block, arguments); + this->data(place).predict(column.getData(), block, arguments); } void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override @@ -542,8 +555,8 @@ private: Float64 learning_rate; Float64 l2_reg_coef; UInt32 batch_size; - std::shared_ptr gc; - std::shared_ptr wu; + std::shared_ptr gradient_computer; + std::shared_ptr weights_updater; }; struct NameLinearRegression { static constexpr auto name = "LinearRegression"; }; diff --git a/dbms/src/AggregateFunctions/IAggregateFunction.h b/dbms/src/AggregateFunctions/IAggregateFunction.h index 694a5955310..5737ec21300 100644 --- a/dbms/src/AggregateFunctions/IAggregateFunction.h +++ b/dbms/src/AggregateFunctions/IAggregateFunction.h @@ -7,6 +7,8 @@ #include #include +#include +#include #include @@ -92,6 +94,11 @@ public: /// Inserts results into a column. virtual void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const = 0; + /// This function is used for machine learning methods + virtual void predictValues(ConstAggregateDataPtr /* place */, IColumn & /*to*/, + Block & /*block*/, const ColumnNumbers & /*arguments*/) const + {} + /** Returns true for aggregate functions of type -State. * They are executed as other aggregate functions, but not finalized (return an aggregation state that can be combined with another). */ diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 8f92ccbd96a..19fff914cb9 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -35,6 +35,8 @@ void ColumnAggregateFunction::addArena(ArenaPtr arena_) arenas.push_back(arena_); } +/// This function is used in convertToValues() and predictValues() +/// and is written here to avoid repetitions bool ColumnAggregateFunction::convertion(MutableColumnPtr *res_) const { if (const AggregateFunctionState *function_state = typeid_cast(func.get())) @@ -109,27 +111,28 @@ MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const Col return res; } - auto ML_function_Linear = typeid_cast *>(func.get()); - auto ML_function_Logistic = typeid_cast *>(func.get()); - if (ML_function_Linear) +// auto ML_function_Linear = typeid_cast *>(func.get()); +// auto ML_function_Logistic = typeid_cast *>(func.get()); + auto ML_function = func.get(); + if (ML_function) { size_t row_num = 0; for (auto val : data) { - ML_function_Linear->predictResultInto(val, *res, block, arguments); + ML_function->predictValues(val, *res, block, arguments); ++row_num; } } - else if (ML_function_Logistic) - { - size_t row_num = 0; - for (auto val : data) - { - ML_function_Logistic->predictResultInto(val, *res, block, arguments); - ++row_num; - } - } +// else if (ML_function_Logistic) +// { +// size_t row_num = 0; +// for (auto val : data) +// { +// ML_function_Logistic->predictValues(val, *res, block, arguments); +// ++row_num; +// } +// } else { throw Exception("Illegal aggregate function is passed", diff --git a/dbms/src/Core/Field.h b/dbms/src/Core/Field.h index 7afa1395710..9208a53a7d6 100644 --- a/dbms/src/Core/Field.h +++ b/dbms/src/Core/Field.h @@ -200,6 +200,7 @@ public: template struct TypeToEnum; template struct EnumToType; + static bool isSimpleNumeric(Types::Which which) { return which >= Types::UInt64 && which <= Types::Int128; } static bool IsDecimal(Types::Which which) { return which >= Types::Decimal32 && which <= Types::Decimal128; } Field() From daf4690d37d0a33b08ddb89f97a158b74b504205 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Sun, 21 Apr 2019 17:32:42 +0300 Subject: [PATCH 047/194] review fixes --- .../AggregateFunctionMLMethod.cpp | 18 +--- .../AggregateFunctionMLMethod.h | 93 ++++++++++--------- .../AggregateFunctions/IAggregateFunction.h | 6 +- dbms/src/Columns/ColumnAggregateFunction.cpp | 20 +--- dbms/src/Columns/ColumnAggregateFunction.h | 2 +- dbms/src/Core/Field.h | 1 - dbms/src/Functions/evalMLMethod.cpp | 13 +-- .../queries/0_stateless/00935_ml_test.sql | 2 +- .../queries/0_stateless/00936_ml_test.sql | 2 +- .../queries/0_stateless/00937_ml_test.sql | 2 +- .../0_stateless/00938_dataset_test.sql | 2 +- .../queries/0_stateless/00939_ml_test.sql | 2 +- 12 files changed, 74 insertions(+), 89 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 2e863134984..67a361d73c8 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -24,9 +24,6 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( for (size_t i = 0; i < argument_types.size(); ++i) { -// if (!WhichDataType(argument_types[i]).isFloat64()) -// throw Exception("Illegal type " + argument_types[i]->getName() + " of argument " + std::to_string(i) + "for aggregate function " + name, ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); -// if (!WhichDataType(argument_types[i]).isNumeric()) if (!isNumber(argument_types[i])) throw Exception("Argument " + std::to_string(i) + " of type " + argument_types[i]->getName() + " must be numeric for aggregate function " + name, ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } @@ -55,28 +52,20 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } if (parameters.size() > 3) { - if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{1.0}) - { + if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'SGD\'") { weights_updater = std::make_shared(); } - else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{2.0}) - { + else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Momentum\'") { weights_updater = std::make_shared(); } - else if (applyVisitor(FieldVisitorConvertToNumber(), parameters[3]) == Float64{3.0}) - { + else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Nesterov\'") { weights_updater = std::make_shared(); - } else { throw Exception("Invalid parameter for weights updater", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } } -// else -// { -// weights_updater = std::make_unique(); -// } if (std::is_same::value) { @@ -91,7 +80,6 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); } - return std::make_shared(argument_types.size() - 1, gradient_computer, weights_updater, learning_rate, l2_reg_coef, batch_size, argument_types, parameters); diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 5e022ec410a..d535a27adaa 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -45,7 +46,7 @@ public: virtual void predict(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments, const std::vector &weights, - Float64 bias) const = 0; + Float64 bias, const Context & context) const = 0; }; @@ -61,19 +62,14 @@ public: Float64 derivative = (target - bias); for (size_t i = 0; i < weights.size(); ++i) { -// auto value = static_cast &>(*columns[i]).getData()[row_num]; - auto value = (*columns[i])[row_num].get(); -// if ((*columns[i])[row_num].getType() == Field::Types::Float64) - derivative -= weights[i] * value; -// else -// derivative -= weights[i] * (*columns[i])[row_num].get(); + auto value = (*columns[i])[row_num].get(); + derivative -= weights[i] * value; } derivative *= (2 * learning_rate); batch_gradient[weights.size()] += derivative; for (size_t i = 0; i < weights.size(); ++i) { -// auto value = static_cast &>(*columns[i]).getData()[row_num]; auto value = (*columns[i])[row_num].get(); batch_gradient[i] += derivative * value - 2 * l2_reg_coef * weights[i]; } @@ -82,24 +78,30 @@ public: void predict(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments, - const std::vector &weights, Float64 bias) const override + const std::vector &weights, Float64 bias, const Context & context) const override { size_t rows_num = block.rows(); std::vector results(rows_num, bias); for (size_t i = 1; i < arguments.size(); ++i) { - ColumnPtr cur_col = block.safeGetByPosition(arguments[i]).column; + const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]); + if (!isNumber(cur_col.type)) { + throw Exception("Prediction arguments must be have numeric type", ErrorCodes::BAD_ARGUMENTS); + } + + /// If column type is already Float64 then castColumn simply returns it + auto features_col_ptr = castColumn(cur_col, std::make_shared(), context); + auto features_column = typeid_cast(features_col_ptr.get()); + + if (!features_column) + { + throw Exception("Unexpectedly cannot dynamically cast features column " + std::to_string(i), ErrorCodes::LOGICAL_ERROR); + } + for (size_t row_num = 0; row_num != rows_num; ++row_num) { - - const auto &element = (*cur_col)[row_num]; -// if (element.getType() != Field::Types::Float64) - if (!DB::Field::isSimpleNumeric(element.getType())) - throw Exception("Prediction arguments must be have numeric type", - ErrorCodes::BAD_ARGUMENTS); - - results[row_num] += weights[i - 1] * element.get(); + results[row_num] += weights[i - 1] * features_column->getElement(row_num); } } @@ -124,7 +126,7 @@ public: Float64 derivative = bias; for (size_t i = 0; i < weights.size(); ++i) { - auto value = static_cast &>(*columns[i]).getData()[row_num]; + auto value = (*columns[i])[row_num].get(); derivative += weights[i] * value; } derivative *= target; @@ -133,7 +135,7 @@ public: batch_gradient[weights.size()] += learning_rate * target / (derivative + 1); for (size_t i = 0; i < weights.size(); ++i) { - auto value = static_cast &>(*columns[i]).getData()[row_num]; + auto value = (*columns[i])[row_num].get(); batch_gradient[i] += learning_rate * target * value / (derivative + 1) - 2 * l2_reg_coef * weights[i]; } @@ -142,22 +144,30 @@ public: void predict(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, - const std::vector & weights, Float64 bias) const override + const std::vector & weights, Float64 bias, const Context & context) const override { size_t rows_num = block.rows(); std::vector results(rows_num, bias); for (size_t i = 1; i < arguments.size(); ++i) { - ColumnPtr cur_col = block.safeGetByPosition(arguments[i]).column; + const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]); + if (!isNumber(cur_col.type)) { + throw Exception("Prediction arguments must be have numeric type", ErrorCodes::BAD_ARGUMENTS); + } + + /// If column type is already Float64 then castColumn simply returns it + auto features_col_ptr = castColumn(cur_col, std::make_shared(), context); + auto features_column = typeid_cast(features_col_ptr.get()); + + if (!features_column) + { + throw Exception("Unexpectedly cannot dynamically cast features column " + std::to_string(i), ErrorCodes::LOGICAL_ERROR); + } + for (size_t row_num = 0; row_num != rows_num; ++row_num) { - const auto &element = (*cur_col)[row_num]; -// if (element.getType() != Field::Types::Float64) - if (!DB::Field::isSimpleNumeric(element.getType())) - throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS); - - results[row_num] += weights[i - 1] * element.get(); + results[row_num] += weights[i - 1] * features_column->getElement(row_num); } } @@ -382,8 +392,7 @@ public: void add(const IColumn **columns, size_t row_num) { /// first column stores target; features start from (columns + 1) - const auto &target = static_cast &>(*columns[0]).getData()[row_num]; - + const auto &target = (*columns[0])[row_num].get(); /// Here we have columns + 1 as first column corresponds to target value, and others - to features weights_updater->add_to_batch(gradient_batch, *gradient_computer, weights, bias, learning_rate, l2_reg_coef, target, columns + 1, row_num); @@ -435,9 +444,9 @@ public: weights_updater->read(buf); } - void predict(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments) const + void predict(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments, const Context & context) const { - gradient_computer->predict(container, block, arguments, weights, bias); + gradient_computer->predict(container, block, arguments, weights, bias, context); } private: @@ -490,14 +499,14 @@ public: UInt32 batch_size, const DataTypes & arguments_types, const Array & params) - : IAggregateFunctionDataHelper>(arguments_types, params), - param_num(param_num), - learning_rate(learning_rate), - l2_reg_coef(l2_reg_coef), - batch_size(batch_size), - gradient_computer(std::move(gradient_computer)), - weights_updater(std::move(weights_updater)) - {} + : IAggregateFunctionDataHelper>(arguments_types, params), + param_num(param_num), + learning_rate(learning_rate), + l2_reg_coef(l2_reg_coef), + batch_size(batch_size), + gradient_computer(std::move(gradient_computer)), + weights_updater(std::move(weights_updater)) + {} DataTypePtr getReturnType() const override { @@ -529,7 +538,7 @@ public: this->data(place).read(buf); } - void predictValues(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments) const override + void predictValues(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments, const Context & context) const override { if (arguments.size() != param_num + 1) throw Exception("Predict got incorrect number of arguments. Got: " + @@ -538,7 +547,7 @@ public: auto &column = dynamic_cast &>(to); - this->data(place).predict(column.getData(), block, arguments); + this->data(place).predict(column.getData(), block, arguments, context); } void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override diff --git a/dbms/src/AggregateFunctions/IAggregateFunction.h b/dbms/src/AggregateFunctions/IAggregateFunction.h index 5737ec21300..b4456163fee 100644 --- a/dbms/src/AggregateFunctions/IAggregateFunction.h +++ b/dbms/src/AggregateFunctions/IAggregateFunction.h @@ -96,8 +96,10 @@ public: /// This function is used for machine learning methods virtual void predictValues(ConstAggregateDataPtr /* place */, IColumn & /*to*/, - Block & /*block*/, const ColumnNumbers & /*arguments*/) const - {} + Block & /*block*/, const ColumnNumbers & /*arguments*/, const Context & /*context*/) const + { + throw Exception("Method predictValues is not supported for " + getName(), ErrorCodes::NOT_IMPLEMENTED); + } /** Returns true for aggregate functions of type -State. * They are executed as other aggregate functions, but not finalized (return an aggregation state that can be combined with another). diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp index 19fff914cb9..451b4377130 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.cpp +++ b/dbms/src/Columns/ColumnAggregateFunction.cpp @@ -103,36 +103,22 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const return res; } -MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const ColumnNumbers & arguments) const +MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const ColumnNumbers & arguments, const Context & context) const { MutableColumnPtr res; - if (convertion(&res)) - { - return res; - } + convertion(&res); -// auto ML_function_Linear = typeid_cast *>(func.get()); -// auto ML_function_Logistic = typeid_cast *>(func.get()); auto ML_function = func.get(); if (ML_function) { size_t row_num = 0; for (auto val : data) { - ML_function->predictValues(val, *res, block, arguments); + ML_function->predictValues(val, *res, block, arguments, context); ++row_num; } } -// else if (ML_function_Logistic) -// { -// size_t row_num = 0; -// for (auto val : data) -// { -// ML_function_Logistic->predictValues(val, *res, block, arguments); -// ++row_num; -// } -// } else { throw Exception("Illegal aggregate function is passed", diff --git a/dbms/src/Columns/ColumnAggregateFunction.h b/dbms/src/Columns/ColumnAggregateFunction.h index b7855cf2b37..a0bdfe4d88c 100644 --- a/dbms/src/Columns/ColumnAggregateFunction.h +++ b/dbms/src/Columns/ColumnAggregateFunction.h @@ -119,7 +119,7 @@ public: const char * getFamilyName() const override { return "AggregateFunction"; } bool convertion(MutableColumnPtr* res_) const; - MutableColumnPtr predictValues(Block & block, const ColumnNumbers & arguments) const; + MutableColumnPtr predictValues(Block & block, const ColumnNumbers & arguments, const Context & context) const; size_t size() const override { diff --git a/dbms/src/Core/Field.h b/dbms/src/Core/Field.h index 9208a53a7d6..7afa1395710 100644 --- a/dbms/src/Core/Field.h +++ b/dbms/src/Core/Field.h @@ -200,7 +200,6 @@ public: template struct TypeToEnum; template struct EnumToType; - static bool isSimpleNumeric(Types::Which which) { return which >= Types::UInt64 && which <= Types::Int128; } static bool IsDecimal(Types::Which which) { return which >= Types::Decimal32 && which <= Types::Decimal128; } Field() diff --git a/dbms/src/Functions/evalMLMethod.cpp b/dbms/src/Functions/evalMLMethod.cpp index ffdad6cf26e..a83bc717596 100644 --- a/dbms/src/Functions/evalMLMethod.cpp +++ b/dbms/src/Functions/evalMLMethod.cpp @@ -29,10 +29,12 @@ class FunctionEvalMLMethod : public IFunction { public: static constexpr auto name = "evalMLMethod"; - static FunctionPtr create(const Context &) + static FunctionPtr create(const Context & context) { - return std::make_shared(); + return std::make_shared(context); } + FunctionEvalMLMethod(const Context & context) : context(context) + {} String getName() const override { @@ -72,14 +74,13 @@ public: if (!column_with_states) throw Exception("Illegal column " + block.getByPosition(arguments[0]).column->getName() - + " of first argument of function " - + getName(), - ErrorCodes::ILLEGAL_COLUMN); + + " of first argument of function " + getName(), ErrorCodes::ILLEGAL_COLUMN); block.getByPosition(result).column = - typeid_cast(&*column_with_states->getDataColumnPtr())->predictValues(block, arguments); + typeid_cast(&*column_with_states->getDataColumnPtr())->predictValues(block, arguments, context); } + const Context & context; }; void registerFunctionEvalMLMethod(FunctionFactory & factory) diff --git a/dbms/tests/queries/0_stateless/00935_ml_test.sql b/dbms/tests/queries/0_stateless/00935_ml_test.sql index b6a02893840..ab6a033e941 100644 --- a/dbms/tests/queries/0_stateless/00935_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00935_ml_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 0.0, 2, 1.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 0.0, 2, 'SGD')(target, param1, param2) as state from test.defaults; select ans < -61.374 and ans > -61.375 from (with (select state from remote('127.0.0.1', test.model)) as model select evalMLMethod(model, predict1, predict2) as ans from remote('127.0.0.1', test.defaults)); diff --git a/dbms/tests/queries/0_stateless/00936_ml_test.sql b/dbms/tests/queries/0_stateless/00936_ml_test.sql index 9dbb7ece7fe..c03aba972e7 100644 --- a/dbms/tests/queries/0_stateless/00936_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00936_ml_test.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS test.defaults ) ENGINE = Memory; insert into test.defaults values (1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2),(1,2,1,-1,-2),(-1,-2,-1,1,2) DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LogisticRegressionState(0.1, 0.0, 1.0, 1)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LogisticRegressionState(0.1, 0.0, 1.0, 'SGD')(target, param1, param2) as state from test.defaults; select ans < 1.1 and ans > 0.9 from (with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) as ans from test.defaults limit 2); diff --git a/dbms/tests/queries/0_stateless/00937_ml_test.sql b/dbms/tests/queries/0_stateless/00937_ml_test.sql index 94dea65ed55..465be25acb5 100644 --- a/dbms/tests/queries/0_stateless/00937_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00937_ml_test.sql @@ -21,5 +21,5 @@ CREATE TABLE IF NOT EXISTS test.defaults ) ENGINE = Memory; insert into test.defaults values (1.76210664421617,1.7469706406568504,0.7988286239230257,1.0938642223599824,1.167321139201246,1.7648182796261376,0.909111664354187,0.92,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,-0.06763531281107672,0.7988286239230257,0.5966532121963541,1.167321139201246,0.4551512643242912,0.909111664354187,0.76,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.07046681268810527,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-1.0056311758200724,0.909111664354187,0.72,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,0.11933920911869125,0.909111664354187,0.8,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.24499761810756004,-0.7274920231630502,-0.952028633990455,-1.3921908284581592,-0.5042604443804907,-0.6530285178541898,-1.0999748867047898,0.65,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.1512488252480781,1.2520781078928702,1.674257252879766,1.0938642223599824,-0.5042604443804907,1.244309594057455,0.909111664354187,0.9,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,0.6101272780073337,-0.6698191206144725,0.909111664354187,0.75,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.7685900343659244,-1.057420378339037,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-1.1735372034228724,-1.0999748867047898,0.68,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-1.2921824506242887,-0.8924562007510436,-1.8274572629471952,-1.3921908284581592,-2.175842027962227,-1.0056311758200724,-1.0999748867047898,0.5,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.5403910062799865,0.09732886477691666,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.0018049897967303734,-1.0999748867047898,0.45,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.7149218116994412,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.3340070654088696,0.909111664354187,0.52,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.889452617118896,0.5922213975408968,0.7988286239230257,0.5966532121963541,1.167321139201246,0.6734291002079332,0.909111664354187,0.84,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.9767180198286235,0.7571855751288902,0.7988286239230257,0.5966532121963541,1.167321139201246,0.8413351278107333,0.909111664354187,0.78,-0.5940592289464697,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.8558554370756518,0.26229304236491,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.62,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,-1.618648166768315,-0.6698191206144725,0.909111664354187,0.61,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.24499761810756004,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.5019130930116695,-1.0999748867047898,0.54,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.016798590021622126,-0.06763531281107672,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,0.16971101739953035,-1.0999748867047898,0.66,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.1913293954410769,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.65,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.10406399273134952,0.4272572199529034,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,0.3376170450023333,-1.0999748867047898,0.63,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-1.2049170479145614,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.1661010378060696,-1.0999748867047898,0.62,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,-1.618648166768315,-1.1735372034228724,0.909111664354187,0.64,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.7149218116994412,1.087113930304877,0.7988286239230257,-0.3977688081309026,-1.618648166768315,-0.3340070654088696,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(0.9767180198286235,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.5129592382219361,0.909111664354187,0.94,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(1.5003104360869879,1.9119348182448437,1.674257252879766,1.5910752325236108,1.167321139201246,1.848771293427536,0.909111664354187,0.95,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(1.6748412415064426,1.9119348182448437,1.674257252879766,0.5966532121963541,0.052933416813421515,2.016677321030339,0.909111664354187,0.97,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,1.0428223609340956,0.909111664354187),(2.023902852345352,2.076898995832837,1.674257252879766,1.0938642223599824,1.167321139201246,1.680865265824736,0.909111664354187,0.94,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.4531256035702591,0.26229304236491,1.674257252879766,1.0938642223599824,0.052933416813421515,0.3376170450023333,-1.0999748867047898,0.76,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.6412440614631982,-1.5523129111030172,-0.952028633990455,-1.8894018386217877,-1.0614543055744028,-1.8451613138340752,0.909111664354187,0.44,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.9030402695923805,-2.377133799042984,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-2.348879396642477,-1.0999748867047898,0.46,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-0.5940592289464697,-1.3873487335150236,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-2.180973369039677,-1.0999748867047898,0.54,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.4667132560437435,-1.7172770886910105,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.8377251482172725,0.909111664354187,0.65,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.889452617118896,-0.7274920231630502,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.5019130930116695,0.909111664354187,0.74,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(1.8493720469258974,1.7469706406568504,0.7988286239230257,-0.3977688081309026,1.167321139201246,1.3450532106191362,0.909111664354187,0.91,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(2.023902852345352,1.087113930304877,1.674257252879766,0.5966532121963541,0.6101272780073337,1.680865265824736,0.909111664354187,0.9,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(1.2385142279578056,0.7571855751288902,1.674257252879766,0.5966532121963541,1.724515000395158,2.016677321030339,0.909111664354187,0.94,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(0.2785947981508043,0.4272572199529034,1.674257252879766,1.5910752325236108,1.724515000395158,1.0092411554135332,0.909111664354187,0.88,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.553978658753471,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.6101272780073337,-0.3340070654088696,-1.0999748867047898,0.64,1.6748412415064426,1.9119348182448437,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.7144464713452956,0.909111664354187),(-1.4667132560437435,-0.39756366798706344,-1.8274572629471952,-2.386612848785416,-1.618648166768315,-1.3414432310256739,-1.0999748867047898,0.58,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-1.117651645204834,-0.39756366798706344,-1.8274572629471952,-0.3977688081309026,-2.175842027962227,-1.8451613138340752,-1.0999748867047898,0.52,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.8558554370756518,0.09732886477691666,-0.952028633990455,0.5966532121963541,0.052933416813421515,-1.5093492586284738,-1.0999748867047898,0.48,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.7685900343659244,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.46,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.07046681268810527,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.6698191206144725,0.909111664354187,0.49,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.3322630208172874,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.1661010378060696,0.909111664354187,0.53,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.3257796306675331,1.582006463068857,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.8413351278107333,-1.0999748867047898,0.87,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.8021872144091686,0.9221497527168835,1.674257252879766,1.0938642223599824,0.6101272780073337,1.3450532106191362,0.909111664354187,0.91,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.4531256035702591,0.4272572199529034,1.674257252879766,1.5910752325236108,0.6101272780073337,0.8413351278107333,0.909111664354187,0.88,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.0639834225383509,1.087113930304877,1.674257252879766,0.5966532121963541,1.724515000395158,1.1771471830163363,0.909111664354187,0.86,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(1.9366374496356247,1.9119348182448437,1.674257252879766,1.0938642223599824,0.6101272780073337,1.848771293427536,-1.0999748867047898,0.89,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.36586020086053167,0.4272572199529034,-0.0766000050337147,0.09944220203272576,1.724515000395158,0.42157005880373183,0.909111664354187,0.82,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(0.889452617118896,0.5922213975408968,0.7988286239230257,-0.3977688081309026,0.6101272780073337,-0.3340070654088696,0.909111664354187,0.78,0.36586020086053167,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.0989386267649508,0.909111664354187),(-0.3322630208172874,-1.5523129111030172,-0.0766000050337147,-0.8949798182945309,1.167321139201246,-0.5019130930116695,0.909111664354187,0.76,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.41952842352701486,-1.2223845559270303,-0.952028633990455,-1.8894018386217877,0.052933416813421515,-1.1735372034228724,0.909111664354187,0.56,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.5003104360869879,1.4170422854808635,0.7988286239230257,0.5966532121963541,-0.5042604443804907,-1.0056311758200724,0.909111664354187,0.78,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.6276564089897139,0.7571855751288902,0.7988286239230257,0.5966532121963541,-1.0614543055744028,-0.8377251482172725,0.909111664354187,0.72,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-1.0056311758200724,-1.0999748867047898,0.7,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.2785947981508043,-0.7274920231630502,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-1.5093492586284738,-1.0999748867047898,0.64,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.07046681268810527,-0.8924562007510436,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-2.013067341436875,-1.0999748867047898,0.64,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.6412440614631982,-1.3873487335150236,-0.952028633990455,0.5966532121963541,-1.618648166768315,-1.6772552862312753,-1.0999748867047898,0.46,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.4667132560437435,-1.3873487335150236,-1.8274572629471952,-0.3977688081309026,-1.618648166768315,-3.0205035070536796,0.909111664354187,0.36,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.5067938262367422,-0.5625278455750569,-0.952028633990455,-1.3921908284581592,-1.618648166768315,-0.5019130930116695,-1.0999748867047898,0.42,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.681324631656197,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.8377251482172725,-1.0999748867047898,0.48,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.8558554370756518,-1.057420378339037,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,-0.6698191206144725,-1.0999748867047898,0.47,-0.15773221539783266,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.117651645204834,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.6698191206144725,0.909111664354187,0.54,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.15773221539783266,-0.06763531281107672,-0.952028633990455,0.5966532121963541,-0.5042604443804907,-0.1661010378060696,0.909111664354187,0.56,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.7149218116994412,0.5922213975408968,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.16971101739953035,-1.0999748867047898,0.52,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.09944220203272576,0.052933416813421515,0.5391042781256927,-1.0999748867047898,0.55,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.889452617118896,1.087113930304877,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.7070103057284927,-1.0999748867047898,0.61,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.07046681268810527,-0.06763531281107672,-0.952028633990455,0.09944220203272576,0.052933416813421515,0.06896740083785215,0.909111664354187,0.57,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.10406399273134952,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.6101272780073337,1.0428223609340956,0.909111664354187,0.68,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.9767180198286235,1.2520781078928702,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9420787443724145,0.909111664354187,0.78,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(1.3257796306675331,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.7480276768658578,0.909111664354187,0.94,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(1.6748412415064426,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,1.9495149099892173,0.909111664354187,0.96,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(0.36586020086053167,0.5922213975408968,1.674257252879766,1.5910752325236108,1.724515000395158,1.4290062244205346,0.909111664354187,0.93,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.24499761810756004,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.7405915112490521,0.909111664354187,0.84,-1.117651645204834,-1.057420378339037,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898),(-0.24499761810756004,-0.2325994903990701,-0.0766000050337147,-0.3977688081309026,1.724515000395158,0.5055230726051333,-1.0999748867047898,0.74,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(1.0639834225383509,1.087113930304877,-0.952028633990455,-1.3921908284581592,0.6101272780073337,-0.06535742124438843,0.909111664354187,0.72,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.889452617118896,0.7571855751288902,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.20329222292009272,0.909111664354187,0.74,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.3794478533340162,-1.3873487335150236,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.6362379150939101,-1.0999748867047898,0.64,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.8157748668826532,-2.0472054438669973,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-1.777998902792955,0.909111664354187,0.44,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-1.990305672302108,-2.377133799042984,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-2.0802297524779956,-1.0999748867047898,0.46,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-0.972049970299513,0.909111664354187,0.5,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(2.023902852345352,2.076898995832837,0.7988286239230257,1.5910752325236108,1.724515000395158,1.5129592382219361,0.909111664354187,0.96,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.2785947981508043,0.4272572199529034,1.674257252879766,1.5910752325236108,1.167321139201246,1.0428223609340956,0.909111664354187,0.92,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.4531256035702591,1.2520781078928702,1.674257252879766,0.5966532121963541,1.167321139201246,1.2778907995780144,0.909111664354187,0.92,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(2.023902852345352,1.2520781078928702,1.674257252879766,1.0938642223599824,1.167321139201246,1.4290062244205346,0.909111664354187,0.94,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.1913293954410769,-0.7274920231630502,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.10254860635841155,-1.0999748867047898,0.76,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(-0.15773221539783266,-0.2325994903990701,-0.0766000050337147,1.0938642223599824,0.052933416813421515,-0.30042585988831016,-1.0999748867047898,0.72,-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.9626955331560363,-1.0999748867047898),(0.016798590021622126,-0.06763531281107672,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.535494298532232,-1.0999748867047898,0.66,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.24499761810756004,0.09732886477691666,-0.0766000050337147,1.0938642223599824,0.052933416813421515,-0.7705627371761508,-1.0999748867047898,0.64,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.07046681268810527,0.26229304236491,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.27045463396121155,0.909111664354187,0.74,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(0.10406399273134952,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.6101272780073337,-1.139955997902313,0.909111664354187,0.64,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.553978658753471,-1.7172770886910105,-0.0766000050337147,1.5910752325236108,0.052933416813421515,-1.5765116696695942,-1.0999748867047898,0.38,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.6412440614631982,-1.5523129111030172,-0.952028633990455,0.5966532121963541,-0.5042604443804907,-0.9552593675392334,-1.0999748867047898,0.34,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.3794478533340162,-1.7172770886910105,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-1.2071184089434333,0.909111664354187,0.44,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.2049170479145614,-1.3873487335150236,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-1.5765116696695942,-1.0999748867047898,0.36,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-1.117651645204834,-1.2223845559270303,0.7988286239230257,-1.8894018386217877,-1.0614543055744028,-1.2742808199845537,-1.0999748867047898,0.42,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(-0.9431208397853792,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-1.0056311758200724,-1.0999748867047898,0.48,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(1.2385142279578056,2.076898995832837,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.6062666891668145,0.909111664354187,0.86,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(1.3257796306675331,1.9119348182448437,0.7988286239230257,1.5910752325236108,1.167321139201246,1.076403566454655,0.909111664354187,0.9,-2.3393672831410175,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.7444176972723957,-1.0999748867047898),(0.5403910062799865,0.9221497527168835,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.47194186708457386,0.909111664354187,0.79,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.4531256035702591,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.2332634488471884,0.909111664354187,0.71,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.8041439426967131,-1.0999748867047898,0.64,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.24499761810756004,-0.2325994903990701,-0.952028633990455,0.5966532121963541,0.052933416813421515,-0.585866106813071,-1.0999748867047898,0.62,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.016798590021622126,-0.5625278455750569,-0.952028633990455,1.0938642223599824,0.6101272780073337,-0.2164728460869087,-1.0999748867047898,0.57,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.8021872144091686,0.7571855751288902,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.7573821140093348,0.909111664354187,0.74,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-0.07046681268810527,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.30403583948177093,0.909111664354187,0.69,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,1.167321139201246,0.9756599498929738,0.909111664354187,0.87,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.8493720469258974,1.582006463068857,0.7988286239230257,0.09944220203272576,1.167321139201246,1.4457968271808173,0.909111664354187,0.91,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(1.2385142279578056,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.3114720050985766,0.909111664354187,0.93,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.117651645204834,-0.7274920231630502,1.674257252879766,1.5910752325236108,0.6101272780073337,0.06896740083785215,-1.0999748867047898,0.68,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(-1.0303862424951067,0.09732886477691666,1.674257252879766,-0.3977688081309026,-0.5042604443804907,-0.199682243326629,-1.0999748867047898,0.61,-1.2049170479145614,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.5933022724298738,-1.0999748867047898),(0.36586020086053167,0.26229304236491,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.13612981187897094,0.909111664354187,0.69,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.3794478533340162,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.4347506819705508,0.909111664354187,0.62,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(0.2785947981508043,0.4272572199529034,-0.952028633990455,0.5966532121963541,0.052933416813421515,-0.06535742124438843,-1.0999748867047898,0.72,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5067938262367422,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.2500540516074711,0.909111664354187,0.59,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,0.7988286239230257,1.0938642223599824,1.167321139201246,0.7405915112490521,0.909111664354187,0.66,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.553978658753471,-0.8924562007510436,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.03538619531728977,-1.0999748867047898,0.56,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-2.3393672831410175,-0.5625278455750569,0.7988286239230257,-1.3921908284581592,-1.0614543055744028,-1.9123237248751956,-1.0999748867047898,0.45,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.8157748668826532,-1.3873487335150236,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-2.214554574560236,-1.0999748867047898,0.47,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(0.889452617118896,-0.5625278455750569,1.674257252879766,-0.3977688081309026,0.052933416813421515,0.4047794560434521,0.909111664354187,0.71,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,1.6137028547836172,0.909111664354187,0.94,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(1.5003104360869879,1.9119348182448437,1.674257252879766,1.0938642223599824,1.167321139201246,1.4793780327013768,0.909111664354187,0.94,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,0.7988286239230257,-1.8894018386217877,-1.0614543055744028,-0.40116947644999135,-1.0999748867047898,0.57,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-0.7685900343659244,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.6362379150939101,-1.0999748867047898,0.61,-0.5067938262367422,-1.3873487335150236,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-0.2836352571280305,0.909111664354187),(-1.3794478533340162,-0.2325994903990701,0.7988286239230257,-0.8949798182945309,-0.5042604443804907,-0.2164728460869087,-1.0999748867047898,0.57,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.10254860635841155,0.909111664354187,0.64,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.5403910062799865,0.9221497527168835,-0.0766000050337147,0.5966532121963541,-0.5042604443804907,1.2107283885368956,0.909111664354187,0.85,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.1913293954410769,0.7571855751288902,-0.0766000050337147,-0.8949798182945309,-1.618648166768315,0.18650162015981303,0.909111664354187,0.78,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.8021872144091686,0.7571855751288902,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.8413351278107333,0.909111664354187,0.84,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.4130450333772604,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.2611001968177347,0.909111664354187,0.92,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.9366374496356247,1.087113930304877,1.674257252879766,0.5966532121963541,1.167321139201246,1.9495149099892173,0.909111664354187,0.96,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-1.2049170479145614,-0.39756366798706344,1.674257252879766,1.5910752325236108,1.167321139201246,0.08575800359813185,-1.0999748867047898,0.77,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.681324631656197,-0.39756366798706344,1.674257252879766,0.09944220203272576,0.052933416813421515,-0.06535742124438843,-1.0999748867047898,0.71,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(0.5403910062799865,0.7571855751288902,1.674257252879766,0.5966532121963541,1.167321139201246,0.30403583948177093,-1.0999748867047898,0.79,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(1.4130450333772604,0.9221497527168835,1.674257252879766,0.5966532121963541,0.6101272780073337,1.1435659774957738,0.909111664354187,0.89,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.24499761810756004,0.26229304236491,0.7988286239230257,0.09944220203272576,0.6101272780073337,0.2872452367214912,0.909111664354187,0.82,0.4531256035702591,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4047794560434521,0.909111664354187),(-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,1.5910752325236108,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.76,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(-0.07046681268810527,-1.2223845559270303,-0.952028633990455,-1.8894018386217877,-0.5042604443804907,-0.7369815316555913,0.909111664354187,0.71,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.8021872144091686,1.4170422854808635,-0.952028633990455,1.0938642223599824,-0.5042604443804907,0.8077539222901738,0.909111664354187,0.8,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.10406399273134952,0.26229304236491,-1.8274572629471952,0.09944220203272576,0.052933416813421515,0.8749163333312926,-1.0999748867047898,0.78,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.0639834225383509,0.4272572199529034,-0.952028633990455,0.5966532121963541,-0.5042604443804907,0.9252881416121347,0.909111664354187,0.84,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.3257796306675331,1.7469706406568504,-0.952028633990455,1.0938642223599824,0.052933416813421515,1.2778907995780144,0.909111664354187,0.9,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.2385142279578056,1.2520781078928702,1.674257252879766,0.5966532121963541,0.052933416813421515,1.412215621660255,0.909111664354187,0.92,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(2.023902852345352,2.076898995832837,0.7988286239230257,1.0938642223599824,0.6101272780073337,2.2181645541536983,0.909111664354187,0.97,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.7149218116994412,0.7571855751288902,-0.952028633990455,-0.3977688081309026,0.052933416813421515,0.6062666891668145,0.909111664354187,0.8,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.2785947981508043,0.9221497527168835,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,0.06896740083785215,0.909111664354187,0.81,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(-0.15773221539783266,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-0.199682243326629,-1.0999748867047898,0.75,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(0.8021872144091686,1.087113930304877,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.8581257305710129,0.909111664354187,0.83,0.1913293954410769,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.11933920911869125,0.909111664354187),(1.9366374496356247,1.4170422854808635,0.7988286239230257,0.5966532121963541,0.052933416813421515,2.016677321030339,0.909111664354187,0.96,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.5067938262367422,-0.2325994903990701,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.5690755040527913,0.909111664354187,0.79,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(1.5003104360869879,1.087113930304877,0.7988286239230257,0.5966532121963541,0.6101272780073337,1.3954250188999753,0.909111664354187,0.93,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(1.3257796306675331,1.4170422854808635,1.674257252879766,1.5910752325236108,1.724515000395158,1.1435659774957738,0.909111664354187,0.94,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.36586020086053167,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,0.7741727167696144,0.909111664354187,0.86,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.6276564089897139,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.6101272780073337,0.25366403120093184,-1.0999748867047898,0.79,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(0.8021872144091686,0.09732886477691666,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.4887324698448536,-1.0999748867047898,0.8,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.41952842352701486,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,0.15292041463925066,-1.0999748867047898,0.77,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.15773221539783266,-0.39756366798706344,-0.0766000050337147,-1.3921908284581592,-1.0614543055744028,-0.4347506819705508,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.681324631656197,-0.5625278455750569,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.5690755040527913,-1.0999748867047898,0.65,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.9431208397853792,-0.2325994903990701,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.7705627371761508,-1.0999748867047898,0.61,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-1.7285094641729257,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.1735372034228724,-1.0999748867047898,0.52,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-0.15773221539783266,-0.7274920231630502,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.57,0.6276564089897139,0.4272572199529034,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9252881416121347,0.909111664354187),(-1.6412440614631982,-1.3873487335150236,-1.8274572629471952,-1.8894018386217877,-0.5042604443804907,-1.9123237248751956,-1.0999748867047898,0.53,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.10406399273134952,0.26229304236491,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.1661010378060696,-1.0999748867047898,0.67,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.016798590021622126,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.06535742124438843,-1.0999748867047898,0.68,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.690219702968213,0.909111664354187,0.81,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,1.674257252879766,1.0938642223599824,0.6101272780073337,0.6230572919270941,-1.0999748867047898,0.78,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-1.2921824506242887,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,1.724515000395158,-0.45154128473083044,-1.0999748867047898,0.65,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,-0.5522849012925116,-1.0999748867047898,0.64,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-2.0775710750118352,-1.7172770886910105,-0.952028633990455,-1.3921908284581592,0.6101272780073337,-1.3414432310256739,0.909111664354187,0.64,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.5067938262367422,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.0392123813406318,-1.0999748867047898,0.65,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(-0.41952842352701486,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.9384687647789537,0.909111664354187,0.68,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(1.5003104360869879,1.582006463068857,1.674257252879766,0.5966532121963541,1.167321139201246,0.7909633195298942,0.909111664354187,0.89,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.4531256035702591,0.4272572199529034,0.7988286239230257,0.5966532121963541,1.724515000395158,0.8917069360915754,0.909111664354187,0.86,-1.4667132560437435,-1.2223845559270303,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5690755040527913,-1.0999748867047898),(0.5403910062799865,0.9221497527168835,0.7988286239230257,0.5966532121963541,1.167321139201246,1.0596129636943752,0.909111664354187,0.89,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.36586020086053167,0.5922213975408968,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.6230572919270941,0.909111664354187,0.87,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.2785947981508043,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.052933416813421515,0.4551512643242912,0.909111664354187,0.85,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(1.0639834225383509,1.9119348182448437,0.7988286239230257,1.0938642223599824,1.167321139201246,0.9420787443724145,0.909111664354187,0.9,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.1913293954410769,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,-1.0999748867047898,0.82,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.681324631656197,0.09732886477691666,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.8041439426967131,-1.0999748867047898,0.72,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.8558554370756518,-0.8924562007510436,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.5522849012925116,-1.0999748867047898,0.73,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.4667132560437435,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.7369815316555913,-1.0999748867047898,0.71,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.0303862424951067,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.30042585988831016,-1.0999748867047898,0.71,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-1.2071184089434333,-1.0999748867047898,0.68,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.24499761810756004,0.4272572199529034,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.3376170450023333,-1.0999748867047898,0.75,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(-0.07046681268810527,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.46833188749111015,-1.0999748867047898,0.72,2.023902852345352,0.9221497527168835,0.7988286239230257,1.5910752325236108,1.724515000395158,1.915933704468658,0.909111664354187),(0.889452617118896,0.9221497527168835,0.7988286239230257,1.0938642223599824,1.167321139201246,0.8581257305710129,0.909111664354187,0.89,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.016798590021622126,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.13612981187897094,0.909111664354187,0.84,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.5875758387967152,1.7469706406568504,1.674257252879766,1.0938642223599824,0.052933416813421515,1.412215621660255,0.909111664354187,0.93,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.2385142279578056,1.2520781078928702,1.674257252879766,1.0938642223599824,0.052933416813421515,1.2778907995780144,0.909111664354187,0.93,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.6276564089897139,0.7571855751288902,1.674257252879766,1.5910752325236108,1.724515000395158,0.8077539222901738,0.909111664354187,0.88,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.6276564089897139,0.5922213975408968,1.674257252879766,1.0938642223599824,0.6101272780073337,0.9420787443724145,0.909111664354187,0.9,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.5403910062799865,0.4272572199529034,1.674257252879766,0.5966532121963541,1.724515000395158,0.6398478946873739,0.909111664354187,0.87,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(0.4531256035702591,1.087113930304877,1.674257252879766,1.0938642223599824,0.6101272780073337,0.572685483646252,0.909111664354187,0.86,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(1.6748412415064426,1.7469706406568504,1.674257252879766,1.0938642223599824,1.724515000395158,1.5633310465027752,0.909111664354187,0.94,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.07046681268810527,0.26229304236491,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.27045463396121155,-1.0999748867047898,0.77,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.8558554370756518,-0.06763531281107672,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.1325198322855102,0.909111664354187,0.78,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.9431208397853792,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,-0.5690755040527913,-1.0999748867047898,0.73,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.5940592289464697,-0.2325994903990701,-0.952028633990455,0.09944220203272576,-1.0614543055744028,-0.45154128473083044,-1.0999748867047898,0.73,1.5875758387967152,1.582006463068857,1.674257252879766,1.5910752325236108,1.724515000395158,2.0502585265508984,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.0766000050337147,1.0938642223599824,1.167321139201246,-0.2836352571280305,-1.0999748867047898,0.7,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.3322630208172874,-0.06763531281107672,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.15292041463925066,-1.0999748867047898,0.72,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(0.016798590021622126,-0.7274920231630502,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.0989386267649508,0.909111664354187,0.73,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.15773221539783266,0.4272572199529034,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.2332634488471884,0.909111664354187,0.72,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(2.023902852345352,2.076898995832837,1.674257252879766,1.0938642223599824,1.167321139201246,2.2013739513934185,0.909111664354187,0.97,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(1.5003104360869879,2.076898995832837,1.674257252879766,0.5966532121963541,1.724515000395158,2.1342115403522968,0.909111664354187,0.97,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.6412440614631982,-0.39756366798706344,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.0989386267649508,-1.0999748867047898,0.69,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.9030402695923805,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5933022724298738,-1.0999748867047898,0.57,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.15773221539783266,-1.3873487335150236,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-1.1903278061831537,-1.0999748867047898,0.63,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-0.5940592289464697,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.972049970299513,0.909111664354187,0.66,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.0303862424951067,-0.2325994903990701,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.7369815316555913,-1.0999748867047898,0.64,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(-1.3794478533340162,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.8041439426967131,0.909111664354187,0.68,-1.2921824506242887,-1.057420378339037,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-1.0727935868611929,-1.0999748867047898),(0.7149218116994412,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.7741727167696144,0.909111664354187,0.79,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.9767180198286235,0.4272572199529034,0.7988286239230257,1.5910752325236108,0.6101272780073337,0.908497538851855,0.909111664354187,0.82,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.8493720469258974,2.076898995832837,0.7988286239230257,1.5910752325236108,1.724515000395158,1.7816088823864173,0.909111664354187,0.95,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.4130450333772604,1.9119348182448437,1.674257252879766,1.5910752325236108,1.167321139201246,1.9830961155097766,0.909111664354187,0.96,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.2385142279578056,1.582006463068857,0.7988286239230257,1.0938642223599824,1.724515000395158,1.3786344161396955,0.909111664354187,0.94,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(1.1512488252480781,1.4170422854808635,1.674257252879766,1.5910752325236108,1.167321139201246,1.2778907995780144,0.909111664354187,0.93,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.4531256035702591,0.7571855751288902,0.7988286239230257,1.0938642223599824,1.167321139201246,1.1099847719752143,0.909111664354187,0.91,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.36586020086053167,0.26229304236491,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.8917069360915754,0.909111664354187,0.85,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.6276564089897139,0.4272572199529034,0.7988286239230257,-0.3977688081309026,0.052933416813421515,0.6230572919270941,0.909111664354187,0.84,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.41952842352701486,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.30042585988831016,-1.0999748867047898,0.74,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.3322630208172874,-0.7274920231630502,-0.0766000050337147,0.5966532121963541,0.6101272780073337,0.25366403120093184,-1.0999748867047898,0.76,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(-0.07046681268810527,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.75,-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8377251482172725,-1.0999748867047898),(0.6276564089897139,0.9221497527168835,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.32082644224205065,-1.0999748867047898,0.76,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.7685900343659244,0.26229304236491,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.71,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.0303862424951067,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.6194473123336305,-1.0999748867047898,0.67,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.8157748668826532,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-0.9552593675392334,-1.0999748867047898,0.61,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.9431208397853792,0.4272572199529034,-0.952028633990455,0.09944220203272576,0.6101272780073337,-0.2500540516074711,-1.0999748867047898,0.63,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.41952842352701486,0.4272572199529034,-0.952028633990455,0.09944220203272576,-0.5042604443804907,-0.1157292295252305,-1.0999748867047898,0.64,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.10406399273134952,0.7571855751288902,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.11933920911869125,-1.0999748867047898,0.71,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.6276564089897139,0.5922213975408968,0.7988286239230257,-0.3977688081309026,-0.5042604443804907,0.690219702968213,0.909111664354187,0.82,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.3322630208172874,-0.5625278455750569,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.08575800359813185,-1.0999748867047898,0.73,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.1913293954410769,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.45154128473083044,0.909111664354187,0.74,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-0.41952842352701486,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.5522849012925116,-1.0999748867047898,0.69,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(-1.117651645204834,-1.2223845559270303,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.8880969564981116,-1.0999748867047898,0.64,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(1.1512488252480781,0.9221497527168835,1.674257252879766,1.5910752325236108,0.6101272780073337,1.1939377857766158,0.909111664354187,0.91,-1.8157748668826532,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.3414432310256739,-1.0999748867047898),(0.8021872144091686,0.5922213975408968,1.674257252879766,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187,0.88,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.5966532121963541,1.167321139201246,0.9588693471326941,0.909111664354187,0.85,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(1.0639834225383509,1.087113930304877,1.674257252879766,1.0938642223599824,1.724515000395158,0.9924505526532535,0.909111664354187,0.86,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.5940592289464697,-0.5625278455750569,-0.0766000050337147,-1.3921908284581592,0.052933416813421515,-0.3843788736897117,-1.0999748867047898,0.7,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.1903278061831537,-1.0999748867047898,0.59,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-1.8157748668826532,-1.057420378339037,-1.8274572629471952,-0.8949798182945309,-0.5042604443804907,-1.5429304641490347,-1.0999748867047898,0.6,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.016798590021622126,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.753772134415871,-1.0999748867047898,0.65,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.6276564089897139,1.2520781078928702,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.27045463396121155,0.909111664354187,0.7,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.7149218116994412,1.087113930304877,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.7405915112490521,0.909111664354187,0.76,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.24499761810756004,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.63,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(0.9767180198286235,0.4272572199529034,0.7988286239230257,0.5966532121963541,-1.0614543055744028,0.7070103057284927,0.909111664354187,0.81,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.07046681268810527,-0.39756366798706344,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.22008282568037243,-1.0999748867047898,0.72,0.2785947981508043,0.09732886477691666,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.2668446543677508,0.909111664354187),(-0.5067938262367422,-0.5625278455750569,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.199682243326629,-1.0999748867047898,0.71,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.4551512643242912,0.909111664354187,0.8,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,0.5922213975408968,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.3879888532831724,0.909111664354187,0.77,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,-0.04856681848410872,0.909111664354187,0.74,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.07046681268810527,-1.3873487335150236,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.6734291002079332,-1.0999748867047898,0.7,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.10406399273134952,-1.2223845559270303,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.0989386267649508,0.909111664354187,0.71,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.5875758387967152,1.2520781078928702,0.7988286239230257,1.0938642223599824,1.167321139201246,1.8151900879069767,0.909111664354187,0.93,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.36586020086053167,1.087113930304877,0.7988286239230257,0.5966532121963541,1.724515000395158,0.8749163333312926,-1.0999748867047898,0.85,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.8558554370756518,0.4272572199529034,0.7988286239230257,0.5966532121963541,1.167321139201246,-0.3843788736897117,-1.0999748867047898,0.79,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(-0.681324631656197,-1.3873487335150236,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.06535742124438843,-1.0999748867047898,0.76,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.6276564089897139,-1.2223845559270303,-0.0766000050337147,0.5966532121963541,1.724515000395158,0.06896740083785215,0.909111664354187,0.78,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(0.8021872144091686,-0.8924562007510436,0.7988286239230257,1.5910752325236108,1.724515000395158,0.27045463396121155,0.909111664354187,0.77,-0.24499761810756004,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.6026567095733507,-1.0999748867047898),(1.2385142279578056,1.9119348182448437,0.7988286239230257,1.5910752325236108,1.167321139201246,1.244309594057455,0.909111664354187,0.9,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.889452617118896,0.09732886477691666,1.674257252879766,1.5910752325236108,0.052933416813421515,0.8917069360915754,0.909111664354187,0.87,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.41952842352701486,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,0.6101272780073337,-0.8545157509775522,-1.0999748867047898,0.71,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.7685900343659244,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.40116947644999135,0.909111664354187,0.7,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.6276564089897139,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-2.175842027962227,0.32082644224205065,0.909111664354187,0.7,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.7149218116994412,0.4272572199529034,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,0.27045463396121155,0.909111664354187,0.75,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,-0.8949798182945309,-1.0614543055744028,0.13612981187897094,-1.0999748867047898,0.71,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.41952842352701486,-0.39756366798706344,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.2500540516074711,-1.0999748867047898,0.72,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.24499761810756004,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.7201909288953117,0.909111664354187,0.73,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(0.889452617118896,0.9221497527168835,0.7988286239230257,1.0938642223599824,1.724515000395158,0.908497538851855,-1.0999748867047898,0.83,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.7685900343659244,0.09732886477691666,0.7988286239230257,1.0938642223599824,1.724515000395158,-0.4347506819705508,-1.0999748867047898,0.77,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-0.9431208397853792,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.6362379150939101,0.909111664354187,0.72,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-1.553978658753471,-1.8822412662790038,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.54,0.10406399273134952,-0.2325994903990701,-0.0766000050337147,-1.3921908284581592,-0.5042604443804907,0.08575800359813185,-1.0999748867047898),(-1.990305672302108,-2.0472054438669973,-1.8274572629471952,-1.8894018386217877,-2.175842027962227,-1.610092875190155,-1.0999748867047898,0.49,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.41952842352701486,-1.3873487335150236,-1.8274572629471952,-2.386612848785416,-2.175842027962227,-0.9888405730597928,0.909111664354187,0.52,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.15773221539783266,-1.2223845559270303,-1.8274572629471952,-1.3921908284581592,-1.0614543055744028,-1.0895841896214724,-1.0999748867047898,0.58,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.6062666891668145,0.909111664354187,0.78,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(1.0639834225383509,0.9221497527168835,1.674257252879766,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187,0.89,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.2785947981508043,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.03538619531728977,-1.0999748867047898,0.7,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.7685900343659244,-0.7274920231630502,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.1828916405663493,-1.0999748867047898,0.66,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-1.117651645204834,-0.8924562007510436,-0.952028633990455,-0.3977688081309026,0.6101272780073337,0.22008282568037243,-1.0999748867047898,0.67,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.5067938262367422,-0.8924562007510436,-0.0766000050337147,1.0938642223599824,0.6101272780073337,0.06896740083785215,0.909111664354187,0.68,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.016798590021622126,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.8581257305710129,0.909111664354187,0.8,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(-0.41952842352701486,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.32082644224205065,0.909111664354187,0.81,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(0.36586020086053167,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,0.5055230726051333,0.909111664354187,0.8,0.8021872144091686,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.8749163333312926,0.909111664354187),(2.023902852345352,0.7571855751288902,0.7988286239230257,1.5910752325236108,1.167321139201246,1.7816088823864173,0.909111664354187,0.94,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(1.2385142279578056,1.4170422854808635,1.674257252879766,0.5966532121963541,0.6101272780073337,1.1099847719752143,0.909111664354187,0.93,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(1.6748412415064426,1.7469706406568504,1.674257252879766,1.0938642223599824,0.6101272780073337,0.9924505526532535,0.909111664354187,0.92,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(0.6276564089897139,1.087113930304877,1.674257252879766,1.5910752325236108,1.167321139201246,0.8077539222901738,0.909111664354187,0.89,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.24499761810756004,-0.5625278455750569,0.7988286239230257,1.5910752325236108,1.724515000395158,0.7070103057284927,-1.0999748867047898,0.82,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.3322630208172874,0.26229304236491,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.6734291002079332,-1.0999748867047898,0.79,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.8558554370756518,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5933022724298738,-1.0999748867047898,0.58,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-1.4667132560437435,-0.8924562007510436,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.223909011703713,-1.0999748867047898,0.56,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-1.2921824506242887,-1.3873487335150236,-0.952028633990455,-2.386612848785416,-1.618648166768315,-1.056002984100913,-1.0999748867047898,0.56,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.41952842352701486,-1.5523129111030172,-1.8274572629471952,0.09944220203272576,-0.5042604443804907,-0.7034003261350319,0.909111664354187,0.64,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.07046681268810527,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.46833188749111015,0.909111664354187,0.61,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(0.016798590021622126,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,-1.0614543055744028,-0.04856681848410872,-1.0999748867047898,0.68,0.016798590021622126,-0.5625278455750569,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,0.27045463396121155,-1.0999748867047898),(-0.5940592289464697,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.11933920911869125,-1.0999748867047898,0.76,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.2785947981508043,2.076898995832837,-0.0766000050337147,0.5966532121963541,1.167321139201246,0.8581257305710129,-1.0999748867047898,0.86,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(1.1512488252480781,1.087113930304877,-0.0766000050337147,1.0938642223599824,1.167321139201246,1.076403566454655,0.909111664354187,0.9,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-1.0303862424951067,0.7571855751288902,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.08575800359813185,-1.0999748867047898,0.71,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.681324631656197,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,-1.0614543055744028,-1.0056311758200724,-1.0999748867047898,0.62,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.1913293954410769,0.09732886477691666,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,0.27045463396121155,-1.0999748867047898,0.66,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.4531256035702591,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-0.5042604443804907,-0.2500540516074711,0.909111664354187,0.65,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.5403910062799865,-0.06763531281107672,-0.0766000050337147,0.09944220203272576,0.052933416813421515,-0.08214802400466813,0.909111664354187,0.73,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.3322630208172874,-0.2325994903990701,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-0.2836352571280305,-1.0999748867047898,0.62,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.36586020086053167,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.3376170450023333,0.909111664354187,0.74,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.5403910062799865,0.4272572199529034,-0.0766000050337147,0.5966532121963541,0.052933416813421515,0.8413351278107333,0.909111664354187,0.79,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(0.7149218116994412,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.6101272780073337,0.6734291002079332,0.909111664354187,0.8,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.41952842352701486,0.09732886477691666,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.1157292295252305,-1.0999748867047898,0.69,1.0639834225383509,0.5922213975408968,0.7988286239230257,1.0938642223599824,0.6101272780073337,1.0596129636943752,0.909111664354187),(-0.7685900343659244,0.4272572199529034,0.7988286239230257,0.09944220203272576,-0.5042604443804907,0.0018049897967303734,-1.0999748867047898,0.7,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.23687342844065212,0.909111664354187,0.76,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.9767180198286235,0.09732886477691666,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.9756599498929738,0.909111664354187,0.84,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-0.5067938262367422,-0.06763531281107672,0.7988286239230257,1.0938642223599824,1.167321139201246,0.6734291002079332,0.909111664354187,0.78,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.3794478533340162,-1.2223845559270303,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,-0.9384687647789537,-1.0999748867047898,0.67,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.0303862424951067,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,0.6101272780073337,-0.7873533399364304,-1.0999748867047898,0.66,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-0.7685900343659244,-0.5625278455750569,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.8880969564981116,-1.0999748867047898,0.65,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.6412440614631982,-1.057420378339037,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.54,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(-1.4667132560437435,-1.3873487335150236,-1.8274572629471952,-2.386612848785416,-1.0614543055744028,-0.9888405730597928,-1.0999748867047898,0.58,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.6276564089897139,0.5922213975408968,-0.0766000050337147,-0.8949798182945309,-1.618648166768315,0.3376170450023333,0.909111664354187,0.79,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.889452617118896,0.9221497527168835,0.7988286239230257,0.09944220203272576,-0.5042604443804907,0.15292041463925066,0.909111664354187,0.8,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.016798590021622126,-0.2325994903990701,-0.0766000050337147,0.5966532121963541,0.052933416813421515,-0.1661010378060696,0.909111664354187,0.75,0.6276564089897139,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.7405915112490521,0.909111664354187),(0.5403910062799865,-0.5625278455750569,-0.0766000050337147,0.5966532121963541,0.6101272780073337,-0.2668446543677508,0.909111664354187,0.73,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.24499761810756004,-0.06763531281107672,-0.952028633990455,-0.8949798182945309,0.6101272780073337,-0.5522849012925116,-1.0999748867047898,0.72,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.0303862424951067,-0.8924562007510436,-0.952028633990455,-1.3921908284581592,-1.0614543055744028,-0.7034003261350319,-1.0999748867047898,0.62,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.15773221539783266,-0.5625278455750569,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,-0.45154128473083044,-1.0999748867047898,0.67,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.8021872144091686,1.4170422854808635,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.908497538851855,0.909111664354187,0.81,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.553978658753471,-1.2223845559270303,-0.0766000050337147,-1.3921908284581592,-1.618648166768315,-0.972049970299513,-1.0999748867047898,0.63,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.9030402695923805,-1.057420378339037,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.2406996144639928,-1.0999748867047898,0.69,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.6276564089897139,0.7571855751288902,0.7988286239230257,0.5966532121963541,0.052933416813421515,0.2872452367214912,0.909111664354187,0.8,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-1.7285094641729257,-1.8822412662790038,-0.952028633990455,-0.8949798182945309,-2.175842027962227,-1.1903278061831537,-1.0999748867047898,0.43,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.889452617118896,0.9221497527168835,-0.0766000050337147,0.09944220203272576,-0.5042604443804907,0.10254860635841155,0.909111664354187,0.8,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.5067938262367422,-0.39756366798706344,-0.952028633990455,-0.3977688081309026,-1.618648166768315,-0.8041439426967131,0.909111664354187,0.73,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(-0.7685900343659244,-0.2325994903990701,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.6530285178541898,0.909111664354187,0.75,0.7149218116994412,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,0.8581257305710129,0.909111664354187),(0.1913293954410769,0.09732886477691666,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.0989386267649508,0.909111664354187,0.71,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,0.7988286239230257,1.0938642223599824,0.6101272780073337,0.08575800359813185,0.909111664354187,0.73,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.7149218116994412,0.5922213975408968,0.7988286239230257,0.5966532121963541,1.167321139201246,0.8581257305710129,0.909111664354187,0.83,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.1913293954410769,0.4272572199529034,-0.0766000050337147,-0.3977688081309026,-1.0614543055744028,0.32082644224205065,-1.0999748867047898,0.72,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(1.3257796306675331,1.7469706406568504,1.674257252879766,1.5910752325236108,1.724515000395158,1.462587429941097,0.909111664354187,0.94,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.5403910062799865,0.09732886477691666,1.674257252879766,0.5966532121963541,0.6101272780073337,0.23687342844065212,0.909111664354187,0.81,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.6276564089897139,-0.06763531281107672,1.674257252879766,0.09944220203272576,0.6101272780073337,0.10254860635841155,0.909111664354187,0.81,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.41952842352701486,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.2332634488471884,0.909111664354187,0.75,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(0.8021872144091686,0.4272572199529034,-0.0766000050337147,0.09944220203272576,0.052933416813421515,0.27045463396121155,0.909111664354187,0.79,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.7685900343659244,-0.2325994903990701,-0.0766000050337147,-0.3977688081309026,-0.5042604443804907,-0.6026567095733507,-1.0999748867047898,0.58,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.0303862424951067,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,0.052933416813421515,-0.7873533399364304,-1.0999748867047898,0.59,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.9030402695923805,-1.8822412662790038,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-2.1138109579985565,-1.0999748867047898,0.47,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-0.07046681268810527,-1.5523129111030172,-1.8274572629471952,-1.8894018386217877,-1.618648166768315,-1.9626955331560363,-1.0999748867047898,0.49,1.1512488252480781,1.4170422854808635,0.7988286239230257,1.5910752325236108,1.167321139201246,1.4290062244205346,0.909111664354187),(-1.117651645204834,-1.7172770886910105,-0.952028633990455,-1.8894018386217877,-1.618648166768315,-1.610092875190155,-1.0999748867047898,0.47,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.553978658753471,-2.2121696214549904,-1.8274572629471952,-2.386612848785416,-2.7330358891561395,-2.1138109579985565,-1.0999748867047898,0.42,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.2921824506242887,-1.3873487335150236,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-2.2649263828410766,-1.0999748867047898,0.57,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-0.3322630208172874,-1.057420378339037,-0.0766000050337147,-0.8949798182945309,-0.5042604443804907,-0.9384687647789537,-1.0999748867047898,0.62,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.10406399273134952,-0.06763531281107672,-0.0766000050337147,-0.3977688081309026,0.052933416813421515,-0.5522849012925116,0.909111664354187,0.74,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.7149218116994412,0.4272572199529034,0.7988286239230257,0.09944220203272576,0.6101272780073337,0.11933920911869125,0.909111664354187,0.73,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.2049170479145614,-1.2223845559270303,-0.952028633990455,-0.3977688081309026,0.052933416813421515,-0.9048875592583913,0.909111664354187,0.64,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.4667132560437435,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,-1.0614543055744028,-0.7201909288953117,-1.0999748867047898,0.63,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.7285094641729257,-1.5523129111030172,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-1.5597210669093144,-1.0999748867047898,0.59,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.016798590021622126,-0.2325994903990701,-0.952028633990455,-1.3921908284581592,0.052933416813421515,-0.8041439426967131,-1.0999748867047898,0.73,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(0.889452617118896,0.26229304236491,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.2872452367214912,0.909111664354187,0.79,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-1.3794478533340162,-0.5625278455750569,-0.952028633990455,0.09944220203272576,0.052933416813421515,-1.1903278061831537,0.909111664354187,0.68,-0.41952842352701486,-0.7274920231630502,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.30403583948177093,-1.0999748867047898),(-0.24499761810756004,-0.39756366798706344,-0.952028633990455,-0.8949798182945309,-1.618648166768315,-1.610092875190155,-1.0999748867047898,0.7,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.36586020086053167,-0.06763531281107672,-0.952028633990455,-1.3921908284581592,-2.175842027962227,-0.2668446543677508,-1.0999748867047898,0.81,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.4531256035702591,0.4272572199529034,-0.0766000050337147,0.5966532121963541,1.724515000395158,0.06896740083785215,0.909111664354187,0.85,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.5003104360869879,1.4170422854808635,0.7988286239230257,0.5966532121963541,0.052933416813421515,1.580121649263055,0.909111664354187,0.93,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.8493720469258974,1.2520781078928702,1.674257252879766,1.0938642223599824,1.724515000395158,1.0596129636943752,0.909111664354187,0.91,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.9431208397853792,-0.7274920231630502,-0.952028633990455,-0.8949798182945309,-0.5042604443804907,-0.40116947644999135,-1.0999748867047898,0.69,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.3322630208172874,-0.8924562007510436,-0.0766000050337147,0.09944220203272576,0.6101272780073337,0.5055230726051333,0.909111664354187,0.77,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(1.1512488252480781,1.087113930304877,0.7988286239230257,1.0938642223599824,-0.5042604443804907,0.9588693471326941,0.909111664354187,0.86,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(0.2785947981508043,-0.5625278455750569,-0.0766000050337147,0.09944220203272576,1.167321139201246,-0.4347506819705508,0.909111664354187,0.74,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-0.5067938262367422,-1.5523129111030172,-1.8274572629471952,-2.386612848785416,-1.0614543055744028,-1.9123237248751956,-1.0999748867047898,0.57,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-1.6412440614631982,-2.5420979766309775,-1.8274572629471952,-1.3921908284581592,-1.618648166768315,-1.2071184089434333,-1.0999748867047898,0.51,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187),(-1.3794478533340162,-1.5523129111030172,-1.8274572629471952,-1.3921908284581592,-0.5042604443804907,-0.9552593675392334,0.909111664354187,0.67,1.4130450333772604,1.582006463068857,0.7988286239230257,1.5910752325236108,0.6101272780073337,1.7816088823864173,0.909111664354187) DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.1, 0.0, 5, 1.0)(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.1, 0.0, 5, 'SGD')(target, param1, param2, param3, param4, param5, param6, param7) as state from test.defaults; with (select state from test.model) as model select evalMLMethod(model, predict1, predict2, predict3, predict4, predict5, predict6, predict7) from test.defaults; diff --git a/dbms/tests/queries/0_stateless/00938_dataset_test.sql b/dbms/tests/queries/0_stateless/00938_dataset_test.sql index 2ade0fc412c..bb71b49379c 100644 --- a/dbms/tests/queries/0_stateless/00938_dataset_test.sql +++ b/dbms/tests/queries/0_stateless/00938_dataset_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.03, 0.00001, 2, 2.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.03, 0.00001, 2, 'Momentum')(target, param1, param2) as state from test.defaults; select ans > -67.0 and ans < -66.9 from (with (select state + state + state from test.model) as model select evalMLMethod(model, predict1, predict2) as ans from test.defaults limit 1); diff --git a/dbms/tests/queries/0_stateless/00939_ml_test.sql b/dbms/tests/queries/0_stateless/00939_ml_test.sql index 6152053f17a..166b3ae0d85 100644 --- a/dbms/tests/queries/0_stateless/00939_ml_test.sql +++ b/dbms/tests/queries/0_stateless/00939_ml_test.sql @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS test.defaults insert into test.defaults values (-3.273, -1.452, 4.267, 20.0, 40.0), (0.121, -0.615, 4.290, 20.0, 40.0), (-1.099, 2.755, -3.060, 20.0, 40.0), (1.090, 2.945, -2.346, 20.0, 40.0), (0.305, 2.179, -1.205, 20.0, 40.0), (-0.925, 0.702, 1.134, 20.0, 40.0), (3.178, -1.316, 7.221, 20.0, 40.0), (-2.756, -0.473, 2.569, 20.0, 40.0), (3.665, 2.303, 0.226, 20.0, 40.0), (1.662, 1.951, -0.070, 20.0, 40.0), (2.869, 0.593, 3.249, 20.0, 40.0), (0.818, -0.593, 4.594, 20.0, 40.0), (-1.917, 0.916, 0.209, 20.0, 40.0), (2.706, 1.523, 1.307, 20.0, 40.0), (0.219, 2.162, -1.214, 20.0, 40.0), (-4.510, 1.376, -2.007, 20.0, 40.0), (4.284, -0.515, 6.173, 20.0, 40.0), (-1.101, 2.810, -3.170, 20.0, 40.0), (-1.810, -1.117, 4.329, 20.0, 40.0), (0.055, 1.115, 0.797, 20.0, 40.0), (-2.178, 2.904, -3.898, 20.0, 40.0), (-3.494, -1.814, 4.882, 20.0, 40.0), (3.027, 0.476, 3.562, 20.0, 40.0), (-1.434, 1.151, -0.018, 20.0, 40.0), (1.180, 0.992, 1.606, 20.0, 40.0), (0.015, 0.971, 1.067, 20.0, 40.0), (-0.511, -0.875, 4.495, 20.0, 40.0), (0.961, 2.348, -1.216, 20.0, 40.0), (-2.279, 0.038, 1.785, 20.0, 40.0), (-1.568, -0.248, 2.712, 20.0, 40.0), (-0.496, 0.366, 2.020, 20.0, 40.0), (1.177, -1.401, 6.390, 20.0, 40.0), (2.882, -1.442, 7.325, 20.0, 40.0), (-1.066, 1.817, -1.167, 20.0, 40.0), (-2.144, 2.791, -3.655, 20.0, 40.0), (-4.370, 2.228, -3.642, 20.0, 40.0), (3.996, 2.775, -0.553, 20.0, 40.0), (0.289, 2.055, -0.965, 20.0, 40.0), (-0.588, -1.601, 5.908, 20.0, 40.0), (-1.801, 0.417, 1.265, 20.0, 40.0), (4.375, -1.499, 8.186, 20.0, 40.0), (-2.618, 0.038, 1.615, 20.0, 40.0), (3.616, -0.833, 6.475, 20.0, 40.0), (-4.045, -1.558, 4.094, 20.0, 40.0), (-3.962, 0.636, -0.253, 20.0, 40.0), (3.505, 2.625, -0.497, 20.0, 40.0), (3.029, -0.523, 5.560, 20.0, 40.0), (-3.520, -0.474, 2.188, 20.0, 40.0), (2.430, -1.469, 7.154, 20.0, 40.0), (1.547, -1.654, 7.082, 20.0, 40.0), (-1.370, 0.575, 1.165, 20.0, 40.0), (-1.869, -1.555, 5.176, 20.0, 40.0), (3.536, 2.841, -0.913, 20.0, 40.0), (-3.810, 1.220, -1.344, 20.0, 40.0), (-1.971, 1.462, -0.910, 20.0, 40.0), (-0.243, 0.167, 2.545, 20.0, 40.0), (-1.403, 2.645, -2.991, 20.0, 40.0), (0.532, -0.114, 3.494, 20.0, 40.0), (-1.678, 0.975, 0.212, 20.0, 40.0), (-0.656, 2.140, -1.609, 20.0, 40.0), (1.743, 2.631, -1.390, 20.0, 40.0), (2.586, 2.943, -1.593, 20.0, 40.0), (-0.512, 2.969, -3.195, 20.0, 40.0), (2.283, -0.100, 4.342, 20.0, 40.0), (-4.293, 0.872, -0.890, 20.0, 40.0), (3.411, 1.300, 2.106, 20.0, 40.0), (-0.281, 2.951, -3.042, 20.0, 40.0), (-4.442, 0.384, 0.012, 20.0, 40.0), (1.194, 1.746, 0.104, 20.0, 40.0), (-1.152, 1.862, -1.300, 20.0, 40.0), (1.362, -1.341, 6.363, 20.0, 40.0), (-4.488, 2.618, -4.481, 20.0, 40.0), (3.419, -0.564, 5.837, 20.0, 40.0), (-3.392, 0.396, 0.512, 20.0, 40.0), (-1.629, -0.909, 4.003, 20.0, 40.0), (4.447, -1.088, 7.399, 20.0, 40.0), (-1.232, 1.699, -1.014, 20.0, 40.0), (-1.286, -0.609, 3.575, 20.0, 40.0), (2.437, 2.796, -1.374, 20.0, 40.0), (-4.864, 1.989, -3.410, 20.0, 40.0), (-1.716, -1.399, 4.940, 20.0, 40.0), (-3.084, 1.858, -2.259, 20.0, 40.0), (2.828, -0.319, 5.053, 20.0, 40.0), (-1.226, 2.586, -2.786, 20.0, 40.0), (2.456, 0.092, 4.044, 20.0, 40.0), (-0.989, 2.375, -2.245, 20.0, 40.0), (3.268, 0.935, 2.765, 20.0, 40.0), (-4.128, -1.995, 4.927, 20.0, 40.0), (-1.083, 2.197, -1.935, 20.0, 40.0), (-3.471, -1.198, 3.660, 20.0, 40.0), (4.617, -1.136, 7.579, 20.0, 40.0), (2.054, -1.675, 7.378, 20.0, 40.0), (4.106, 2.326, 0.402, 20.0, 40.0), (1.558, 0.310, 3.158, 20.0, 40.0), (0.792, 0.900, 1.596, 20.0, 40.0), (-3.229, 0.300, 0.785, 20.0, 40.0), (3.787, -0.793, 6.479, 20.0, 40.0), (1.786, 2.288, -0.684, 20.0, 40.0), (2.643, 0.223, 3.875, 20.0, 40.0), (-3.592, 2.122, -3.040, 20.0, 40.0), (4.519, -1.760, 8.779, 20.0, 40.0), (3.221, 2.255, 0.101, 20.0, 40.0), (4.151, 1.788, 1.500, 20.0, 40.0), (-1.033, -1.195, 4.874, 20.0, 40.0), (-1.636, -1.037, 4.257, 20.0, 40.0), (-3.548, 1.911, -2.596, 20.0, 40.0), (4.829, -0.293, 6.001, 20.0, 40.0), (-4.684, -1.664, 3.986, 20.0, 40.0), (4.531, -0.503, 6.271, 20.0, 40.0), (-3.503, -1.606, 4.460, 20.0, 40.0), (-2.036, -1.522, 5.027, 20.0, 40.0), (-0.473, -0.617, 3.997, 20.0, 40.0), (-1.554, -1.630, 5.483, 20.0, 40.0), (-3.567, -1.043, 3.302, 20.0, 40.0), (-2.038, 0.579, 0.823, 20.0, 40.0), (-3.040, 0.857, -0.233, 20.0, 40.0), (4.610, 0.562, 4.181, 20.0, 40.0), (-3.323, -1.938, 5.215, 20.0, 40.0), (4.314, 1.720, 1.717, 20.0, 40.0), (-1.220, 0.615, 1.161, 20.0, 40.0), (-2.556, 1.120, -0.519, 20.0, 40.0), (-3.717, -0.108, 1.358, 20.0, 40.0), (4.689, -1.826, 8.996, 20.0, 40.0), (3.452, 0.506, 3.713, 20.0, 40.0), (2.472, 0.612, 3.012, 20.0, 40.0), (3.452, 0.450, 3.826, 20.0, 40.0), (1.207, 2.585, -1.567, 20.0, 40.0), (-4.826, 1.090, -1.593, 20.0, 40.0), (3.116, -1.118, 6.794, 20.0, 40.0), (0.448, 2.732, -2.240, 20.0, 40.0), (-1.096, -0.525, 3.503, 20.0, 40.0), (-4.680, -0.238, 1.137, 20.0, 40.0), (2.552, -1.403, 7.082, 20.0, 40.0), (0.719, 2.997, -2.635, 20.0, 40.0), (0.347, -1.966, 7.105, 20.0, 40.0), (2.958, -0.404, 5.288, 20.0, 40.0), (0.722, -1.950, 7.261, 20.0, 40.0), (-2.851, -0.986, 3.546, 20.0, 40.0), (-4.316, -0.439, 1.721, 20.0, 40.0), (-1.685, -0.201, 2.560, 20.0, 40.0), (1.856, 0.190, 3.549, 20.0, 40.0), (-2.052, 0.206, 1.562, 20.0, 40.0), (-2.504, -0.646, 3.041, 20.0, 40.0), (3.235, 0.882, 2.854, 20.0, 40.0), (-1.366, -1.573, 5.463, 20.0, 40.0), (-3.447, 2.419, -3.562, 20.0, 40.0), (4.155, 2.092, 0.893, 20.0, 40.0), (-0.935, 0.209, 2.116, 20.0, 40.0), (3.117, -1.821, 8.201, 20.0, 40.0), (3.759, 0.577, 3.725, 20.0, 40.0), (-0.938, 2.992, -3.453, 20.0, 40.0), (-0.525, 2.341, -1.945, 20.0, 40.0), (4.540, 2.625, 0.019, 20.0, 40.0), (-2.097, 1.190, -0.429, 20.0, 40.0), (-2.672, 1.983, -2.302, 20.0, 40.0), (-3.038, -1.490, 4.460, 20.0, 40.0), (-0.943, 2.149, -1.770, 20.0, 40.0), (0.739, 1.598, 0.174, 20.0, 40.0), (1.828, 1.853, 0.208, 20.0, 40.0), (4.856, 0.137, 5.153, 20.0, 40.0), (-1.617, 0.468, 1.255, 20.0, 40.0), (-1.972, 2.053, -2.092, 20.0, 40.0), (-4.633, 1.389, -2.094, 20.0, 40.0), (-3.628, -1.156, 3.498, 20.0, 40.0), (3.597, 1.034, 2.731, 20.0, 40.0), (-1.488, -0.002, 2.261, 20.0, 40.0), (0.749, 1.921, -0.468, 20.0, 40.0), (1.304, -1.371, 6.394, 20.0, 40.0), (4.587, 2.936, -0.579, 20.0, 40.0), (-2.241, 1.791, -1.703, 20.0, 40.0), (-2.945, 1.372, -1.216, 20.0, 40.0), (1.375, 0.395, 2.898, 20.0, 40.0), (-1.281, -0.641, 3.642, 20.0, 40.0), (2.178, 0.895, 2.299, 20.0, 40.0), (3.031, -0.786, 6.087, 20.0, 40.0), (-1.385, -0.375, 3.058, 20.0, 40.0), (4.041, -0.431, 5.882, 20.0, 40.0), (0.480, -0.507, 4.254, 20.0, 40.0), (-3.797, 0.140, 0.822, 20.0, 40.0), (2.355, 2.502, -0.827, 20.0, 40.0), (1.376, -1.583, 6.854, 20.0, 40.0), (0.164, 1.405, 0.273, 20.0, 40.0), (-1.273, 1.471, -0.579, 20.0, 40.0), (0.770, 2.246, -1.107, 20.0, 40.0), (4.552, 2.904, -0.533, 20.0, 40.0), (4.259, -1.772, 8.674, 20.0, 40.0), (-0.309, 1.159, 0.528, 20.0, 40.0), (3.581, 2.700, -0.610, 20.0, 40.0), (-3.202, 0.346, 0.707, 20.0, 40.0), (-1.575, 1.242, -0.271, 20.0, 40.0), (-1.584, -0.493, 3.194, 20.0, 40.0), (-3.778, 0.150, 0.810, 20.0, 40.0), (-4.675, 1.749, -2.835, 20.0, 40.0), (3.567, -0.792, 6.367, 20.0, 40.0), (-0.417, 1.399, -0.006, 20.0, 40.0), (-4.672, 2.007, -3.349, 20.0, 40.0), (-1.034, 0.196, 2.090, 20.0, 40.0), (-3.796, 2.496, -3.890, 20.0, 40.0), (3.532, -0.497, 5.759, 20.0, 40.0), (4.868, -1.359, 8.151, 20.0, 40.0), (-0.769, 0.302, 2.011, 20.0, 40.0), (4.475, 2.612, 0.014, 20.0, 40.0), (-3.532, -0.395, 2.024, 20.0, 40.0), (0.322, 0.675, 1.812, 20.0, 40.0), (-2.028, -1.942, 5.870, 20.0, 40.0), (1.810, -1.244, 6.392, 20.0, 40.0), (-0.783, 1.242, 0.124, 20.0, 40.0), (-4.745, -1.300, 3.227, 20.0, 40.0), (1.902, 1.973, 0.005, 20.0, 40.0), (-3.453, -1.429, 4.132, 20.0, 40.0), (1.559, 0.986, 1.808, 20.0, 40.0), (0.128, 2.754, -2.443, 20.0, 40.0), (2.759, 1.727, 0.926, 20.0, 40.0), (-4.468, 1.690, -2.614, 20.0, 40.0), (-2.368, -1.922, 5.659, 20.0, 40.0), (-2.766, 2.128, -2.640, 20.0, 40.0), (0.967, -1.825, 7.133, 20.0, 40.0), (-2.854, 2.855, -4.136, 20.0, 40.0), (-2.944, 1.875, -2.222, 20.0, 40.0), (-2.632, -0.983, 3.649, 20.0, 40.0), (2.427, 2.239, -0.266, 20.0, 40.0), (-1.726, -0.838, 3.812, 20.0, 40.0), (0.007, -0.903, 4.809, 20.0, 40.0), (-2.013, 1.092, -0.191, 20.0, 40.0), (-0.449, 0.970, 0.836, 20.0, 40.0), (1.396, 0.411, 2.876, 20.0, 40.0), (-1.115, -1.790, 6.023, 20.0, 40.0), (3.748, 1.917, 1.039, 20.0, 40.0), (2.978, 1.043, 2.404, 20.0, 40.0), (-3.969, 2.514, -4.013, 20.0, 40.0), (4.455, -0.050, 5.328, 20.0, 40.0), (-3.065, -0.846, 3.160, 20.0, 40.0), (-1.069, 2.167, -1.869, 20.0, 40.0), (3.016, -1.393, 7.294, 20.0, 40.0), (0.045, -1.928, 6.879, 20.0, 40.0), (-2.555, -0.984, 3.690, 20.0, 40.0), (-1.995, -0.054, 2.111, 20.0, 40.0), (4.600, -0.509, 6.318, 20.0, 40.0), (-1.942, 1.215, -0.402, 20.0, 40.0), (1.262, 2.765, -1.899, 20.0, 40.0), (2.617, -1.106, 6.521, 20.0, 40.0), (1.737, 0.554, 2.761, 20.0, 40.0), (-2.197, 0.632, 0.638, 20.0, 40.0), (4.768, 2.618, 0.147, 20.0, 40.0), (-3.737, -0.939, 3.010, 20.0, 40.0), (-2.623, 0.595, 0.499, 20.0, 40.0), (4.752, -0.340, 6.057, 20.0, 40.0), (2.333, -1.037, 6.240, 20.0, 40.0), (4.234, -1.882, 8.881, 20.0, 40.0), (-3.393, -0.812, 2.927, 20.0, 40.0), (0.885, 1.383, 0.678, 20.0, 40.0), (0.123, 2.937, -2.812, 20.0, 40.0), (2.969, 0.760, 2.964, 20.0, 40.0), (-4.929, 1.251, -1.967, 20.0, 40.0), (1.916, 2.223, -0.488, 20.0, 40.0), (-0.020, -1.740, 6.469, 20.0, 40.0), (0.702, -1.272, 5.895, 20.0, 40.0), (2.496, 2.648, -1.048, 20.0, 40.0), (4.067, -1.475, 7.984, 20.0, 40.0), (-3.717, 1.851, -2.561, 20.0, 40.0), (1.678, -0.624, 5.088, 20.0, 40.0), (1.073, 0.695, 2.146, 20.0, 40.0), (1.842, -0.749, 5.419, 20.0, 40.0), (-3.518, 1.909, -2.578, 20.0, 40.0), (2.229, 1.189, 1.737, 20.0, 40.0), (4.987, 2.893, -0.292, 20.0, 40.0), (-4.809, 1.043, -1.490, 20.0, 40.0), (-0.241, -0.728, 4.334, 20.0, 40.0), (-3.331, 0.590, 0.156, 20.0, 40.0), (-0.455, 2.621, -2.470, 20.0, 40.0), (1.492, 1.223, 1.301, 20.0, 40.0), (3.948, 2.841, -0.709, 20.0, 40.0), (0.732, 0.446, 2.475, 20.0, 40.0), (2.400, 2.390, -0.579, 20.0, 40.0), (-2.718, 1.427, -1.213, 20.0, 40.0), (-1.826, 1.451, -0.815, 20.0, 40.0), (1.125, 0.438, 2.686, 20.0, 40.0), (-4.918, 1.880, -3.219, 20.0, 40.0), (3.068, -0.442, 5.418, 20.0, 40.0), (1.982, 1.201, 1.589, 20.0, 40.0), (0.701, -1.709, 6.768, 20.0, 40.0), (-1.496, 2.564, -2.877, 20.0, 40.0), (-3.812, 0.974, -0.853, 20.0, 40.0), (-3.405, 2.018, -2.739, 20.0, 40.0), (2.211, 2.889, -1.674, 20.0, 40.0), (-2.481, 2.931, -4.103, 20.0, 40.0), (-3.721, 2.765, -4.391, 20.0, 40.0), (-1.768, -1.292, 4.699, 20.0, 40.0), (-4.462, 1.058, -1.347, 20.0, 40.0), (-3.516, -1.942, 5.126, 20.0, 40.0), (0.485, 2.420, -1.597, 20.0, 40.0), (-0.492, 0.242, 2.270, 20.0, 40.0), (4.245, 1.689, 1.744, 20.0, 40.0), (2.234, 0.364, 3.389, 20.0, 40.0), (2.629, 2.224, -0.134, 20.0, 40.0), (-4.375, 1.221, -1.630, 20.0, 40.0), (-0.618, 1.374, -0.057, 20.0, 40.0), (-2.580, -1.604, 4.918, 20.0, 40.0), (0.159, 1.104, 0.871, 20.0, 40.0), (-3.597, 0.975, -0.749, 20.0, 40.0); DROP TABLE IF EXISTS test.model; -create table test.model engine = Memory as select LinearRegressionState(0.03, 0.00001, 2, 2.0)(target, param1, param2) as state from test.defaults; +create table test.model engine = Memory as select LinearRegressionState(0.03, 0.00001, 2, 'Nesterov')(target, param1, param2) as state from test.defaults; select ans > -67.0 and ans < -66.9 from (with (select state from test.model) as model select evalMLMethod(model, predict1, predict2) as ans from test.defaults limit 1); From ef98afb6a610ddb1d873b8ca7389ad318fec6fd8 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Sun, 21 Apr 2019 17:42:37 +0300 Subject: [PATCH 048/194] review fixes --- dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp | 2 +- dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index 67a361d73c8..bfd87f28821 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -34,7 +34,7 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( auto l2_reg_coef = Float64(0.01); UInt32 batch_size = 1; - std::shared_ptr weights_updater = std::make_unique(); + std::shared_ptr weights_updater = std::make_shared(); std::shared_ptr gradient_computer; if (!parameters.empty()) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index d535a27adaa..88d869f022a 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -87,7 +87,7 @@ public: { const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]); if (!isNumber(cur_col.type)) { - throw Exception("Prediction arguments must be have numeric type", ErrorCodes::BAD_ARGUMENTS); + throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS); } /// If column type is already Float64 then castColumn simply returns it @@ -153,7 +153,7 @@ public: { const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]); if (!isNumber(cur_col.type)) { - throw Exception("Prediction arguments must be have numeric type", ErrorCodes::BAD_ARGUMENTS); + throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS); } /// If column type is already Float64 then castColumn simply returns it From 0bedabb5e45431ba83c44a81e7f5a57731b14510 Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Sun, 21 Apr 2019 17:44:39 +0300 Subject: [PATCH 049/194] review fixes --- .../src/AggregateFunctions/AggregateFunctionMLMethod.cpp | 9 ++++++--- dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp index bfd87f28821..cbfd4c69723 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp @@ -52,13 +52,16 @@ AggregateFunctionPtr createAggregateFunctionMLMethod( } if (parameters.size() > 3) { - if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'SGD\'") { + if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'SGD\'") + { weights_updater = std::make_shared(); } - else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Momentum\'") { + else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Momentum\'") + { weights_updater = std::make_shared(); } - else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Nesterov\'") { + else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Nesterov\'") + { weights_updater = std::make_shared(); } else diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 88d869f022a..649101763f9 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -86,7 +86,8 @@ public: for (size_t i = 1; i < arguments.size(); ++i) { const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]); - if (!isNumber(cur_col.type)) { + if (!isNumber(cur_col.type)) + { throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS); } @@ -152,7 +153,8 @@ public: for (size_t i = 1; i < arguments.size(); ++i) { const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]); - if (!isNumber(cur_col.type)) { + if (!isNumber(cur_col.type)) + { throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS); } From 6c7f2cbc377d99741fa7dd0ca1853952a7d7f8ad Mon Sep 17 00:00:00 2001 From: Alexander Kozhikhov Date: Sun, 21 Apr 2019 19:08:55 +0300 Subject: [PATCH 050/194] asan --- dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h index 649101763f9..7fe1d9b8cab 100644 --- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h +++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h @@ -394,7 +394,7 @@ public: void add(const IColumn **columns, size_t row_num) { /// first column stores target; features start from (columns + 1) - const auto &target = (*columns[0])[row_num].get(); + const auto target = (*columns[0])[row_num].get(); /// Here we have columns + 1 as first column corresponds to target value, and others - to features weights_updater->add_to_batch(gradient_batch, *gradient_computer, weights, bias, learning_rate, l2_reg_coef, target, columns + 1, row_num); From 8668d22f4b869e4d916d44b1b075804686041e5a Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 22 Apr 2019 22:03:11 +0300 Subject: [PATCH 051/194] Freebsd fixes --- cmake/find_execinfo.cmake | 7 +++---- dbms/CMakeLists.txt | 3 +-- dbms/programs/clang/Compiler-5.0.0/CMakeLists.txt | 2 +- dbms/programs/clang/Compiler-6.0.0/CMakeLists.txt | 2 +- dbms/programs/clang/Compiler-7.0.0/CMakeLists.txt | 2 +- dbms/programs/clang/Compiler-7.0.0bundled/CMakeLists.txt | 2 +- dbms/tests/clickhouse-test | 8 ++++---- libs/libcommon/CMakeLists.txt | 6 +++++- libs/libdaemon/CMakeLists.txt | 2 +- 9 files changed, 18 insertions(+), 16 deletions(-) diff --git a/cmake/find_execinfo.cmake b/cmake/find_execinfo.cmake index 650d279983c..85cc5cf951a 100644 --- a/cmake/find_execinfo.cmake +++ b/cmake/find_execinfo.cmake @@ -1,9 +1,8 @@ if (OS_FREEBSD) find_library (EXECINFO_LIBRARY execinfo) find_library (ELF_LIBRARY elf) - message (STATUS "Using execinfo: ${EXECINFO_LIBRARY}") - message (STATUS "Using elf: ${ELF_LIBRARY}") + set (EXECINFO_LIBRARIES ${EXECINFO_LIBRARY} ${ELF_LIBRARY}) + message (STATUS "Using execinfo: ${EXECINFO_LIBRARIES}") else () - set (EXECINFO_LIBRARY "") - set (ELF_LIBRARY "") + set (EXECINFO_LIBRARIES "") endif () diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt index 2c9bfa48605..63e97f4e061 100644 --- a/dbms/CMakeLists.txt +++ b/dbms/CMakeLists.txt @@ -194,8 +194,7 @@ target_link_libraries (clickhouse_common_io ${CITYHASH_LIBRARIES} PRIVATE ${ZLIB_LIBRARIES} - ${EXECINFO_LIBRARY} - ${ELF_LIBRARY} + ${EXECINFO_LIBRARIES} PUBLIC ${Boost_SYSTEM_LIBRARY} PRIVATE diff --git a/dbms/programs/clang/Compiler-5.0.0/CMakeLists.txt b/dbms/programs/clang/Compiler-5.0.0/CMakeLists.txt index 7fe0cd92ef7..e0171630bf2 100644 --- a/dbms/programs/clang/Compiler-5.0.0/CMakeLists.txt +++ b/dbms/programs/clang/Compiler-5.0.0/CMakeLists.txt @@ -46,7 +46,7 @@ LLVMSupport #PollyISL #PollyPPCG -PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARY} Threads::Threads +PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARIES} Threads::Threads ${MALLOC_LIBRARIES} ${GLIBC_COMPATIBILITY_LIBRARIES} ${MEMCPY_LIBRARIES} diff --git a/dbms/programs/clang/Compiler-6.0.0/CMakeLists.txt b/dbms/programs/clang/Compiler-6.0.0/CMakeLists.txt index b96bdb0647a..bac622ab09e 100644 --- a/dbms/programs/clang/Compiler-6.0.0/CMakeLists.txt +++ b/dbms/programs/clang/Compiler-6.0.0/CMakeLists.txt @@ -46,7 +46,7 @@ ${REQUIRED_LLVM_LIBRARIES} #PollyISL #PollyPPCG -PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARY} Threads::Threads +PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARIES} Threads::Threads ${MALLOC_LIBRARIES} ${GLIBC_COMPATIBILITY_LIBRARIES} ${MEMCPY_LIBRARIES} diff --git a/dbms/programs/clang/Compiler-7.0.0/CMakeLists.txt b/dbms/programs/clang/Compiler-7.0.0/CMakeLists.txt index 8b6ba6be994..35e23cc6b46 100644 --- a/dbms/programs/clang/Compiler-7.0.0/CMakeLists.txt +++ b/dbms/programs/clang/Compiler-7.0.0/CMakeLists.txt @@ -42,7 +42,7 @@ lldCore ${REQUIRED_LLVM_LIBRARIES} -PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARY} Threads::Threads +PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARIES} Threads::Threads ${MALLOC_LIBRARIES} ${GLIBC_COMPATIBILITY_LIBRARIES} ${MEMCPY_LIBRARIES} diff --git a/dbms/programs/clang/Compiler-7.0.0bundled/CMakeLists.txt b/dbms/programs/clang/Compiler-7.0.0bundled/CMakeLists.txt index d0ccc8d672c..d03052ffc28 100644 --- a/dbms/programs/clang/Compiler-7.0.0bundled/CMakeLists.txt +++ b/dbms/programs/clang/Compiler-7.0.0bundled/CMakeLists.txt @@ -42,7 +42,7 @@ lldCore ${REQUIRED_LLVM_LIBRARIES} -PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARY} Threads::Threads +PUBLIC ${ZLIB_LIBRARIES} ${EXECINFO_LIBRARIES} Threads::Threads ${MALLOC_LIBRARIES} ${GLIBC_COMPATIBILITY_LIBRARIES} ${MEMCPY_LIBRARIES} diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index 6b11331f451..7a99be3ea48 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -19,7 +19,7 @@ from time import sleep from errno import ESRCH import termcolor from random import random -import commands +import subprocess MESSAGES_TO_RETRY = [ @@ -145,7 +145,7 @@ def main(args): os.environ.setdefault("CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL", server_logs_level) if args.zookeeper is None: - code, out = commands.getstatusoutput(args.extract_from_config +" --try --config " + args.configserver + ' --key zookeeper | grep . | wc -l') + code, out = subprocess.getstatusoutput(args.extract_from_config +" --try --config " + args.configserver + ' --key zookeeper | grep . | wc -l') try: if int(out) > 0: args.zookeeper = True @@ -155,7 +155,7 @@ def main(args): args.zookeeper = False if args.shard is None: - code, out = commands.getstatusoutput(args.extract_from_config + " --try --config " + args.configserver + ' --key listen_host | grep -E "127.0.0.2|::"') + code, out = subprocess.getstatusoutput(args.extract_from_config + " --try --config " + args.configserver + ' --key listen_host | grep -E "127.0.0.2|::"') if out: args.shard = True else: @@ -166,7 +166,7 @@ def main(args): failures_total = 0 clickhouse_proc_create = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=PIPE) - clickhouse_proc_create.communicate("CREATE DATABASE IF NOT EXISTS " + args.database) + clickhouse_proc_create.communicate(("CREATE DATABASE IF NOT EXISTS " + args.database).encode()) if args.database != "test": clickhouse_proc_create = Popen(shlex.split(args.client), stdin=PIPE, stdout=PIPE, stderr=PIPE) clickhouse_proc_create.communicate("CREATE DATABASE IF NOT EXISTS test") diff --git a/libs/libcommon/CMakeLists.txt b/libs/libcommon/CMakeLists.txt index 999290996a9..02199c21a4f 100644 --- a/libs/libcommon/CMakeLists.txt +++ b/libs/libcommon/CMakeLists.txt @@ -91,9 +91,13 @@ target_include_directories (common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR}) target_include_directories (common PUBLIC ${COMMON_INCLUDE_DIR}) if (NOT USE_INTERNAL_BOOST_LIBRARY) - target_include_directories (common BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) + target_include_directories (common SYSTEM BEFORE PUBLIC ${Boost_INCLUDE_DIRS}) endif () +if(NOT USE_INTERNAL_POCO_LIBRARY) + target_include_directories (common SYSTEM BEFORE PUBLIC ${Poco_Foundation_INCLUDE_DIR}) +endif() + target_link_libraries (common PUBLIC ${Poco_Foundation_LIBRARY} diff --git a/libs/libdaemon/CMakeLists.txt b/libs/libdaemon/CMakeLists.txt index eb73f1cda33..181030009b0 100644 --- a/libs/libdaemon/CMakeLists.txt +++ b/libs/libdaemon/CMakeLists.txt @@ -22,4 +22,4 @@ endif () target_include_directories (daemon PUBLIC include) -target_link_libraries (daemon PRIVATE clickhouse_common_io clickhouse_common_config common ${Poco_Net_LIBRARY} ${Poco_Util_LIBRARY} ${EXECINFO_LIBRARY} ${ELF_LIBRARY}) +target_link_libraries (daemon PRIVATE clickhouse_common_io clickhouse_common_config common ${Poco_Net_LIBRARY} ${Poco_Util_LIBRARY} ${EXECINFO_LIBRARIES}) From 37df95a437f70b9b2b7f3bb83568013b2230cf68 Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 22 Apr 2019 23:09:14 +0300 Subject: [PATCH 052/194] fix --- libs/libmysqlxx/cmake/find_mysqlclient.cmake | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libs/libmysqlxx/cmake/find_mysqlclient.cmake b/libs/libmysqlxx/cmake/find_mysqlclient.cmake index 71cb2bfeb1d..98b42a0a9b4 100644 --- a/libs/libmysqlxx/cmake/find_mysqlclient.cmake +++ b/libs/libmysqlxx/cmake/find_mysqlclient.cmake @@ -1,17 +1,17 @@ -option (ENABLE_MYSQL "Enable MySQL" ${OS_LINUX}) -if (OS_LINUX) - option (USE_INTERNAL_MYSQL_LIBRARY "Set to FALSE to use system mysqlclient library instead of bundled" ${NOT_UNBUNDLED}) -else () - option (USE_INTERNAL_MYSQL_LIBRARY "Set to FALSE to use system mysqlclient library instead of bundled" OFF) -endif () +option(ENABLE_MYSQL "Enable MySQL" 1) +if(ENABLE_MYSQL) + if(OS_LINUX) + option(USE_INTERNAL_MYSQL_LIBRARY "Set to FALSE to use system mysqlclient library instead of bundled" ${NOT_UNBUNDLED}) + else() + option(USE_INTERNAL_MYSQL_LIBRARY "Set to FALSE to use system mysqlclient library instead of bundled" OFF) + endif() -if (USE_INTERNAL_MYSQL_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c/README.md") - message (WARNING "submodule contrib/mariadb-connector-c is missing. to fix try run: \n git submodule update --init --recursive") - set (USE_INTERNAL_MYSQL_LIBRARY 0) -endif () + if(USE_INTERNAL_MYSQL_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/mariadb-connector-c/README.md") + message(WARNING "submodule contrib/mariadb-connector-c is missing. to fix try run: \n git submodule update --init --recursive") + set(USE_INTERNAL_MYSQL_LIBRARY 0) + endif() -if (ENABLE_MYSQL) if (USE_INTERNAL_MYSQL_LIBRARY) set (MYSQLCLIENT_LIBRARIES mysqlclient) set (USE_MYSQL 1) From e899d7b71f4c898dcc9b804db35ad37c84bbc261 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 23 Apr 2019 15:50:56 +0300 Subject: [PATCH 053/194] fix --- dbms/tests/clickhouse-test | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/tests/clickhouse-test b/dbms/tests/clickhouse-test index f1819d12d9a..7612c415373 100755 --- a/dbms/tests/clickhouse-test +++ b/dbms/tests/clickhouse-test @@ -116,6 +116,7 @@ exit_code = 0 #def run_tests_array(all_tests, suite, suite_dir, suite_tmp_dir, run_total): def run_tests_array(all_tests_with_params): all_tests, suite, suite_dir, suite_tmp_dir, run_total = all_tests_with_params + global exit_code global SERVER_DIED OP_SQUARE_BRACKET = colored("[", args, attrs=['bold']) @@ -393,7 +394,7 @@ def main(args): suite = suite_re_obj.group(1) if os.path.isdir(suite_dir): - if 'stateful' in suite and not is_data_present(): + if 'stateful' in suite and not args.no_stateful and not is_data_present(): print("Won't run stateful tests because test data wasn't loaded.") continue if 'stateless' in suite and args.no_stateless: From 38f5ebf000a50e7e08ffadaff7465cd053b21d77 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 23 Apr 2019 16:58:43 +0300 Subject: [PATCH 054/194] Fix segfault in performance-test when no options specified --- dbms/programs/performance-test/PerformanceTestSuite.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbms/programs/performance-test/PerformanceTestSuite.cpp b/dbms/programs/performance-test/PerformanceTestSuite.cpp index 7a373d7bfba..9daf1b86ce7 100644 --- a/dbms/programs/performance-test/PerformanceTestSuite.cpp +++ b/dbms/programs/performance-test/PerformanceTestSuite.cpp @@ -298,6 +298,8 @@ std::unordered_map> getTestQueryIndexes(co { std::unordered_map> result; const auto & options = parsed_opts.options; + if (options.empty()) + return result; for (size_t i = 0; i < options.size() - 1; ++i) { const auto & opt = options[i]; From 05f615c171a0d4a834ed8174b4ca0e66b5e3d835 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 24 Apr 2019 10:39:53 +0300 Subject: [PATCH 055/194] DOCAPI-3822: ZooKeeper settings. Oracle ODBC issue. --- docs/en/faq/general.md | 9 ++++ .../en/operations/server_settings/settings.md | 47 ++++++++++++++----- .../dicts/external_dicts_dict_sources.md | 2 + 3 files changed, 45 insertions(+), 13 deletions(-) diff --git a/docs/en/faq/general.md b/docs/en/faq/general.md index f5b9d29b5bd..49af0e55588 100644 --- a/docs/en/faq/general.md +++ b/docs/en/faq/general.md @@ -11,5 +11,14 @@ Distributed sorting is one of the main causes of reduced performance when runnin Most MapReduce implementations allow you to execute arbitrary code on a cluster. But a declarative query language is better suited to OLAP in order to run experiments quickly. For example, Hadoop has Hive and Pig. Also consider Cloudera Impala or Shark (outdated) for Spark, as well as Spark SQL, Presto, and Apache Drill. Performance when running such tasks is highly sub-optimal compared to specialized systems, but relatively high latency makes it unrealistic to use these systems as the backend for a web interface. +## What to do if I have a problem with encodings when using Oracle through ODBC? {#oracle-odbc-encodings} + +If you use Oracle through ODBC driver as a source of external dictionaries, you need to set up correctly value for the `NLS_LANG` variable in the `/etc/default/clickhouse`. For more details see the [Oracle NLS_LANG FAQ](https://www.oracle.com/technetwork/products/globalization/nls-lang-099431.html). + +**Example** + +``` +NLS_LANG=RUSSIAN_RUSSIA.UTF8 +``` [Original article](https://clickhouse.yandex/docs/en/faq/general/) diff --git a/docs/en/operations/server_settings/settings.md b/docs/en/operations/server_settings/settings.md index 52503478205..d73c7205293 100644 --- a/docs/en/operations/server_settings/settings.md +++ b/docs/en/operations/server_settings/settings.md @@ -537,7 +537,7 @@ Queries are logged in the [system.query_log](../system_tables.md#system_tables-q Use the following parameters to configure logging: - `database` – Name of the database. -- `table` – Name of the system table the queries will be logged in. +- `table` – Name of the system table the queries will be logged in. - `partition_by` – Sets a [custom partitioning key](../../operations/table_engines/custom_partitioning_key.md) for a system table. - `flush_interval_milliseconds` – Interval for flushing data from the buffer in memory to the table. @@ -664,35 +664,56 @@ Path to the file that contains: ``` -## zookeeper +## zookeeper {#server-settings_zookeeper} -Configuration of ZooKeeper servers. +Contains settings that allow ClickHouse to interact with [ZooKeeper](http://zookeeper.apache.org/) cluster. -ClickHouse uses ZooKeeper for storing replica metadata when using replicated tables. +ClickHouse uses ZooKeeper for storing replicas' metadata when using replicated tables. If replicated tables are not used, this parameter section can be omitted. -This parameter can be omitted if replicated tables are not used. +This parameter section contains the following parameters: -For more information, see the section "[Replication](../../operations/table_engines/replication.md)". +- `node` — ZooKeeper endpoint. You can set a few endpoints. -**Example** + For example: + + ```xml + + example_host + 2181 + + ``` + + The `index` attribute specify an order of node, when trying to connect to ZooKeeper cluster. + +- `session_timeout` — Maximum timeout for client session in milliseconds. +- `root` — ZNode, that is used as root for znodes used by ClickHouse server. Optional. +- `identity` — User and password, required by ZooKeeper to give access to requested znodes. Optional. + +**Example configuration** ```xml - + example1 2181 - + example2 2181 - - example3 - 2181 - + 30000 + + /path/to/zookeeper/node + + user:password ``` +**See Also** + +- [Replication](../../operations/table_engines/replication.md) +- [ZooKeeper Programmer's Guide](http://zookeeper.apache.org/doc/r3.3.4/zookeeperProgrammers.html) + ## use_minimalistic_part_header_in_zookeeper {#server-settings-use_minimalistic_part_header_in_zookeeper} Storage method for data part headers in ZooKeeper. diff --git a/docs/en/query_language/dicts/external_dicts_dict_sources.md b/docs/en/query_language/dicts/external_dicts_dict_sources.md index 8fb2145ecaf..646097d26eb 100644 --- a/docs/en/query_language/dicts/external_dicts_dict_sources.md +++ b/docs/en/query_language/dicts/external_dicts_dict_sources.md @@ -120,6 +120,8 @@ Setting fields: ClickHouse receives quoting symbols from ODBC-driver and quote all settings in queries to driver, so it's necessary to set table name accordingly to table name case in database. +If you have a problems with encodings when using Oracle, see the corresponding [FAQ](../../faq/general.md#oracle-odbc-encodings) article. + ### Known vulnerability of the ODBC dictionary functionality !!! attention From 281fde84149edea6572c64154a3202af89c34259 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 24 Apr 2019 11:30:08 +0300 Subject: [PATCH 056/194] DOCAPI-3822: Added faq article into the chinese version. --- docs/zh/faq/general.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/zh/faq/general.md b/docs/zh/faq/general.md index 9a1aef5dde6..1f0121133f7 100644 --- a/docs/zh/faq/general.md +++ b/docs/zh/faq/general.md @@ -9,4 +9,14 @@ 大多数MapReduce系统允许您在集群上执行任意代码。但是,声明性查询语言更适合OLAP,以便快速运行实验。例如,Hadoop包含Hive和Pig,Cloudera Impala或Shark(过时)for Spark,以及Spark SQL、Presto和Apache Drill。与专业系统相比,运行此类任务时的性能非常不理想,所以将这些系统用作Web接口的后端服务是不现实的,因为延迟相对较高。 +## What to do if I have a problem with encodings when using Oracle through ODBC? {#oracle-odbc-encodings} + +If you use Oracle through ODBC driver as a source of external dictionaries, you need to set up correctly value for the `NLS_LANG` variable in the `/etc/default/clickhouse`. For more details see the [Oracle NLS_LANG FAQ](https://www.oracle.com/technetwork/products/globalization/nls-lang-099431.html). + +**Example** + +``` +NLS_LANG=RUSSIAN_RUSSIA.UTF8 +``` + [来源文章](https://clickhouse.yandex/docs/zh/faq/general/) From 33201fa9a80dbd6f90a207bb1aa66d25fe110037 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Thu, 25 Apr 2019 21:57:43 +0300 Subject: [PATCH 057/194] rev --- dbms/src/Interpreters/Settings.h | 1 + dbms/src/Interpreters/SettingsCommon.h | 6 ++++++ dbms/src/Storages/StorageMergeTree.cpp | 10 ++++++---- dbms/src/Storages/StorageMergeTree.h | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dbms/src/Interpreters/Settings.h b/dbms/src/Interpreters/Settings.h index 20e07d15916..3121389a6db 100644 --- a/dbms/src/Interpreters/Settings.h +++ b/dbms/src/Interpreters/Settings.h @@ -41,6 +41,7 @@ struct Settings M(SettingUInt64, min_insert_block_size_rows, DEFAULT_INSERT_BLOCK_SIZE, "Squash blocks passed to INSERT query to specified size in rows, if blocks are not big enough.") \ M(SettingUInt64, min_insert_block_size_bytes, (DEFAULT_INSERT_BLOCK_SIZE * 256), "Squash blocks passed to INSERT query to specified size in bytes, if blocks are not big enough.") \ M(SettingMaxThreads, max_threads, 0, "The maximum number of threads to execute the request. By default, it is determined automatically.") \ + M(SettingMaxAlterThreads, max_alter_threads, 0, "The maximum number of threads to execute the ALTER requests. By default, it is determined automatically.") \ M(SettingUInt64, max_read_buffer_size, DBMS_DEFAULT_BUFFER_SIZE, "The maximum size of the buffer to read from the filesystem.") \ M(SettingUInt64, max_distributed_connections, 1024, "The maximum number of connections for distributed processing of one query (should be greater than max_threads).") \ M(SettingUInt64, max_query_size, 262144, "Which part of the query can be read into RAM for parsing (the remaining data for INSERT, if any, is read later)") \ diff --git a/dbms/src/Interpreters/SettingsCommon.h b/dbms/src/Interpreters/SettingsCommon.h index ff2c0cd9339..abe6e052fbc 100644 --- a/dbms/src/Interpreters/SettingsCommon.h +++ b/dbms/src/Interpreters/SettingsCommon.h @@ -87,6 +87,12 @@ struct SettingMaxThreads UInt64 getAutoValueImpl() const; }; +struct SettingMaxAlterThreads: public SettingMaxThreads +{ + SettingMaxAlterThreads(UInt64 x = 0): + SettingMaxThreads(x) + {} +}; struct SettingSeconds { diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index a7a618873a8..620afcb0f91 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -194,15 +194,17 @@ void StorageMergeTree::rename(const String & new_path_to_db, const String & /*ne std::vector StorageMergeTree::prepare_alter_transactions( - const ColumnsDescription& new_columns, const IndicesDescription& new_indices, const size_t thread_pool_size) + const ColumnsDescription& new_columns, const IndicesDescription& new_indices, const Context & context) { - ThreadPool thread_pool(thread_pool_size); - auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); std::vector transactions(parts.size()); const auto& columns_for_parts = new_columns.getAllPhysical(); + const Settings & settings = context.getSettingsRef(); + size_t thread_pool_size = std::min(parts.size(), settings.max_alter_threads); + ThreadPool thread_pool(thread_pool_size); + size_t i = 0; for (const auto & part : parts) { @@ -259,7 +261,7 @@ void StorageMergeTree::alter( ASTPtr new_primary_key_ast = data.primary_key_ast; params.apply(new_columns, new_indices, new_order_by_ast, new_primary_key_ast); - auto transactions = prepare_alter_transactions(new_columns, new_indices, 2 * getNumberOfPhysicalCPUCores()); + auto transactions = prepare_alter_transactions(new_columns, new_indices, context); auto table_hard_lock = lockStructureForAlter(context.getCurrentQueryId()); diff --git a/dbms/src/Storages/StorageMergeTree.h b/dbms/src/Storages/StorageMergeTree.h index 36b6cb9fc36..0f34c71213c 100644 --- a/dbms/src/Storages/StorageMergeTree.h +++ b/dbms/src/Storages/StorageMergeTree.h @@ -133,7 +133,7 @@ private: BackgroundProcessingPool::TaskHandle background_task_handle; std::vector prepare_alter_transactions( - const ColumnsDescription& new_columns, const IndicesDescription& new_indices, const size_t thread_pool_size); + const ColumnsDescription& new_columns, const IndicesDescription& new_indices, const Context & context); void loadMutations(); From ba61e16093d460050265bf3d3fbe2d5ed72d9d0f Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Fri, 26 Apr 2019 00:37:57 +0300 Subject: [PATCH 058/194] style --- dbms/src/Storages/StorageMergeTree.cpp | 1 - dbms/src/Storages/StorageMergeTree.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index b88ca230d67..8f610bc7bdb 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include diff --git a/dbms/src/Storages/StorageMergeTree.h b/dbms/src/Storages/StorageMergeTree.h index 54b0c651135..65bf12b0e93 100644 --- a/dbms/src/Storages/StorageMergeTree.h +++ b/dbms/src/Storages/StorageMergeTree.h @@ -132,7 +132,7 @@ private: BackgroundProcessingPool::TaskHandle background_task_handle; std::vector prepareAlterTransactions( - const ColumnsDescription & new_columns, const IndicesDescription& new_indices, const Context & context); + const ColumnsDescription & new_columns, const IndicesDescription & new_indices, const Context & context); void loadMutations(); From cb51558bdfe78c6fd2188cfc191c954d99a6c0d0 Mon Sep 17 00:00:00 2001 From: Ivan Kushnarenko Date: Sat, 27 Apr 2019 11:24:50 +0300 Subject: [PATCH 059/194] check build clang7 splitted --- dbms/src/Storages/StorageMergeTree.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 8f610bc7bdb..40213898b5a 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -197,7 +197,9 @@ void StorageMergeTree::rename(const String & new_path_to_db, const String & /*ne std::vector StorageMergeTree::prepareAlterTransactions( const ColumnsDescription & new_columns, const IndicesDescription & new_indices, const Context & context) { - auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); + auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, + MergeTreeDataPartState::Committed, + MergeTreeDataPartState::Outdated}); std::vector transactions(parts.size()); const auto& columns_for_parts = new_columns.getAllPhysical(); From 40be74ac658bc0c58809ed9c6619ceeced0684d3 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Sat, 27 Apr 2019 18:27:57 +0300 Subject: [PATCH 060/194] refactor --- dbms/src/Core/Settings.h | 2 +- dbms/src/Core/SettingsCommon.h | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/dbms/src/Core/Settings.h b/dbms/src/Core/Settings.h index 34cfaded905..891e2a6e615 100644 --- a/dbms/src/Core/Settings.h +++ b/dbms/src/Core/Settings.h @@ -41,7 +41,7 @@ struct Settings M(SettingUInt64, min_insert_block_size_rows, DEFAULT_INSERT_BLOCK_SIZE, "Squash blocks passed to INSERT query to specified size in rows, if blocks are not big enough.") \ M(SettingUInt64, min_insert_block_size_bytes, (DEFAULT_INSERT_BLOCK_SIZE * 256), "Squash blocks passed to INSERT query to specified size in bytes, if blocks are not big enough.") \ M(SettingMaxThreads, max_threads, 0, "The maximum number of threads to execute the request. By default, it is determined automatically.") \ - M(SettingMaxAlterThreads, max_alter_threads, 0, "The maximum number of threads to execute the ALTER requests. By default, it is determined automatically.") \ + M(SettingMaxThreads, max_alter_threads, 0, "The maximum number of threads to execute the ALTER requests. By default, it is determined automatically.") \ M(SettingUInt64, max_read_buffer_size, DBMS_DEFAULT_BUFFER_SIZE, "The maximum size of the buffer to read from the filesystem.") \ M(SettingUInt64, max_distributed_connections, 1024, "The maximum number of connections for distributed processing of one query (should be greater than max_threads).") \ M(SettingUInt64, max_query_size, 262144, "Which part of the query can be read into RAM for parsing (the remaining data for INSERT, if any, is read later)") \ diff --git a/dbms/src/Core/SettingsCommon.h b/dbms/src/Core/SettingsCommon.h index d992b2d64f0..9f7eb1187c9 100644 --- a/dbms/src/Core/SettingsCommon.h +++ b/dbms/src/Core/SettingsCommon.h @@ -87,13 +87,6 @@ struct SettingMaxThreads UInt64 getAutoValueImpl() const; }; -struct SettingMaxAlterThreads: public SettingMaxThreads -{ - SettingMaxAlterThreads(UInt64 x = 0): - SettingMaxThreads(x) - {} -}; - struct SettingSeconds { Poco::Timespan value; From 26b3910b7dfc2a2ea4e3c29a1cb20c9d8591fc94 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Sat, 27 Apr 2019 20:01:30 +0300 Subject: [PATCH 061/194] tsan debug --- dbms/src/Core/SettingsCommon.h | 1 + dbms/src/Storages/StorageMergeTree.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dbms/src/Core/SettingsCommon.h b/dbms/src/Core/SettingsCommon.h index 9f7eb1187c9..c661cef1570 100644 --- a/dbms/src/Core/SettingsCommon.h +++ b/dbms/src/Core/SettingsCommon.h @@ -87,6 +87,7 @@ struct SettingMaxThreads UInt64 getAutoValueImpl() const; }; + struct SettingSeconds { Poco::Timespan value; diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 40213898b5a..49c07444f7f 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -211,9 +211,13 @@ std::vector StorageMergeTree::prepar size_t i = 0; for (const auto & part : parts) { + auto thread_group = CurrentThread::getGroup(); thread_pool.schedule( - [this, i, &transactions, &part, columns_for_parts, new_indices = new_indices.indices] + [this, i, &transactions, &part, columns_for_parts, thread_group, new_indices = new_indices.indices] { + setThreadName("AlterTransactions"); + if(thread_group) + CurrentThread::attachToIfDetached(thread_group); if (auto transaction = this->data.alterDataPart(part, columns_for_parts, new_indices, false)) transactions[i] = std::move(transaction); } From bdbe97276c7f1599d99b16887190a14233c53db4 Mon Sep 17 00:00:00 2001 From: Ivan Kushnarenko Date: Sat, 27 Apr 2019 23:15:10 +0300 Subject: [PATCH 062/194] remove groups --- dbms/src/Storages/StorageMergeTree.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 49c07444f7f..40213898b5a 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -211,13 +211,9 @@ std::vector StorageMergeTree::prepar size_t i = 0; for (const auto & part : parts) { - auto thread_group = CurrentThread::getGroup(); thread_pool.schedule( - [this, i, &transactions, &part, columns_for_parts, thread_group, new_indices = new_indices.indices] + [this, i, &transactions, &part, columns_for_parts, new_indices = new_indices.indices] { - setThreadName("AlterTransactions"); - if(thread_group) - CurrentThread::attachToIfDetached(thread_group); if (auto transaction = this->data.alterDataPart(part, columns_for_parts, new_indices, false)) transactions[i] = std::move(transaction); } From 0d39968233453b77971c06d9894b5381e2f79378 Mon Sep 17 00:00:00 2001 From: tai Date: Mon, 8 Apr 2019 18:04:26 +0800 Subject: [PATCH 063/194] Suport settings for async(#4852) There is no hash operation on Settings. Because it is less valuable for hash operations. And I dont know how to write a testcase. --- dbms/src/Core/Defines.h | 4 ++ dbms/src/Core/Settings.cpp | 1 - .../Storages/Distributed/DirectoryMonitor.cpp | 39 +++++++++++++++---- .../Storages/Distributed/DirectoryMonitor.h | 4 ++ .../DistributedBlockOutputStream.cpp | 22 ++++++----- .../DistributedBlockOutputStream.h | 6 +-- dbms/src/Storages/StorageDistributed.cpp | 3 +- 7 files changed, 56 insertions(+), 23 deletions(-) diff --git a/dbms/src/Core/Defines.h b/dbms/src/Core/Defines.h index 0a3b384797d..d0738875947 100644 --- a/dbms/src/Core/Defines.h +++ b/dbms/src/Core/Defines.h @@ -123,3 +123,7 @@ #else #define OPTIMIZE(x) #endif + +/// This number is only used for distributed version compatible. +/// It could be any magic number. +#define DBMS_DISTRIBUTED_SENDS_MAGIC_NUMBER 0xCAFECABE diff --git a/dbms/src/Core/Settings.cpp b/dbms/src/Core/Settings.cpp index c09ff38a2d8..bed05855e99 100644 --- a/dbms/src/Core/Settings.cpp +++ b/dbms/src/Core/Settings.cpp @@ -109,5 +109,4 @@ void Settings::addProgramOptions(boost::program_options::options_description & o Settings::getDescriptionByIndex(index).data))); } } - } diff --git a/dbms/src/Storages/Distributed/DirectoryMonitor.cpp b/dbms/src/Storages/Distributed/DirectoryMonitor.cpp index 3cd51d0bf98..ea2365cfd2b 100644 --- a/dbms/src/Storages/Distributed/DirectoryMonitor.cpp +++ b/dbms/src/Storages/Distributed/DirectoryMonitor.cpp @@ -220,10 +220,11 @@ void StorageDistributedDirectoryMonitor::processFile(const std::string & file_pa ReadBufferFromFile in{file_path}; + Settings insert_settings; std::string insert_query; - readStringBinary(insert_query, in); + readQueryAndSettings(in, insert_settings, insert_query); - RemoteBlockOutputStream remote{*connection, insert_query}; + RemoteBlockOutputStream remote{*connection, insert_query, &insert_settings}; remote.writePrefix(); remote.writePrepared(in); @@ -240,20 +241,39 @@ void StorageDistributedDirectoryMonitor::processFile(const std::string & file_pa LOG_TRACE(log, "Finished processing `" << file_path << '`'); } +void StorageDistributedDirectoryMonitor::readQueryAndSettings( + ReadBuffer & in, Settings & insert_settings, std::string & insert_query) const +{ + UInt64 magic_number_or_query_size; + + readVarUInt(magic_number_or_query_size, in); + + if (magic_number_or_query_size == UInt64(DBMS_DISTRIBUTED_SENDS_MAGIC_NUMBER)) + { + insert_settings.deserialize(in); + readVarUInt(magic_number_or_query_size, in); + } + insert_query.resize(magic_number_or_query_size); + in.readStrict(insert_query.data(), magic_number_or_query_size); +} + struct StorageDistributedDirectoryMonitor::BatchHeader { + Settings settings; String query; Block sample_block; - BatchHeader(String query_, Block sample_block_) - : query(std::move(query_)) + BatchHeader(Settings settings_, String query_, Block sample_block_) + : settings(std::move(settings_)) + , query(std::move(query_)) , sample_block(std::move(sample_block_)) { } bool operator==(const BatchHeader & other) const { - return query == other.query && blocksHaveEqualStructure(sample_block, other.sample_block); + return settings == other.settings && query == other.query && + blocksHaveEqualStructure(sample_block, other.sample_block); } struct Hash @@ -320,6 +340,7 @@ struct StorageDistributedDirectoryMonitor::Batch bool batch_broken = false; try { + Settings insert_settings; String insert_query; std::unique_ptr remote; bool first = true; @@ -335,12 +356,12 @@ struct StorageDistributedDirectoryMonitor::Batch } ReadBufferFromFile in(file_path->second); - readStringBinary(insert_query, in); /// NOTE: all files must have the same insert_query + parent.readQueryAndSettings(in, insert_settings, insert_query); if (first) { first = false; - remote = std::make_unique(*connection, insert_query); + remote = std::make_unique(*connection, insert_query, &insert_settings); remote->writePrefix(); } @@ -436,11 +457,13 @@ void StorageDistributedDirectoryMonitor::processFilesWithBatching(const std::map size_t total_rows = 0; size_t total_bytes = 0; Block sample_block; + Settings insert_settings; String insert_query; try { /// Determine metadata of the current file and check if it is not broken. ReadBufferFromFile in{file_path}; + insert_settings.deserialize(in); readStringBinary(insert_query, in); CompressedReadBuffer decompressing_in(in); @@ -468,7 +491,7 @@ void StorageDistributedDirectoryMonitor::processFilesWithBatching(const std::map throw; } - BatchHeader batch_header(std::move(insert_query), std::move(sample_block)); + BatchHeader batch_header(std::move(insert_settings), std::move(insert_query), std::move(sample_block)); Batch & batch = header_to_batch.try_emplace(batch_header, *this, files).first->second; batch.file_indices.push_back(file_idx); diff --git a/dbms/src/Storages/Distributed/DirectoryMonitor.h b/dbms/src/Storages/Distributed/DirectoryMonitor.h index d7858d3af40..2c95947355d 100644 --- a/dbms/src/Storages/Distributed/DirectoryMonitor.h +++ b/dbms/src/Storages/Distributed/DirectoryMonitor.h @@ -7,6 +7,7 @@ #include #include #include +#include namespace DB @@ -57,6 +58,9 @@ private: std::condition_variable cond; Logger * log; ThreadFromGlobalPool thread{&StorageDistributedDirectoryMonitor::run, this}; + + /// Read insert query and insert settings for backward compatible. + void readQueryAndSettings(ReadBuffer & in, Settings & insert_settings, std::string & insert_query) const; }; } diff --git a/dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp b/dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp index 7f47a76a068..836ba20a644 100644 --- a/dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp +++ b/dbms/src/Storages/Distributed/DistributedBlockOutputStream.cpp @@ -59,10 +59,10 @@ namespace ErrorCodes DistributedBlockOutputStream::DistributedBlockOutputStream( - StorageDistributed & storage, const ASTPtr & query_ast, const ClusterPtr & cluster_, - const Settings & settings_, bool insert_sync_, UInt64 insert_timeout_) - : storage(storage), query_ast(query_ast), query_string(queryToString(query_ast)), - cluster(cluster_), settings(settings_), insert_sync(insert_sync_), + const Context & context_, StorageDistributed & storage, const ASTPtr & query_ast, const ClusterPtr & cluster_, + bool insert_sync_, UInt64 insert_timeout_) + : context(context_), storage(storage), query_ast(query_ast), query_string(queryToString(query_ast)), + cluster(cluster_), insert_sync(insert_sync_), insert_timeout(insert_timeout_), log(&Logger::get("DistributedBlockOutputStream")) { } @@ -249,7 +249,7 @@ ThreadPool::Job DistributedBlockOutputStream::runWritingJob(DistributedBlockOutp throw Exception("There are several writing job for an automatically replicated shard", ErrorCodes::LOGICAL_ERROR); /// TODO: it make sense to rewrite skip_unavailable_shards and max_parallel_replicas here - auto connections = shard_info.pool->getMany(&settings, PoolMode::GET_ONE); + auto connections = shard_info.pool->getMany(&context.getSettingsRef(), PoolMode::GET_ONE); if (connections.empty() || connections.front().isNull()) throw Exception("Expected exactly one connection for shard " + toString(job.shard_index), ErrorCodes::LOGICAL_ERROR); @@ -263,7 +263,7 @@ ThreadPool::Job DistributedBlockOutputStream::runWritingJob(DistributedBlockOutp if (!connection_pool) throw Exception("Connection pool for replica " + replica.readableString() + " does not exist", ErrorCodes::LOGICAL_ERROR); - job.connection_entry = connection_pool->get(&settings); + job.connection_entry = connection_pool->get(&context.getSettingsRef()); if (job.connection_entry.isNull()) throw Exception("Got empty connection for replica" + replica.readableString(), ErrorCodes::LOGICAL_ERROR); } @@ -271,7 +271,7 @@ ThreadPool::Job DistributedBlockOutputStream::runWritingJob(DistributedBlockOutp if (throttler) job.connection_entry->setThrottler(throttler); - job.stream = std::make_shared(*job.connection_entry, query_string, &settings); + job.stream = std::make_shared(*job.connection_entry, query_string, &context.getSettingsRef()); job.stream->writePrefix(); } @@ -283,8 +283,7 @@ ThreadPool::Job DistributedBlockOutputStream::runWritingJob(DistributedBlockOutp if (!job.stream) { /// Forward user settings - job.local_context = std::make_unique(storage.global_context); - job.local_context->setSettings(settings); + job.local_context = std::make_unique(context); InterpreterInsertQuery interp(query_ast, *job.local_context); job.stream = interp.execute().out; @@ -304,6 +303,7 @@ ThreadPool::Job DistributedBlockOutputStream::runWritingJob(DistributedBlockOutp void DistributedBlockOutputStream::writeSync(const Block & block) { + const Settings & settings = context.getSettingsRef(); const auto & shards_info = cluster->getShardsInfo(); size_t num_shards = shards_info.size(); @@ -504,7 +504,7 @@ void DistributedBlockOutputStream::writeAsyncImpl(const Block & block, const siz void DistributedBlockOutputStream::writeToLocal(const Block & block, const size_t repeats) { /// Async insert does not support settings forwarding yet whereas sync one supports - InterpreterInsertQuery interp(query_ast, storage.global_context); + InterpreterInsertQuery interp(query_ast, context); auto block_io = interp.execute(); block_io.out->writePrefix(); @@ -553,6 +553,8 @@ void DistributedBlockOutputStream::writeToShard(const Block & block, const std:: CompressedWriteBuffer compress{out}; NativeBlockOutputStream stream{compress, ClickHouseRevision::get(), block.cloneEmpty()}; + writeVarUInt(UInt64(DBMS_DISTRIBUTED_SENDS_MAGIC_NUMBER), out); + context.getSettingsRef().serialize(out); writeStringBinary(query_string, out); stream.writePrefix(); diff --git a/dbms/src/Storages/Distributed/DistributedBlockOutputStream.h b/dbms/src/Storages/Distributed/DistributedBlockOutputStream.h index de802a09483..f71585b8026 100644 --- a/dbms/src/Storages/Distributed/DistributedBlockOutputStream.h +++ b/dbms/src/Storages/Distributed/DistributedBlockOutputStream.h @@ -35,8 +35,8 @@ class StorageDistributed; class DistributedBlockOutputStream : public IBlockOutputStream { public: - DistributedBlockOutputStream(StorageDistributed & storage, const ASTPtr & query_ast, const ClusterPtr & cluster_, - const Settings & settings_, bool insert_sync_, UInt64 insert_timeout_); + DistributedBlockOutputStream(const Context & context_, StorageDistributed & storage, const ASTPtr & query_ast, + const ClusterPtr & cluster_, bool insert_sync_, UInt64 insert_timeout_); Block getHeader() const override; void write(const Block & block) override; @@ -78,11 +78,11 @@ private: std::string getCurrentStateDescription(); private: + const Context & context; StorageDistributed & storage; ASTPtr query_ast; String query_string; ClusterPtr cluster; - const Settings & settings; size_t inserted_blocks = 0; size_t inserted_rows = 0; diff --git a/dbms/src/Storages/StorageDistributed.cpp b/dbms/src/Storages/StorageDistributed.cpp index aa140903496..174c5bea72a 100644 --- a/dbms/src/Storages/StorageDistributed.cpp +++ b/dbms/src/Storages/StorageDistributed.cpp @@ -333,7 +333,8 @@ BlockOutputStreamPtr StorageDistributed::write(const ASTPtr &, const Context & c /// DistributedBlockOutputStream will not own cluster, but will own ConnectionPools of the cluster return std::make_shared( - *this, createInsertToRemoteTableQuery(remote_database, remote_table, getSampleBlock()), cluster, settings, insert_sync, timeout); + context, *this, createInsertToRemoteTableQuery(remote_database, remote_table, getSampleBlock()), cluster, + insert_sync, timeout); } From b394a79af39dcca1bafcbdf226f484fc9abc06b7 Mon Sep 17 00:00:00 2001 From: tai Date: Mon, 29 Apr 2019 14:50:06 +0800 Subject: [PATCH 064/194] try fix batch async insert settings for Distributed --- dbms/src/Storages/Distributed/DirectoryMonitor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dbms/src/Storages/Distributed/DirectoryMonitor.cpp b/dbms/src/Storages/Distributed/DirectoryMonitor.cpp index ea2365cfd2b..2500b519b23 100644 --- a/dbms/src/Storages/Distributed/DirectoryMonitor.cpp +++ b/dbms/src/Storages/Distributed/DirectoryMonitor.cpp @@ -463,8 +463,7 @@ void StorageDistributedDirectoryMonitor::processFilesWithBatching(const std::map { /// Determine metadata of the current file and check if it is not broken. ReadBufferFromFile in{file_path}; - insert_settings.deserialize(in); - readStringBinary(insert_query, in); + readQueryAndSettings(in, insert_settings, insert_query); CompressedReadBuffer decompressing_in(in); NativeBlockInputStream block_in(decompressing_in, ClickHouseRevision::get()); From acbeedad3856447262c8ce7f21b9aa9a61e56cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=81=A5?= Date: Tue, 30 Apr 2019 11:50:30 +0800 Subject: [PATCH 065/194] Fix null problem in FunctionIn --- dbms/src/Functions/in.cpp | 5 ----- .../queries/0_stateless/00939_test_null_in.reference | 9 +++++++++ dbms/tests/queries/0_stateless/00939_test_null_in.sql | 11 +++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00939_test_null_in.reference create mode 100644 dbms/tests/queries/0_stateless/00939_test_null_in.sql diff --git a/dbms/src/Functions/in.cpp b/dbms/src/Functions/in.cpp index 9267a42082c..c7c6a1f6c15 100644 --- a/dbms/src/Functions/in.cpp +++ b/dbms/src/Functions/in.cpp @@ -73,11 +73,6 @@ public: return std::make_shared(); } - bool useDefaultImplementationForNulls() const override - { - return false; - } - void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override { /// Second argument must be ColumnSet. diff --git a/dbms/tests/queries/0_stateless/00939_test_null_in.reference b/dbms/tests/queries/0_stateless/00939_test_null_in.reference new file mode 100644 index 00000000000..4e012f99783 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00939_test_null_in.reference @@ -0,0 +1,9 @@ +1 +\N +\N +1 +\N +\N +1 +\N +\N diff --git a/dbms/tests/queries/0_stateless/00939_test_null_in.sql b/dbms/tests/queries/0_stateless/00939_test_null_in.sql new file mode 100644 index 00000000000..973ba13be5e --- /dev/null +++ b/dbms/tests/queries/0_stateless/00939_test_null_in.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS test.nullt; + +CREATE TABLE test.nullt (c1 Nullable(UInt32), c2 Nullable(String))ENGINE = Log; +INSERT INTO test.nullt VALUES (1, 'abc'), (2, NULL), (NULL, NULL); + +SELECT c2 = ('abc') FROM test.nullt; +SELECT c2 IN ('abc') FROM test.nullt; + +SELECT c2 IN ('abc', NULL) FROM test.nullt; + +DROP TABLE IF EXISTS test.nullt; From 35471f423410d5466ece25470dde4ab1ac604c26 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 30 Apr 2019 20:26:56 +0300 Subject: [PATCH 066/194] Update in.cpp --- dbms/src/Functions/in.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Functions/in.cpp b/dbms/src/Functions/in.cpp index c7c6a1f6c15..2911f743538 100644 --- a/dbms/src/Functions/in.cpp +++ b/dbms/src/Functions/in.cpp @@ -84,7 +84,7 @@ public: Block block_of_key_columns; - /// First argument may be tuple or single column. + /// First argument may be a tuple or a single column. const ColumnWithTypeAndName & left_arg = block.getByPosition(arguments[0]); const ColumnTuple * tuple = typeid_cast(left_arg.column.get()); const ColumnConst * const_tuple = checkAndGetColumnConst(left_arg.column.get()); From e38f6e08d838eb68e5233c83e0cc857f1413963c Mon Sep 17 00:00:00 2001 From: Ivan Kushnarenko Date: Wed, 1 May 2019 02:46:19 +0300 Subject: [PATCH 067/194] debug tsan refactor trash --- dbms/src/Storages/MergeTree/MergeTreeData.cpp | 31 ++++++++++++++----- dbms/src/Storages/MergeTree/MergeTreeData.h | 21 ++++++------- .../ReplicatedMergeTreeAlterThread.cpp | 5 +-- dbms/src/Storages/StorageMergeTree.cpp | 24 +++++--------- .../Storages/StorageReplicatedMergeTree.cpp | 5 +-- 5 files changed, 47 insertions(+), 39 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.cpp b/dbms/src/Storages/MergeTree/MergeTreeData.cpp index 453f680c6ba..61e9c97b6a6 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeData.cpp @@ -1435,14 +1435,14 @@ void MergeTreeData::createConvertExpression(const DataPartPtr & part, const Name } } -MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart( - const DataPartPtr & part, +void MergeTreeData::alterDataPart( const NamesAndTypesList & new_columns, const IndicesASTs & new_indices, - bool skip_sanity_checks) + bool skip_sanity_checks, + AlterDataPartTransactionPtr& transaction) { ExpressionActionsPtr expression; - AlterDataPartTransactionPtr transaction(new AlterDataPartTransaction(part)); /// Blocks changes to the part. + const auto& part = transaction->getDataPart(); bool force_update_metadata; createConvertExpression(part, part->columns, new_columns, getIndicesDescription().indices, new_indices, @@ -1504,7 +1504,7 @@ MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart( if (transaction->rename_map.empty() && !force_update_metadata) { transaction->clear(); - return nullptr; + return; } /// Apply the expression and write the result to temporary files. @@ -1573,7 +1573,7 @@ MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart( transaction->rename_map["columns.txt.tmp"] = "columns.txt"; } - return transaction; + return; } void MergeTreeData::removeEmptyColumnsFromPart(MergeTreeData::MutableDataPartPtr & data_part) @@ -1596,9 +1596,11 @@ void MergeTreeData::removeEmptyColumnsFromPart(MergeTreeData::MutableDataPartPtr } LOG_INFO(log, "Removing empty columns: " << log_message.str() << " from part " << data_part->name); - - if (auto transaction = alterDataPart(data_part, new_columns, getIndicesDescription().indices, false)) + AlterDataPartTransactionPtr transaction(new AlterDataPartTransaction(data_part)); + alterDataPart(new_columns, getIndicesDescription().indices, false, transaction); + if (transaction->isValid()) transaction->commit(); + empty_columns.clear(); } @@ -1607,10 +1609,21 @@ void MergeTreeData::freezeAll(const String & with_name, const Context & context) freezePartitionsByMatcher([] (const DataPartPtr &){ return true; }, with_name, context); } +bool MergeTreeData::AlterDataPartTransaction::isValid() const +{ + return data_part != nullptr; +} + +void MergeTreeData::AlterDataPartTransaction::clear() +{ + data_part = nullptr; +} + void MergeTreeData::AlterDataPartTransaction::commit() { if (!data_part) return; + try { std::unique_lock lock(data_part->columns_lock); @@ -1668,6 +1681,8 @@ void MergeTreeData::AlterDataPartTransaction::commit() MergeTreeData::AlterDataPartTransaction::~AlterDataPartTransaction() { + alter_lock.unlock(); + try { if (!data_part) diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.h b/dbms/src/Storages/MergeTree/MergeTreeData.h index 34ad47cbaba..6e7ab4b47c0 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.h +++ b/dbms/src/Storages/MergeTree/MergeTreeData.h @@ -227,16 +227,13 @@ public: const NamesAndTypesList & getNewColumns() const { return new_columns; } const DataPart::Checksums & getNewChecksums() const { return new_checksums; } + AlterDataPartTransaction(DataPartPtr data_part_) : data_part(data_part_), alter_lock(data_part->alter_mutex) {} + const DataPartPtr& getDataPart() const { return data_part; } + bool isValid() const; + private: friend class MergeTreeData; - - AlterDataPartTransaction(DataPartPtr data_part_) : data_part(data_part_), alter_lock(data_part->alter_mutex) {} - - void clear() - { - alter_lock.unlock(); - data_part = nullptr; - } + void clear(); DataPartPtr data_part; DataPartsLock alter_lock; @@ -515,11 +512,13 @@ public: /// Returns an object allowing to rename temporary files to permanent files. /// If the number of affected columns is suspiciously high and skip_sanity_checks is false, throws an exception. /// If no data transformations are necessary, returns nullptr. - AlterDataPartTransactionPtr alterDataPart( - const DataPartPtr & part, +// AlterDataPartTransactionPtr + void alterDataPart( +// const DataPartPtr & part, const NamesAndTypesList & new_columns, const IndicesASTs & new_indices, - bool skip_sanity_checks); + bool skip_sanity_checks, + AlterDataPartTransactionPtr& transaction); /// Remove columns, that have been markedd as empty after zeroing values with expired ttl void removeEmptyColumnsFromPart(MergeTreeData::MutableDataPartPtr & data_part); diff --git a/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp b/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp index 1b1c43e1cd1..17c4f97334a 100644 --- a/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp +++ b/dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp @@ -150,8 +150,9 @@ void ReplicatedMergeTreeAlterThread::run() /// Update the part and write result to temporary files. /// TODO: You can skip checking for too large changes if ZooKeeper has, for example, /// node /flags/force_alter. - auto transaction = storage.data.alterDataPart(part, columns_for_parts, indices_for_parts.indices, false); - if (!transaction) + MergeTreeData::AlterDataPartTransactionPtr transaction(new MergeTreeData::AlterDataPartTransaction(part)); + storage.data.alterDataPart(columns_for_parts, indices_for_parts.indices, false, transaction); + if (!transaction->isValid()) continue; storage.updatePartHeaderInZooKeeperAndCommit(zookeeper, *transaction); diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 40213898b5a..94219d15504 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -200,7 +200,8 @@ std::vector StorageMergeTree::prepar auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); - std::vector transactions(parts.size()); + std::vector transactions; + transactions.reserve(parts.size()); const auto& columns_for_parts = new_columns.getAllPhysical(); @@ -208,29 +209,18 @@ std::vector StorageMergeTree::prepar size_t thread_pool_size = std::min(parts.size(), settings.max_alter_threads); ThreadPool thread_pool(thread_pool_size); - size_t i = 0; for (const auto & part : parts) { + transactions.push_back(MergeTreeData::AlterDataPartTransactionPtr(new MergeTreeData::AlterDataPartTransaction(part))); thread_pool.schedule( - [this, i, &transactions, &part, columns_for_parts, new_indices = new_indices.indices] + [this, &transaction = transactions.back(), columns_for_parts, new_indices = new_indices.indices] { - if (auto transaction = this->data.alterDataPart(part, columns_for_parts, new_indices, false)) - transactions[i] = std::move(transaction); + this->data.alterDataPart(columns_for_parts, new_indices, false, transaction); } ); - - ++i; } thread_pool.wait(); - auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), - [](const MergeTreeData::AlterDataPartTransactionPtr & transaction) - { - return transaction == nullptr; - } - ); - transactions.erase(erase_pos, transactions.end()); - return transactions; } @@ -846,7 +836,9 @@ void StorageMergeTree::clearColumnInPartition(const ASTPtr & partition, const Fi if (part->info.partition_id != partition_id) throw Exception("Unexpected partition ID " + part->info.partition_id + ". This is a bug.", ErrorCodes::LOGICAL_ERROR); - if (auto transaction = data.alterDataPart(part, columns_for_parts, new_indices.indices, false)) + MergeTreeData::AlterDataPartTransactionPtr transaction(new MergeTreeData::AlterDataPartTransaction(part)); + data.alterDataPart(columns_for_parts, new_indices.indices, false, transaction); + if (transaction->isValid()) transactions.push_back(std::move(transaction)); LOG_DEBUG(log, "Removing column " << get(column_name) << " from part " << part->name); diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index 19751e112d7..515459814aa 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -1535,8 +1535,9 @@ void StorageReplicatedMergeTree::executeClearColumnInPartition(const LogEntry & LOG_DEBUG(log, "Clearing column " << entry.column_name << " in part " << part->name); - auto transaction = data.alterDataPart(part, columns_for_parts, new_indices.indices, false); - if (!transaction) + MergeTreeData::AlterDataPartTransactionPtr transaction(new MergeTreeData::AlterDataPartTransaction(part)); + data.alterDataPart(columns_for_parts, new_indices.indices, false, transaction); + if (!transaction->isValid()) continue; updatePartHeaderInZooKeeperAndCommit(zookeeper, *transaction); From 4a3a1fc6d9be6199db01a9977da3e255329d5820 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Wed, 1 May 2019 15:43:43 +0300 Subject: [PATCH 068/194] return transactions cleaning --- dbms/src/Storages/MergeTree/MergeTreeData.h | 2 -- dbms/src/Storages/StorageMergeTree.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.h b/dbms/src/Storages/MergeTree/MergeTreeData.h index 6e7ab4b47c0..b286f1cb863 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.h +++ b/dbms/src/Storages/MergeTree/MergeTreeData.h @@ -512,9 +512,7 @@ public: /// Returns an object allowing to rename temporary files to permanent files. /// If the number of affected columns is suspiciously high and skip_sanity_checks is false, throws an exception. /// If no data transformations are necessary, returns nullptr. -// AlterDataPartTransactionPtr void alterDataPart( -// const DataPartPtr & part, const NamesAndTypesList & new_columns, const IndicesASTs & new_indices, bool skip_sanity_checks, diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 94219d15504..a1781d63316 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -221,6 +221,14 @@ std::vector StorageMergeTree::prepar } thread_pool.wait(); + auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), + [](const MergeTreeData::AlterDataPartTransactionPtr & transaction) + { + return !transaction->isValid(); + } + ); + transactions.erase(erase_pos, transactions.end()); + return transactions; } From 6ac5aa5e49c7841792af0f0eb1178b86da44e97d Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Wed, 1 May 2019 18:46:17 +0300 Subject: [PATCH 069/194] restart performance --- dbms/src/Storages/MergeTree/MergeTreeData.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.cpp b/dbms/src/Storages/MergeTree/MergeTreeData.cpp index 61e9c97b6a6..3a91f73ea9b 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeData.cpp @@ -1609,6 +1609,7 @@ void MergeTreeData::freezeAll(const String & with_name, const Context & context) freezePartitionsByMatcher([] (const DataPartPtr &){ return true; }, with_name, context); } + bool MergeTreeData::AlterDataPartTransaction::isValid() const { return data_part != nullptr; From 591325468b98545415b7d81504d5f1e00e25e306 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Thu, 2 May 2019 14:54:34 +0300 Subject: [PATCH 070/194] make_unique --- dbms/src/Storages/StorageMergeTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index a1781d63316..bb14725f781 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -211,7 +211,7 @@ std::vector StorageMergeTree::prepar for (const auto & part : parts) { - transactions.push_back(MergeTreeData::AlterDataPartTransactionPtr(new MergeTreeData::AlterDataPartTransaction(part))); + transactions.push_back(std::make_unique(part)); thread_pool.schedule( [this, &transaction = transactions.back(), columns_for_parts, new_indices = new_indices.indices] { From 3ecb66d96501a95ffb87d088bf0415371a11c249 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Thu, 2 May 2019 16:42:09 +0300 Subject: [PATCH 071/194] debug stress address --- dbms/src/Storages/MergeTree/MergeTreeData.cpp | 15 +++++++++------ dbms/src/Storages/MergeTree/MergeTreeData.h | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.cpp b/dbms/src/Storages/MergeTree/MergeTreeData.cpp index 3a91f73ea9b..bb773ee2b0b 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeData.cpp @@ -1612,16 +1612,18 @@ void MergeTreeData::freezeAll(const String & with_name, const Context & context) bool MergeTreeData::AlterDataPartTransaction::isValid() const { - return data_part != nullptr; + return valid && data_part; } void MergeTreeData::AlterDataPartTransaction::clear() { - data_part = nullptr; + valid = false; } void MergeTreeData::AlterDataPartTransaction::commit() { + if (!isValid()) + return; if (!data_part) return; @@ -1682,13 +1684,14 @@ void MergeTreeData::AlterDataPartTransaction::commit() MergeTreeData::AlterDataPartTransaction::~AlterDataPartTransaction() { - alter_lock.unlock(); + + if (!isValid()) + return; + if (!data_part) + return; try { - if (!data_part) - return; - LOG_WARNING(data_part->storage.log, "Aborting ALTER of part " << data_part->relative_path); String path = data_part->getFullPath(); diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.h b/dbms/src/Storages/MergeTree/MergeTreeData.h index b286f1cb863..46351fe4dc4 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.h +++ b/dbms/src/Storages/MergeTree/MergeTreeData.h @@ -235,6 +235,9 @@ public: friend class MergeTreeData; void clear(); + bool valid = true; + + //don't interchange order of data_part & alter_lock DataPartPtr data_part; DataPartsLock alter_lock; From ea82760463b790591e45cfe085b7fedcac2b1546 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Thu, 2 May 2019 18:12:57 +0300 Subject: [PATCH 072/194] add reset --- dbms/src/Storages/StorageMergeTree.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index bb14725f781..522a9517996 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -290,7 +290,10 @@ void StorageMergeTree::alter( data.setTTLExpressions(new_columns.getColumnTTLs(), new_ttl_table_ast); for (auto & transaction : transactions) + { transaction->commit(); + transaction.reset(); + } /// Columns sizes could be changed data.recalculateColumnSizes(); @@ -856,7 +859,10 @@ void StorageMergeTree::clearColumnInPartition(const ASTPtr & partition, const Fi return; for (auto & transaction : transactions) + { transaction->commit(); + transaction.reset(); + } /// Recalculate columns size (not only for the modified column) data.recalculateColumnSizes(); From d555a165a4ddf3b126e685d68a9215931924bdbd Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Thu, 2 May 2019 21:48:38 +0300 Subject: [PATCH 073/194] debug stress address --- dbms/src/Storages/StorageMergeTree.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 522a9517996..9611793cb6c 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -200,6 +200,7 @@ std::vector StorageMergeTree::prepar auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); + //std::vector transactions(parts.size()); std::vector transactions; transactions.reserve(parts.size()); @@ -209,13 +210,16 @@ std::vector StorageMergeTree::prepar size_t thread_pool_size = std::min(parts.size(), settings.max_alter_threads); ThreadPool thread_pool(thread_pool_size); + for (const auto & part : parts) - { transactions.push_back(std::make_unique(part)); + + for(size_t i = 0; i < parts.size(); ++i) + { thread_pool.schedule( - [this, &transaction = transactions.back(), columns_for_parts, new_indices = new_indices.indices] + [this, i, &transactions, &columns_for_parts, &new_indices = new_indices.indices] { - this->data.alterDataPart(columns_for_parts, new_indices, false, transaction); + this->data.alterDataPart(columns_for_parts, new_indices, false, transactions[i]); } ); } From abfb681a04c59d0157ba8ce18da884a22caf6489 Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Fri, 3 May 2019 00:43:24 +0300 Subject: [PATCH 074/194] hz --- dbms/src/Storages/StorageMergeTree.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 9611793cb6c..347b2d3245a 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -200,7 +200,6 @@ std::vector StorageMergeTree::prepar auto parts = data.getDataParts({MergeTreeDataPartState::PreCommitted, MergeTreeDataPartState::Committed, MergeTreeDataPartState::Outdated}); - //std::vector transactions(parts.size()); std::vector transactions; transactions.reserve(parts.size()); @@ -210,11 +209,10 @@ std::vector StorageMergeTree::prepar size_t thread_pool_size = std::min(parts.size(), settings.max_alter_threads); ThreadPool thread_pool(thread_pool_size); - - for (const auto & part : parts) + /*for (const auto & part : parts) transactions.push_back(std::make_unique(part)); - for(size_t i = 0; i < parts.size(); ++i) + for (size_t i = 0; i < parts.size(); ++i) { thread_pool.schedule( [this, i, &transactions, &columns_for_parts, &new_indices = new_indices.indices] @@ -222,17 +220,30 @@ std::vector StorageMergeTree::prepar this->data.alterDataPart(columns_for_parts, new_indices, false, transactions[i]); } ); + }*/ + + for (const auto & part : parts) + { + transactions.push_back(std::make_unique(part)); + + thread_pool.schedule( + [this, &transaction = transactions.back(), columns_for_parts, new_indices = new_indices.indices] + { + this->data.alterDataPart(columns_for_parts, new_indices, false, transaction); + } + ); } + thread_pool.wait(); - auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), + /*auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), [](const MergeTreeData::AlterDataPartTransactionPtr & transaction) { return !transaction->isValid(); } ); transactions.erase(erase_pos, transactions.end()); - + */ return transactions; } From f613c06c479f234d7894ef5cfe83a81317fc5c50 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Sun, 5 May 2019 23:48:46 +0300 Subject: [PATCH 075/194] ngram vector_vector distance added --- .../Functions/FunctionsStringSimilarity.cpp | 137 +++++-- .../src/Functions/FunctionsStringSimilarity.h | 29 +- dbms/tests/performance/ngram_distance.xml | 5 +- .../00909_ngram_distance.reference | 346 ++++++++++++++++++ .../0_stateless/00909_ngram_distance.sql | 74 ++++ 5 files changed, 554 insertions(+), 37 deletions(-) diff --git a/dbms/src/Functions/FunctionsStringSimilarity.cpp b/dbms/src/Functions/FunctionsStringSimilarity.cpp index 255301c00ed..d640cbf27e4 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.cpp +++ b/dbms/src/Functions/FunctionsStringSimilarity.cpp @@ -164,43 +164,46 @@ struct NgramDistanceImpl return num; } + template static ALWAYS_INLINE inline size_t calculateNeedleStats( const char * data, const size_t size, NgramStats & ngram_stats, + [[maybe_unused]] UInt16 * ngram_storage, size_t (*read_code_points)(CodePoint *, const char *&, const char *), UInt16 (*hash_functor)(const CodePoint *)) { - // To prevent size_t overflow below. - if (size < N) - return 0; - const char * start = data; const char * end = data + size; CodePoint cp[simultaneously_codepoints_num] = {}; - /// read_code_points returns the position of cp where it stopped reading codepoints. size_t found = read_code_points(cp, start, end); /// We need to start for the first time here, because first N - 1 codepoints mean nothing. size_t i = N - 1; - /// Initialize with this value because for the first time `found` does not initialize first N - 1 codepoints. - size_t len = -N + 1; + size_t len = 0; do { - len += found - N + 1; for (; i + N <= found; ++i) - ++ngram_stats[hash_functor(cp + i)]; + { + ++len; + UInt16 hash = hash_functor(cp + i); + if constexpr (SaveNgrams) + *ngram_storage++ = hash; + ++ngram_stats[hash]; + } i = 0; } while (start < end && (found = read_code_points(cp, start, end))); return len; } + template static ALWAYS_INLINE inline UInt64 calculateHaystackStatsAndMetric( const char * data, const size_t size, NgramStats & ngram_stats, size_t & distance, + [[maybe_unused]] UInt16 * ngram_storage, size_t (*read_code_points)(CodePoint *, const char *&, const char *), UInt16 (*hash_functor)(const CodePoint *)) { @@ -209,18 +212,6 @@ struct NgramDistanceImpl const char * end = data + size; CodePoint cp[simultaneously_codepoints_num] = {}; - /// allocation tricks, most strings are relatively small - static constexpr size_t small_buffer_size = 256; - std::unique_ptr big_buffer; - UInt16 small_buffer[small_buffer_size]; - UInt16 * ngram_storage = small_buffer; - - if (size > small_buffer_size) - { - ngram_storage = new UInt16[size]; - big_buffer.reset(ngram_storage); - } - /// read_code_points returns the position of cp where it stopped reading codepoints. size_t found = read_code_points(cp, start, end); /// We need to start for the first time here, because first N - 1 codepoints mean nothing. @@ -235,21 +226,25 @@ struct NgramDistanceImpl --distance; else ++distance; - - ngram_storage[ngram_cnt++] = hash; + if constexpr (ReuseStats) + ngram_storage[ngram_cnt] = hash; + ++ngram_cnt; --ngram_stats[hash]; } iter = 0; } while (start < end && (found = read_code_points(cp, start, end))); /// Return the state of hash map to its initial. - for (size_t i = 0; i < ngram_cnt; ++i) - ++ngram_stats[ngram_storage[i]]; + if constexpr (ReuseStats) + { + for (size_t i = 0; i < ngram_cnt; ++i) + ++ngram_stats[ngram_storage[i]]; + } return ngram_cnt; } template - static inline size_t dispatchSearcher(Callback callback, Args &&... args) + static inline auto dispatchSearcher(Callback callback, Args &&... args) { if constexpr (!UTF8) return callback(std::forward(args)..., readASCIICodePoints, ASCIIHash); @@ -268,11 +263,11 @@ struct NgramDistanceImpl needle.resize(needle_size + default_padding); data.resize(data_size + default_padding); - size_t second_size = dispatchSearcher(calculateNeedleStats, needle.data(), needle_size, common_stats); + size_t second_size = dispatchSearcher(calculateNeedleStats, needle.data(), needle_size, common_stats, nullptr); size_t distance = second_size; if (data_size <= max_string_size) { - size_t first_size = dispatchSearcher(calculateHaystackStatsAndMetric, data.data(), data_size, common_stats, distance); + size_t first_size = dispatchSearcher(calculateHaystackStatsAndMetric, data.data(), data_size, common_stats, distance, nullptr); res = distance * 1.f / std::max(first_size + second_size, size_t(1)); } else @@ -281,18 +276,94 @@ struct NgramDistanceImpl } } + static void vector_vector( + const ColumnString::Chars & haystack_data, + const ColumnString::Offsets & haystack_offsets, + const ColumnString::Chars & needle_data, + const ColumnString::Offsets & needle_offsets, + PaddedPODArray & res) + { + const size_t haystack_offsets_size = haystack_offsets.size(); + size_t prev_haystack_offset = 0; + size_t prev_needle_offset = 0; + + NgramStats common_stats; + memset(common_stats, 0, sizeof(common_stats)); + + /// The main motivation is to not allocate more on stack because we have already allocated a lot (128Kb). + /// And we can reuse these storages in one thread because we care only about what was written to first places. + std::unique_ptr needle_ngram_storage; + std::unique_ptr haystack_ngram_storage; + needle_ngram_storage.reset(new UInt16[max_string_size]); + haystack_ngram_storage.reset(new UInt16[max_string_size]); + + for (size_t i = 0; i < haystack_offsets_size; ++i) + { + const char * haystack = reinterpret_cast(&haystack_data[prev_haystack_offset]); + const size_t haystack_size = haystack_offsets[i] - prev_haystack_offset - 1; + const char * needle = reinterpret_cast(&needle_data[prev_needle_offset]); + const size_t needle_size = needle_offsets[i] - prev_needle_offset - 1; + + if (needle_size <= max_string_size && haystack_size <= max_string_size) + { + /// Get needle stats. + const size_t needle_stats_size = dispatchSearcher( + calculateNeedleStats, + needle, + needle_size, + common_stats, + needle_ngram_storage.get()); + + size_t distance = needle_stats_size; + + /// Combine with haystack stats, return to initial needle stats. + const size_t haystack_stats_size = dispatchSearcher( + calculateHaystackStatsAndMetric, + haystack, + haystack_size, + common_stats, + distance, + haystack_ngram_storage.get()); + + /// Return to zero array stats. + for (size_t j = 0; j < needle_stats_size; ++j) + --common_stats[needle_ngram_storage[j]]; + + /// For now, common stats is a zero array. + res[i] = distance * 1.f / std::max(haystack_stats_size + needle_stats_size, size_t(1)); + } + else + { + /// String are too big, we are assuming they are not the same. This is done because of limiting number + /// of bigrams added and not allocating too much memory. + res[i] = 1.f; + } + + prev_needle_offset = needle_offsets[i]; + prev_haystack_offset = haystack_offsets[i]; + } + } + static void vector_constant( - const ColumnString::Chars & data, const ColumnString::Offsets & offsets, std::string needle, PaddedPODArray & res) + const ColumnString::Chars & data, + const ColumnString::Offsets & offsets, + std::string needle, + PaddedPODArray & res) { /// zeroing our map NgramStats common_stats; memset(common_stats, 0, sizeof(common_stats)); + /// The main motivation is to not allocate more on stack because we have already allocated a lot (128Kb). + /// And we can reuse these storages in one thread because we care only about what was written to first places. + std::unique_ptr ngram_storage; + ngram_storage.reset(new UInt16[max_string_size]); + /// We use unsafe versions of getting ngrams, so I decided to use padded_data even in needle case. const size_t needle_size = needle.size(); needle.resize(needle_size + default_padding); - const size_t needle_stats_size = dispatchSearcher(calculateNeedleStats, needle.data(), needle_size, common_stats); + const size_t needle_stats_size = dispatchSearcher(calculateNeedleStats, needle.data(), needle_size, common_stats, nullptr); size_t distance = needle_stats_size; size_t prev_offset = 0; @@ -303,7 +374,11 @@ struct NgramDistanceImpl if (haystack_size <= max_string_size) { size_t haystack_stats_size = dispatchSearcher( - calculateHaystackStatsAndMetric, reinterpret_cast(haystack), haystack_size, common_stats, distance); + calculateHaystackStatsAndMetric, + reinterpret_cast(haystack), + haystack_size, common_stats, + distance, + ngram_storage.get()); res[i] = distance * 1.f / std::max(haystack_stats_size + needle_stats_size, size_t(1)); } else diff --git a/dbms/src/Functions/FunctionsStringSimilarity.h b/dbms/src/Functions/FunctionsStringSimilarity.h index 7a106980722..9fd11e47622 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.h +++ b/dbms/src/Functions/FunctionsStringSimilarity.h @@ -62,10 +62,7 @@ public: const ColumnConst * col_haystack_const = typeid_cast(&*column_haystack); const ColumnConst * col_needle_const = typeid_cast(&*column_needle); - if (!col_needle_const) - throw Exception("Second argument of function " + getName() + " must be constant string.", ErrorCodes::ILLEGAL_COLUMN); - - if (col_haystack_const) + if (col_haystack_const && col_needle_const) { ResultType res{}; const String & needle = col_needle_const->getValue(); @@ -88,8 +85,9 @@ public: vec_res.resize(column_haystack->size()); const ColumnString * col_haystack_vector = checkAndGetColumn(&*column_haystack); + const ColumnString * col_needle_vector = checkAndGetColumn(&*column_needle); - if (col_haystack_vector) + if (col_haystack_vector && col_needle_const) { const String & needle = col_needle_const->getValue(); if (needle.size() > Impl::max_string_size) @@ -101,6 +99,27 @@ public: } Impl::vector_constant(col_haystack_vector->getChars(), col_haystack_vector->getOffsets(), needle, vec_res); } + else if (col_haystack_vector && col_needle_vector) + { + Impl::vector_vector( + col_haystack_vector->getChars(), + col_haystack_vector->getOffsets(), + col_needle_vector->getChars(), + col_needle_vector->getOffsets(), + vec_res); + } + else if (col_haystack_const && col_needle_vector) + { + const String & needle = col_haystack_const->getValue(); + if (needle.size() > Impl::max_string_size) + { + throw Exception( + "String size of needle is too big for function " + getName() + ". Should be at most " + + std::to_string(Impl::max_string_size), + ErrorCodes::TOO_LARGE_STRING_SIZE); + } + Impl::vector_constant(col_needle_vector->getChars(), col_needle_vector->getOffsets(), needle, vec_res); + } else { throw Exception( diff --git a/dbms/tests/performance/ngram_distance.xml b/dbms/tests/performance/ngram_distance.xml index 16960811067..af1d81e6f61 100644 --- a/dbms/tests/performance/ngram_distance.xml +++ b/dbms/tests/performance/ngram_distance.xml @@ -21,13 +21,16 @@ 60000 - + SELECT DISTINCT URL,Title, ngramDistance(Title, URL) AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT SearchPhrase,Title, ngramDistance(Title, SearchPhrase) AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistance(Title, 'what is love') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistance(Title, 'baby dont hurt me') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistance(Title, 'no more') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'wHAt Is lovE') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'BABY DonT hUrT me') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistanceCaseInsensitive(Title, 'nO MOrE') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT URL,Title, ngramDistanceUTF8(Title, URL) AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 + SELECT DISTINCT SearchPhrase,Title, ngramDistanceUTF8(Title, SearchPhrase) AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT Title, ngramDistanceUTF8(Title, 'метрика') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'как дела') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 SELECT DISTINCT URL, ngramDistanceUTF8(URL, 'чем занимаешься') AS distance FROM hits_100m_single ORDER BY distance ASC LIMIT 50 diff --git a/dbms/tests/queries/0_stateless/00909_ngram_distance.reference b/dbms/tests/queries/0_stateless/00909_ngram_distance.reference index 356cc5db466..4fc02992bdf 100644 --- a/dbms/tests/queries/0_stateless/00909_ngram_distance.reference +++ b/dbms/tests/queries/0_stateless/00909_ngram_distance.reference @@ -33,6 +33,76 @@ 1000 1000 1000 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 0 1000 1000 @@ -40,6 +110,39 @@ 77 636 1000 +привет как дела?... Херсон 0 +привет как дела клип - Яндекс.Видео 0 +привет 0 +пап привет как дела - Яндекс.Видео 0 +привет братан как дела - Яндекс.Видео 0 +http://metric.ru/ 0 +http://autometric.ru/ 0 +http://metrica.yandex.com/ 0 +http://metris.ru/ 0 +http://metrika.ru/ 0 + 0 + 0 +привет как дела?... Херсон 600 +пап привет как дела - Яндекс.Видео 684 +привет как дела клип - Яндекс.Видео 692 +привет братан как дела - Яндекс.Видео 707 +привет 1000 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 0 +http://metric.ru/ 765 +http://metris.ru/ 765 +http://metrika.ru/ 778 +http://autometric.ru/ 810 +http://metrica.yandex.com/ 846 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 привет как дела?... Херсон 297 пап привет как дела - Яндекс.Видео 422 привет как дела клип - Яндекс.Видео 435 @@ -152,6 +255,76 @@ http://metrika.ru/ 1000 1000 1000 1000 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 0 1000 1000 @@ -159,6 +332,39 @@ http://metrika.ru/ 1000 77 636 1000 +привет как дела?... Херсон 0 +привет как дела клип - Яндекс.Видео 0 +привет 0 +пап привет как дела - Яндекс.Видео 0 +привет братан как дела - Яндекс.Видео 0 +http://metric.ru/ 0 +http://autometric.ru/ 0 +http://metrica.yandex.com/ 0 +http://metris.ru/ 0 +http://metrika.ru/ 0 + 0 + 0 +привет как дела?... Херсон 600 +пап привет как дела - Яндекс.Видео 684 +привет как дела клип - Яндекс.Видео 692 +привет братан как дела - Яндекс.Видео 707 +привет 1000 +http://metric.ru/ 1000 +http://autometric.ru/ 1000 +http://metrica.yandex.com/ 1000 +http://metris.ru/ 1000 +http://metrika.ru/ 1000 + 0 +http://metric.ru/ 765 +http://metris.ru/ 765 +http://metrika.ru/ 778 +http://autometric.ru/ 810 +http://metrica.yandex.com/ 846 +привет как дела?... Херсон 1000 +привет как дела клип - Яндекс.Видео 1000 +привет 1000 +пап привет как дела - Яндекс.Видео 1000 +привет братан как дела - Яндекс.Видео 1000 привет как дела?... Херсон 297 пап привет как дела - Яндекс.Видео 422 привет как дела клип - Яндекс.Видео 435 @@ -293,6 +499,76 @@ http://metrika.ru/ 1000 1000 1000 1000 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 0 0 0 @@ -412,6 +688,76 @@ http://metrika.ru/ 1000 1000 1000 1000 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 0 0 0 diff --git a/dbms/tests/queries/0_stateless/00909_ngram_distance.sql b/dbms/tests/queries/0_stateless/00909_ngram_distance.sql index ea7bd252fc7..ed800bf6c97 100644 --- a/dbms/tests/queries/0_stateless/00909_ngram_distance.sql +++ b/dbms/tests/queries/0_stateless/00909_ngram_distance.sql @@ -6,6 +6,22 @@ select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'абв select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'гдеёзд')) from system.numbers limit 5; select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'ёёёёёёёё')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize(''), materialize('')))=round(1000 * ngramDistanceUTF8(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абв'), materialize('')))=round(1000 * ngramDistanceUTF8(materialize('абв'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize(''), materialize('абв')))=round(1000 * ngramDistanceUTF8(materialize(''), 'абв')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), materialize('абвгдеёжз')))=round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'абвгдеёжз')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), materialize('абвгдеёж')))=round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'абвгдеёж')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), materialize('гдеёзд')))=round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'гдеёзд')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), materialize('ёёёёёёёё')))=round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'ёёёёёёёё')) from system.numbers limit 5; + +select round(1000 * ngramDistanceUTF8('', materialize('')))=round(1000 * ngramDistanceUTF8(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8('абв', materialize('')))=round(1000 * ngramDistanceUTF8(materialize('абв'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8('', materialize('абв')))=round(1000 * ngramDistanceUTF8(materialize(''), 'абв')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8('абвгдеёжз', materialize('абвгдеёжз')))=round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'абвгдеёжз')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8('абвгдеёжз', materialize('абвгдеёж')))=round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'абвгдеёж')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8('абвгдеёжз', materialize('гдеёзд')))=round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'гдеёзд')) from system.numbers limit 5; +select round(1000 * ngramDistanceUTF8('абвгдеёжз', materialize('ёёёёёёёё')))=round(1000 * ngramDistanceUTF8(materialize('абвгдеёжз'), 'ёёёёёёёё')) from system.numbers limit 5; + select round(1000 * ngramDistanceUTF8('', '')); select round(1000 * ngramDistanceUTF8('абв', '')); select round(1000 * ngramDistanceUTF8('', 'абв')); @@ -18,6 +34,10 @@ drop table if exists test_distance; create table test_distance (Title String) engine = Memory; insert into test_distance values ('привет как дела?... Херсон'), ('привет как дела клип - Яндекс.Видео'), ('привет'), ('пап привет как дела - Яндекс.Видео'), ('привет братан как дела - Яндекс.Видео'), ('http://metric.ru/'), ('http://autometric.ru/'), ('http://metrica.yandex.com/'), ('http://metris.ru/'), ('http://metrika.ru/'), (''); +SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceUTF8(Title, Title) as distance; +SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceUTF8(Title, extract(Title, 'как дела')) as distance; +SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceUTF8(Title, extract(Title, 'metr')) as distance; + SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceUTF8(Title, 'привет как дела') as distance; SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceUTF8(Title, 'как привет дела') as distance; SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceUTF8(Title, 'metrika') as distance; @@ -35,6 +55,23 @@ select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('аБВГдеё select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), 'гдеёЗД')) from system.numbers limit 5; select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), 'ЁЁЁЁЁЁЁЁ')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize(''),materialize(''))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абв'),materialize(''))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абв'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize(''), materialize('абв'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize(''), 'абв')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвГДЕёжз'), materialize('АбвгдЕёжз'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвГДЕёжз'), 'АбвгдЕёжз')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('аБВГдеёЖз'), materialize('АбвГдеёж'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('аБВГдеёЖз'), 'АбвГдеёж')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), materialize('гдеёЗД'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), 'гдеёЗД')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), materialize('ЁЁЁЁЁЁЁЁ'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), 'ЁЁЁЁЁЁЁЁ')) from system.numbers limit 5; + +select round(1000 * ngramDistanceCaseInsensitiveUTF8('', materialize(''))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8('абв',materialize(''))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абв'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8('', materialize('абв'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize(''), 'абв')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8('абвГДЕёжз', materialize('АбвгдЕёжз'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвГДЕёжз'), 'АбвгдЕёжз')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8('аБВГдеёЖз', materialize('АбвГдеёж'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('аБВГдеёЖз'), 'АбвГдеёж')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8('абвгдеёжз', materialize('гдеёЗД'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), 'гдеёЗД')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitiveUTF8('абвгдеёжз', materialize('ЁЁЁЁЁЁЁЁ'))) = round(1000 * ngramDistanceCaseInsensitiveUTF8(materialize('абвгдеёжз'), 'ЁЁЁЁЁЁЁЁ')) from system.numbers limit 5; + + select round(1000 * ngramDistanceCaseInsensitiveUTF8('', '')); select round(1000 * ngramDistanceCaseInsensitiveUTF8('абв', '')); select round(1000 * ngramDistanceCaseInsensitiveUTF8('', 'абв')); @@ -43,6 +80,10 @@ select round(1000 * ngramDistanceCaseInsensitiveUTF8('аБВГдеёЖз', 'Аб select round(1000 * ngramDistanceCaseInsensitiveUTF8('абвгдеёжз', 'гдеёЗД')); select round(1000 * ngramDistanceCaseInsensitiveUTF8('АБВГДеёжз', 'ЁЁЁЁЁЁЁЁ')); +SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, Title) as distance; +SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, extract(Title, 'как дела')) as distance; +SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, extract(Title, 'metr')) as distance; + SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'ПрИвЕт кАК ДЕЛа') as distance; SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'как ПРИВЕТ дела') as distance; SELECT Title, round(1000 * distance) FROM test_distance ORDER BY ngramDistanceCaseInsensitiveUTF8(Title, 'metrika') as distance; @@ -62,6 +103,23 @@ select round(1000 * ngramDistance(materialize('abcdefgh'), 'abcdefg')) from syst select round(1000 * ngramDistance(materialize('abcdefgh'), 'defgh')) from system.numbers limit 5; select round(1000 * ngramDistance(materialize('abcdefgh'), 'aaaaaaaa')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize(''),materialize('')))=round(1000 * ngramDistance(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abc'),materialize('')))=round(1000 * ngramDistance(materialize('abc'), '')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize(''), materialize('abc')))=round(1000 * ngramDistance(materialize(''), 'abc')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abcdefgh'), materialize('abcdefgh')))=round(1000 * ngramDistance(materialize('abcdefgh'), 'abcdefgh')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abcdefgh'), materialize('abcdefg')))=round(1000 * ngramDistance(materialize('abcdefgh'), 'abcdefg')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abcdefgh'), materialize('defgh')))=round(1000 * ngramDistance(materialize('abcdefgh'), 'defgh')) from system.numbers limit 5; +select round(1000 * ngramDistance(materialize('abcdefgh'), materialize('aaaaaaaa')))=round(1000 * ngramDistance(materialize('abcdefgh'), 'aaaaaaaa')) from system.numbers limit 5; + +select round(1000 * ngramDistance('',materialize('')))=round(1000 * ngramDistance(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistance('abc', materialize('')))=round(1000 * ngramDistance(materialize('abc'), '')) from system.numbers limit 5; +select round(1000 * ngramDistance('', materialize('abc')))=round(1000 * ngramDistance(materialize(''), 'abc')) from system.numbers limit 5; +select round(1000 * ngramDistance('abcdefgh', materialize('abcdefgh')))=round(1000 * ngramDistance(materialize('abcdefgh'), 'abcdefgh')) from system.numbers limit 5; +select round(1000 * ngramDistance('abcdefgh', materialize('abcdefg')))=round(1000 * ngramDistance(materialize('abcdefgh'), 'abcdefg')) from system.numbers limit 5; +select round(1000 * ngramDistance('abcdefgh', materialize('defgh')))=round(1000 * ngramDistance(materialize('abcdefgh'), 'defgh')) from system.numbers limit 5; +select round(1000 * ngramDistance('abcdefgh', materialize('aaaaaaaa')))=round(1000 * ngramDistance(materialize('abcdefgh'), 'aaaaaaaa')) from system.numbers limit 5; + + select round(1000 * ngramDistance('', '')); select round(1000 * ngramDistance('abc', '')); select round(1000 * ngramDistance('', 'abc')); @@ -86,6 +144,22 @@ select round(1000 * ngramDistanceCaseInsensitive(materialize('abcdefgh'), 'abcde select round(1000 * ngramDistanceCaseInsensitive(materialize('AAAAbcdefgh'), 'defgh')) from system.numbers limit 5; select round(1000 * ngramDistanceCaseInsensitive(materialize('ABCdefgH'), 'aaaaaaaa')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize(''), materialize('')))=round(1000 * ngramDistanceCaseInsensitive(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('abc'), materialize('')))=round(1000 * ngramDistanceCaseInsensitive(materialize('abc'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize(''), materialize('abc')))=round(1000 * ngramDistanceCaseInsensitive(materialize(''), 'abc')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('abCdefgH'), materialize('Abcdefgh')))=round(1000 * ngramDistanceCaseInsensitive(materialize('abCdefgH'), 'Abcdefgh')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('abcdefgh'), materialize('abcdeFG')))=round(1000 * ngramDistanceCaseInsensitive(materialize('abcdefgh'), 'abcdeFG')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('AAAAbcdefgh'), materialize('defgh')))=round(1000 * ngramDistanceCaseInsensitive(materialize('AAAAbcdefgh'), 'defgh')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive(materialize('ABCdefgH'), materialize('aaaaaaaa')))=round(1000 * ngramDistanceCaseInsensitive(materialize('ABCdefgH'), 'aaaaaaaa')) from system.numbers limit 5; + +select round(1000 * ngramDistanceCaseInsensitive('', materialize('')))=round(1000 * ngramDistanceCaseInsensitive(materialize(''), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive('abc', materialize('')))=round(1000 * ngramDistanceCaseInsensitive(materialize('abc'), '')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive('', materialize('abc')))=round(1000 * ngramDistanceCaseInsensitive(materialize(''), 'abc')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive('abCdefgH', materialize('Abcdefgh')))=round(1000 * ngramDistanceCaseInsensitive(materialize('abCdefgH'), 'Abcdefgh')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive('abcdefgh', materialize('abcdeFG')))=round(1000 * ngramDistanceCaseInsensitive(materialize('abcdefgh'), 'abcdeFG')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive('AAAAbcdefgh', materialize('defgh')))=round(1000 * ngramDistanceCaseInsensitive(materialize('AAAAbcdefgh'), 'defgh')) from system.numbers limit 5; +select round(1000 * ngramDistanceCaseInsensitive('ABCdefgH', materialize('aaaaaaaa')))=round(1000 * ngramDistanceCaseInsensitive(materialize('ABCdefgH'), 'aaaaaaaa')) from system.numbers limit 5; + select round(1000 * ngramDistanceCaseInsensitive('', '')); select round(1000 * ngramDistanceCaseInsensitive('abc', '')); select round(1000 * ngramDistanceCaseInsensitive('', 'abc')); From 6a6b30a56fa8e95a7508239d938640a40cecb90b Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Mon, 6 May 2019 00:35:08 +0300 Subject: [PATCH 076/194] Less code with unique ptrs and some docs added --- dbms/src/Functions/FunctionsStringSimilarity.cpp | 14 ++++++++------ .../functions/string_search_functions.md | 2 +- .../functions/string_search_functions.md | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dbms/src/Functions/FunctionsStringSimilarity.cpp b/dbms/src/Functions/FunctionsStringSimilarity.cpp index d640cbf27e4..feec2ee5a86 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.cpp +++ b/dbms/src/Functions/FunctionsStringSimilarity.cpp @@ -292,10 +292,8 @@ struct NgramDistanceImpl /// The main motivation is to not allocate more on stack because we have already allocated a lot (128Kb). /// And we can reuse these storages in one thread because we care only about what was written to first places. - std::unique_ptr needle_ngram_storage; - std::unique_ptr haystack_ngram_storage; - needle_ngram_storage.reset(new UInt16[max_string_size]); - haystack_ngram_storage.reset(new UInt16[max_string_size]); + std::unique_ptr needle_ngram_storage(new UInt16[max_string_size]); + std::unique_ptr haystack_ngram_storage(new UInt16[max_string_size]); for (size_t i = 0; i < haystack_offsets_size; ++i) { @@ -356,8 +354,12 @@ struct NgramDistanceImpl /// The main motivation is to not allocate more on stack because we have already allocated a lot (128Kb). /// And we can reuse these storages in one thread because we care only about what was written to first places. - std::unique_ptr ngram_storage; - ngram_storage.reset(new UInt16[max_string_size]); + std::unique_ptr ngram_storage(new UInt16[max_string_size]); + + + + + /// We use unsafe versions of getting ngrams, so I decided to use padded_data even in needle case. const size_t needle_size = needle.size(); diff --git a/docs/en/query_language/functions/string_search_functions.md b/docs/en/query_language/functions/string_search_functions.md index 3674869bd81..d2f552ca2ec 100644 --- a/docs/en/query_language/functions/string_search_functions.md +++ b/docs/en/query_language/functions/string_search_functions.md @@ -102,7 +102,7 @@ The same thing as 'like', but negative. ## ngramDistance(haystack, needle) -Calculates the 4-gram distance between `haystack` and `needle`: counts the symmetric difference between two multisets of 4-grams and normalizes it by the sum of their cardinalities. Returns float number from 0 to 1 -- the closer to zero, the more strings are similar to each other. If the `needle` is more than 32Kb, throws an exception. If some of the `haystack` strings are more than 32Kb, the distance is always one. +Calculates the 4-gram distance between `haystack` and `needle`: counts the symmetric difference between two multisets of 4-grams and normalizes it by the sum of their cardinalities. Returns float number from 0 to 1 -- the closer to zero, the more strings are similar to each other. If the constant `needle` or `haystack` is more than 32Kb, throws an exception. If some of the non-constant `haystack` or `needle` strings are more than 32Kb, the distance is always one. For case-insensitive search or/and in UTF-8 format use functions `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. diff --git a/docs/ru/query_language/functions/string_search_functions.md b/docs/ru/query_language/functions/string_search_functions.md index f7981f32365..9846b8aa67c 100644 --- a/docs/ru/query_language/functions/string_search_functions.md +++ b/docs/ru/query_language/functions/string_search_functions.md @@ -91,7 +91,7 @@ ## ngramDistance(haystack, needle) -Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя мультимножествами 4-грамм и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 -- чем ближе к нулю, тем больше строки похожи друг на друга. Если `needle` больше чем 32КБ, кидается исключение. Если некоторые строки из `haystack` больше 32КБ, расстояние всегда равно единице. +Вычисление 4-граммного расстояния между `haystack` и `needle`: считается симметрическая разность между двумя мультимножествами 4-грамм и нормализается на сумму их мощностей. Возвращает число float от 0 до 1 -- чем ближе к нулю, тем больше строки похожи друг на друга. Если константный `needle` или `haystack` больше чем 32КБ, кидается исключение. Если некоторые строки из неконстантного `haystack` или `needle` больше 32КБ, расстояние всегда равно единице. Для поиска без учета регистра и/или в формате UTF-8 используйте функции `ngramDistanceCaseInsensitive, ngramDistanceUTF8, ngramDistanceCaseInsensitiveUTF8`. From 8b235f7a4a9f3b2a2557951a13ee9565fb8d4198 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Mon, 6 May 2019 00:37:58 +0300 Subject: [PATCH 077/194] Comments --- dbms/src/Functions/FunctionsStringSimilarity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Functions/FunctionsStringSimilarity.cpp b/dbms/src/Functions/FunctionsStringSimilarity.cpp index feec2ee5a86..57f36a7ec75 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.cpp +++ b/dbms/src/Functions/FunctionsStringSimilarity.cpp @@ -332,7 +332,7 @@ struct NgramDistanceImpl } else { - /// String are too big, we are assuming they are not the same. This is done because of limiting number + /// Strings are too big, we are assuming they are not the same. This is done because of limiting number /// of bigrams added and not allocating too much memory. res[i] = 1.f; } From 512c7fa3a444d91e08f0df5a60b070e2991ed5aa Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Mon, 6 May 2019 00:40:37 +0300 Subject: [PATCH 078/194] Comments --- dbms/src/Functions/FunctionsStringSimilarity.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dbms/src/Functions/FunctionsStringSimilarity.cpp b/dbms/src/Functions/FunctionsStringSimilarity.cpp index 57f36a7ec75..ee77b41eaf6 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.cpp +++ b/dbms/src/Functions/FunctionsStringSimilarity.cpp @@ -356,11 +356,6 @@ struct NgramDistanceImpl /// And we can reuse these storages in one thread because we care only about what was written to first places. std::unique_ptr ngram_storage(new UInt16[max_string_size]); - - - - - /// We use unsafe versions of getting ngrams, so I decided to use padded_data even in needle case. const size_t needle_size = needle.size(); needle.resize(needle_size + default_padding); From c280907f0988e56e99f26cfc1813822e85b8c559 Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Mon, 6 May 2019 11:34:28 +0300 Subject: [PATCH 079/194] Zero initialization instead of memset --- dbms/src/Functions/FunctionsStringSimilarity.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dbms/src/Functions/FunctionsStringSimilarity.cpp b/dbms/src/Functions/FunctionsStringSimilarity.cpp index ee77b41eaf6..e12455ee560 100644 --- a/dbms/src/Functions/FunctionsStringSimilarity.cpp +++ b/dbms/src/Functions/FunctionsStringSimilarity.cpp @@ -254,8 +254,7 @@ struct NgramDistanceImpl static void constant_constant(std::string data, std::string needle, Float32 & res) { - NgramStats common_stats; - memset(common_stats, 0, sizeof(common_stats)); + NgramStats common_stats = {}; /// We use unsafe versions of getting ngrams, so I decided to use padded strings. const size_t needle_size = needle.size(); @@ -287,8 +286,7 @@ struct NgramDistanceImpl size_t prev_haystack_offset = 0; size_t prev_needle_offset = 0; - NgramStats common_stats; - memset(common_stats, 0, sizeof(common_stats)); + NgramStats common_stats = {}; /// The main motivation is to not allocate more on stack because we have already allocated a lot (128Kb). /// And we can reuse these storages in one thread because we care only about what was written to first places. @@ -349,8 +347,7 @@ struct NgramDistanceImpl PaddedPODArray & res) { /// zeroing our map - NgramStats common_stats; - memset(common_stats, 0, sizeof(common_stats)); + NgramStats common_stats = {}; /// The main motivation is to not allocate more on stack because we have already allocated a lot (128Kb). /// And we can reuse these storages in one thread because we care only about what was written to first places. From 0e0a0f6ee61021d301e19a08f1c4bd31565e64cc Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 6 May 2019 15:12:18 +0300 Subject: [PATCH 080/194] CLICKHOUSE-4511 Fix forcerestart with systemd --- debian/clickhouse-server.init | 14 ++++++++------ debian/clickhouse-server.service | 3 ++- libs/libdaemon/src/BaseDaemon.cpp | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/debian/clickhouse-server.init b/debian/clickhouse-server.init index 28f8481aff7..f05be5d8453 100755 --- a/debian/clickhouse-server.init +++ b/debian/clickhouse-server.init @@ -238,7 +238,8 @@ forcestop() forcerestart() { forcestop - start + # Should not use 'start' function if systemd active + service $PROGRAM start } use_cron() @@ -291,7 +292,8 @@ main() restart && enable_cron ;; forcestop) - disable_cron && forcestop + disable_cron + forcestop ;; forcerestart) forcerestart && enable_cron @@ -300,16 +302,16 @@ main() restart ;; condstart) - is_running || start + is_running || service $PROGRAM start ;; condstop) - is_running && stop + is_running && service $PROGRAM stop ;; condrestart) - is_running && restart + is_running && service $PROGRAM restart ;; condreload) - is_running && restart + is_running && service $PROGRAM restart ;; initdb) initdb diff --git a/debian/clickhouse-server.service b/debian/clickhouse-server.service index 8050de49748..7eaceeab986 100644 --- a/debian/clickhouse-server.service +++ b/debian/clickhouse-server.service @@ -7,7 +7,8 @@ User=clickhouse Group=clickhouse Restart=always RestartSec=30 -ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml +RuntimeDirectory=clickhouse-server +ExecStart=/usr/bin/clickhouse-server --config=/etc/clickhouse-server/config.xml --pid-file=/run/clickhouse-server/clickhouse-server.pid LimitCORE=infinity LimitNOFILE=500000 CapabilityBoundingSet=CAP_NET_ADMIN CAP_IPC_LOCK diff --git a/libs/libdaemon/src/BaseDaemon.cpp b/libs/libdaemon/src/BaseDaemon.cpp index 6bf9ef3f451..11e7af40f51 100644 --- a/libs/libdaemon/src/BaseDaemon.cpp +++ b/libs/libdaemon/src/BaseDaemon.cpp @@ -1083,7 +1083,7 @@ void BaseDaemon::initialize(Application & self) } /// Create pid file. - if (is_daemon && config().has("pid")) + if (config().has("pid")) pid.seed(config().getString("pid")); /// Change path for logging. From bf5a2a60c9ceae92b139e0809f9977161bfcfb64 Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 6 May 2019 16:24:22 +0300 Subject: [PATCH 081/194] fix --- debian/clickhouse-server.init | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/debian/clickhouse-server.init b/debian/clickhouse-server.init index f05be5d8453..8660ed87c6d 100755 --- a/debian/clickhouse-server.init +++ b/debian/clickhouse-server.init @@ -235,11 +235,20 @@ forcestop() } +service_or_func() +{ + if [ -x "/bin/systemctl" ] && [ -f /etc/systemd/system/clickhouse-server.service ] && [ -d /run/systemd/system ]; then + service $PROGRAM $1 + else + $1 + fi +} + forcerestart() { forcestop # Should not use 'start' function if systemd active - service $PROGRAM start + service_or_func start } use_cron() @@ -302,16 +311,16 @@ main() restart ;; condstart) - is_running || service $PROGRAM start + is_running || service_or_func start ;; condstop) - is_running && service $PROGRAM stop + is_running && service_or_func stop ;; condrestart) - is_running && service $PROGRAM restart + is_running && service_or_func restart ;; condreload) - is_running && service $PROGRAM restart + is_running && service_or_func restart ;; initdb) initdb From 52f4d508bfbbb430d9ca2a6619119ffc2e3257cb Mon Sep 17 00:00:00 2001 From: BayoNet Date: Mon, 6 May 2019 21:09:28 +0300 Subject: [PATCH 082/194] DOCAPI-3822: Some corrections. --- docs/en/operations/server_settings/settings.md | 6 +++--- docs/zh/faq/general.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/operations/server_settings/settings.md b/docs/en/operations/server_settings/settings.md index d73c7205293..8b4285c422e 100644 --- a/docs/en/operations/server_settings/settings.md +++ b/docs/en/operations/server_settings/settings.md @@ -668,7 +668,7 @@ Path to the file that contains: Contains settings that allow ClickHouse to interact with [ZooKeeper](http://zookeeper.apache.org/) cluster. -ClickHouse uses ZooKeeper for storing replicas' metadata when using replicated tables. If replicated tables are not used, this parameter section can be omitted. +ClickHouse uses ZooKeeper for storing metadata of replicas when using replicated tables. If replicated tables are not used, this parameter section can be omitted. This parameter section contains the following parameters: @@ -683,7 +683,7 @@ This parameter section contains the following parameters: ``` - The `index` attribute specify an order of node, when trying to connect to ZooKeeper cluster. + The `index` attribute specifies an order of node, when trying to connect to ZooKeeper cluster. - `session_timeout` — Maximum timeout for client session in milliseconds. - `root` — ZNode, that is used as root for znodes used by ClickHouse server. Optional. @@ -712,7 +712,7 @@ This parameter section contains the following parameters: **See Also** - [Replication](../../operations/table_engines/replication.md) -- [ZooKeeper Programmer's Guide](http://zookeeper.apache.org/doc/r3.3.4/zookeeperProgrammers.html) +- [ZooKeeper Programmer's Guide](http://zookeeper.apache.org/doc/current/zookeeperProgrammers.html) ## use_minimalistic_part_header_in_zookeeper {#server-settings-use_minimalistic_part_header_in_zookeeper} diff --git a/docs/zh/faq/general.md b/docs/zh/faq/general.md index 1f0121133f7..a7568cc60b0 100644 --- a/docs/zh/faq/general.md +++ b/docs/zh/faq/general.md @@ -16,7 +16,7 @@ If you use Oracle through ODBC driver as a source of external dictionaries, you **Example** ``` -NLS_LANG=RUSSIAN_RUSSIA.UTF8 +NLS_LANG=CHINESE_CHINA.ZHS16GBK ``` [来源文章](https://clickhouse.yandex/docs/zh/faq/general/) From 84ee8cec93ab47d69bbd4ea33aed58e292d915f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=81=A5?= Date: Tue, 7 May 2019 13:20:23 +0800 Subject: [PATCH 083/194] Add function ignoreExceptNull to meet nullable functionIn's requirement for optimization of analyse. --- dbms/src/Functions/ignoreExceptNull.cpp | 51 +++++++++++++++++++ .../registerFunctionsMiscellaneous.cpp | 2 + dbms/src/Interpreters/ActionsVisitor.cpp | 4 +- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 dbms/src/Functions/ignoreExceptNull.cpp diff --git a/dbms/src/Functions/ignoreExceptNull.cpp b/dbms/src/Functions/ignoreExceptNull.cpp new file mode 100644 index 00000000000..3ebdbea8c58 --- /dev/null +++ b/dbms/src/Functions/ignoreExceptNull.cpp @@ -0,0 +1,51 @@ +#include +#include +#include + + +namespace DB +{ + +/** ignoreExceptNull(...) is a function that takes any arguments, and always returns 0 except Null. + */ + class FunctionIgnoreExceptNull : public IFunction + { + public: + static constexpr auto name = "ignoreExceptNull"; + static FunctionPtr create(const Context &) + { + return std::make_shared(); + } + + bool isVariadic() const override + { + return true; + } + size_t getNumberOfArguments() const override + { + return 0; + } + + String getName() const override + { + return name; + } + + DataTypePtr getReturnTypeImpl(const DataTypes & /*arguments*/) const override + { + return std::make_shared(); + } + + void executeImpl(Block & block, const ColumnNumbers &, size_t result, size_t input_rows_count) override + { + block.getByPosition(result).column = DataTypeUInt8().createColumnConst(input_rows_count, UInt64(0)); + } + }; + + + void registerFunctionIgnoreExceptNull(FunctionFactory & factory) + { + factory.registerFunction(); + } + +} diff --git a/dbms/src/Functions/registerFunctionsMiscellaneous.cpp b/dbms/src/Functions/registerFunctionsMiscellaneous.cpp index d985fb6bf97..3b1d86cc685 100644 --- a/dbms/src/Functions/registerFunctionsMiscellaneous.cpp +++ b/dbms/src/Functions/registerFunctionsMiscellaneous.cpp @@ -19,6 +19,7 @@ void registerFunctionSleep(FunctionFactory &); void registerFunctionSleepEachRow(FunctionFactory &); void registerFunctionMaterialize(FunctionFactory &); void registerFunctionIgnore(FunctionFactory &); +void registerFunctionIgnoreExceptNull(FunctionFactory &); void registerFunctionIndexHint(FunctionFactory &); void registerFunctionIdentity(FunctionFactory &); void registerFunctionArrayJoin(FunctionFactory &); @@ -61,6 +62,7 @@ void registerFunctionsMiscellaneous(FunctionFactory & factory) registerFunctionSleepEachRow(factory); registerFunctionMaterialize(factory); registerFunctionIgnore(factory); + registerFunctionIgnoreExceptNull(factory); registerFunctionIndexHint(factory); registerFunctionIdentity(factory); registerFunctionArrayJoin(factory); diff --git a/dbms/src/Interpreters/ActionsVisitor.cpp b/dbms/src/Interpreters/ActionsVisitor.cpp index 5191e86c57e..d0237f7cb88 100644 --- a/dbms/src/Interpreters/ActionsVisitor.cpp +++ b/dbms/src/Interpreters/ActionsVisitor.cpp @@ -328,10 +328,10 @@ void ActionsVisitor::visit(const ASTPtr & ast) if (!only_consts) { /// We are in the part of the tree that we are not going to compute. You just need to define types. - /// Do not subquery and create sets. We treat "IN" as "ignore" function. + /// Do not subquery and create sets. We treat "IN" as "ignoreExceptNull" function. actions_stack.addAction(ExpressionAction::applyFunction( - FunctionFactory::instance().get("ignore", context), + FunctionFactory::instance().get("ignoreExceptNull", context), { node->arguments->children.at(0)->getColumnName() }, getColumnName())); } From 55dc86ef748835014473e11a9c4931e0ed202ee9 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Tue, 7 May 2019 13:54:55 +0700 Subject: [PATCH 084/194] Support rename operation for MaterializeView storage --- dbms/src/Storages/StorageMaterializedView.cpp | 52 ++++++++++++++++++- dbms/src/Storages/StorageMaterializedView.h | 2 + .../00942_mv_rename_table.reference | 6 +++ .../0_stateless/00942_mv_rename_table.sql | 21 ++++++++ ...43_mv_rename_without_inner_table.reference | 16 ++++++ .../00943_mv_rename_without_inner_table.sql | 26 ++++++++++ 6 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 dbms/tests/queries/0_stateless/00942_mv_rename_table.reference create mode 100644 dbms/tests/queries/0_stateless/00942_mv_rename_table.sql create mode 100644 dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.reference create mode 100644 dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.sql diff --git a/dbms/src/Storages/StorageMaterializedView.cpp b/dbms/src/Storages/StorageMaterializedView.cpp index d367309e825..a22eabd4952 100644 --- a/dbms/src/Storages/StorageMaterializedView.cpp +++ b/dbms/src/Storages/StorageMaterializedView.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -26,6 +27,10 @@ namespace ErrorCodes extern const int QUERY_IS_NOT_SUPPORTED_IN_MATERIALIZED_VIEW; } +static String generateInnerTableName(const String & table_name) +{ + return ".inner." + table_name; +} static void extractDependentTable(ASTSelectQuery & query, String & select_database_name, String & select_table_name) { @@ -128,7 +133,7 @@ StorageMaterializedView::StorageMaterializedView( else { target_database_name = database_name; - target_table_name = ".inner." + table_name; + target_table_name = generateInnerTableName(table_name); has_inner_table = true; } @@ -265,6 +270,51 @@ void StorageMaterializedView::mutate(const MutationCommands & commands, const Co getTargetTable()->mutate(commands, context); } +static void executeRenameQuery(Context & global_context, const String & database_name, const String & table_original_name, const String & new_table_name) +{ + if (global_context.tryGetTable(database_name, table_original_name)) + { + auto rename = std::make_shared(); + + ASTRenameQuery::Table from; + from.database = database_name; + from.table = table_original_name; + + ASTRenameQuery::Table to; + to.database = database_name; + to.table = new_table_name; + + ASTRenameQuery::Element elem; + elem.from = from; + elem.to = to; + + rename->elements.emplace_back(elem); + + InterpreterRenameQuery(rename, global_context).execute(); + } +} + + +void StorageMaterializedView::rename(const String & /*new_path_to_db*/, const String & /*new_database_name*/, const String & new_table_name) +{ + if (has_inner_table && tryGetTargetTable()) + { + String new_target_table_name = generateInnerTableName(new_table_name); + executeRenameQuery(global_context, target_database_name, target_table_name, new_target_table_name); + target_table_name = new_target_table_name; + } + + global_context.removeDependency( + DatabaseAndTableName(select_database_name, select_table_name), + DatabaseAndTableName(database_name, table_name)); + + table_name = new_table_name; + + global_context.addDependency( + DatabaseAndTableName(select_database_name, select_table_name), + DatabaseAndTableName(database_name, table_name)); +} + void StorageMaterializedView::shutdown() { /// Make sure the dependency is removed after DETACH TABLE diff --git a/dbms/src/Storages/StorageMaterializedView.h b/dbms/src/Storages/StorageMaterializedView.h index 665f6243a32..8214875528d 100644 --- a/dbms/src/Storages/StorageMaterializedView.h +++ b/dbms/src/Storages/StorageMaterializedView.h @@ -39,6 +39,8 @@ public: void mutate(const MutationCommands & commands, const Context & context) override; + void rename(const String & new_path_to_db, const String & new_database_name, const String & new_table_name) override; + void shutdown() override; void checkTableCanBeDropped() const override; diff --git a/dbms/tests/queries/0_stateless/00942_mv_rename_table.reference b/dbms/tests/queries/0_stateless/00942_mv_rename_table.reference new file mode 100644 index 00000000000..2c9d316b3d6 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00942_mv_rename_table.reference @@ -0,0 +1,6 @@ +1 +2 +3 +1 +2 +3 diff --git a/dbms/tests/queries/0_stateless/00942_mv_rename_table.sql b/dbms/tests/queries/0_stateless/00942_mv_rename_table.sql new file mode 100644 index 00000000000..372996438b6 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00942_mv_rename_table.sql @@ -0,0 +1,21 @@ +DROP TABLE IF EXISTS test.src; +DROP TABLE IF EXISTS test.view_table; +DROP TABLE IF EXISTS test.new_view_table; + +CREATE TABLE test.src (x UInt8) ENGINE = Null; + +USE test; + +CREATE MATERIALIZED VIEW test.view_table Engine = Memory AS SELECT * FROM test.src; + +INSERT INTO test.src VALUES (1), (2), (3); +SELECT * FROM test.view_table ORDER BY x; + +--Check if we can rename the view and if we can still fetch datas + +RENAME TABLE test.view_table TO test.new_view_table; +SELECT * FROM test.new_view_table ORDER BY x; + +DROP TABLE test.src; +DROP TABLE IF EXISTS test.view_table; +DROP TABLE IF EXISTS test.new_view_table; diff --git a/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.reference b/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.reference new file mode 100644 index 00000000000..5ba9998c7c6 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.reference @@ -0,0 +1,16 @@ +1 +1 +2 +2 +1 +1 +2 +2 +3 +3 +1 +1 +2 +2 +3 +3 diff --git a/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.sql b/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.sql new file mode 100644 index 00000000000..2edcd07dca4 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.sql @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS test.src; +DROP TABLE IF EXISTS test.dst; +DROP TABLE IF EXISTS test.original_mv; +DROP TABLE IF EXISTS test.new_mv; + +CREATE TABLE test.src (x UInt8) ENGINE = Null; +CREATE TABLE test.dst (x UInt8) ENGINE = Memory; + +USE test; + +CREATE MATERIALIZED VIEW test.original_mv TO dst AS SELECT * FROM src; + +INSERT INTO src VALUES (1), (2); +SELECT * FROM test.original_mv ORDER BY x; + +RENAME TABLE test.original_mv TO test.new_mv; + +INSERT INTO src VALUES (3); +SELECT * FROM dst ORDER BY x; + +SELECT * FROM test.new_mv ORDER BY x; + +DROP TABLE IF EXISTS test.src; +DROP TABLE IF EXISTS test.dst; +DROP TABLE IF EXISTS test.original_mv; +DROP TABLE IF EXISTS test.new_mv; From b91fd18704a2b89f86d15c75e219546b91d47d6c Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Tue, 7 May 2019 14:36:05 +0700 Subject: [PATCH 085/194] Update test reference --- .../00943_mv_rename_without_inner_table.reference | 8 -------- 1 file changed, 8 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.reference b/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.reference index 5ba9998c7c6..c7ac27ddfbe 100644 --- a/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.reference +++ b/dbms/tests/queries/0_stateless/00943_mv_rename_without_inner_table.reference @@ -1,16 +1,8 @@ 1 -1 -2 2 1 -1 -2 2 3 -3 -1 1 2 -2 -3 3 From 4cfb2859aa46cf39fbaaebb5fb2c533440ece0b4 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Tue, 7 May 2019 14:38:10 +0700 Subject: [PATCH 086/194] set generateInnerTableName function as inline --- dbms/src/Storages/StorageMaterializedView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageMaterializedView.cpp b/dbms/src/Storages/StorageMaterializedView.cpp index a22eabd4952..7b4322cb85f 100644 --- a/dbms/src/Storages/StorageMaterializedView.cpp +++ b/dbms/src/Storages/StorageMaterializedView.cpp @@ -27,7 +27,7 @@ namespace ErrorCodes extern const int QUERY_IS_NOT_SUPPORTED_IN_MATERIALIZED_VIEW; } -static String generateInnerTableName(const String & table_name) +static inline String generateInnerTableName(const String & table_name) { return ".inner." + table_name; } From b613f385f324202f97f8c9261ac196a12a1a3efd Mon Sep 17 00:00:00 2001 From: BayoNet Date: Tue, 7 May 2019 10:47:26 +0300 Subject: [PATCH 087/194] DOCAPI-6554: Extended syntax for LIMIT BY clause. --- docs/en/query_language/select.md | 84 +++++++++++++++++++++++--------- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/docs/en/query_language/select.md b/docs/en/query_language/select.md index 5e0877430b2..cbcc5974f20 100644 --- a/docs/en/query_language/select.md +++ b/docs/en/query_language/select.md @@ -17,7 +17,7 @@ SELECT [DISTINCT] expr_list [UNION ALL ...] [INTO OUTFILE filename] [FORMAT format] - [LIMIT n BY columns] + [LIMIT [offset_value, ]n BY columns] ``` All the clauses are optional, except for the required list of expressions immediately after SELECT. @@ -46,7 +46,7 @@ The FINAL modifier can be used only for a SELECT from a CollapsingMergeTree tabl ### SAMPLE Clause {#select-sample-clause} -The `SAMPLE` clause allows for approximated query processing. +The `SAMPLE` clause allows for approximated query processing. When data sampling is enabled, the query is not performed on all the data, but only on a certain fraction of data (sample). For example, if you need to calculate statistics for all the visits, it is enough to execute the query on the 1/10 fraction of all the visits and then multiply the result by 10. @@ -67,11 +67,11 @@ The features of data sampling are listed below: For the `SAMPLE` clause the following syntax is supported: -| SAMPLE Clause Syntax | Description | -| ---------------- | --------- | +| SAMPLE Clause Syntax | Description | +| ---------------- | --------- | | `SAMPLE k` | Here `k` is the number from 0 to 1.
The query is executed on `k` fraction of data. For example, `SAMPLE 0.1` runs the query on 10% of data. [Read more](#select-sample-k)| | `SAMPLE n` | Here `n` is a sufficiently large integer.
The query is executed on a sample of at least `n` rows (but not significantly more than this). For example, `SAMPLE 10000000` runs the query on a minimum of 10,000,000 rows. [Read more](#select-sample-n) | -| `SAMPLE k OFFSET m` | Here `k` and `m` are the numbers from 0 to 1.
The query is executed on a sample of `k` fraction of the data. The data used for the sample is offset by `m` fraction. [Read more](#select-sample-offset) | +| `SAMPLE k OFFSET m` | Here `k` and `m` are the numbers from 0 to 1.
The query is executed on a sample of `k` fraction of the data. The data used for the sample is offset by `m` fraction. [Read more](#select-sample-offset) | #### SAMPLE k {#select-sample-k} @@ -129,7 +129,7 @@ SELECT avg(Duration) FROM visits SAMPLE 10000000 ``` - + #### SAMPLE k OFFSET m {#select-sample-offset} Here `k` and `m` are numbers from 0 to 1. Examples are shown below. @@ -216,10 +216,10 @@ The next example uses the `LEFT ARRAY JOIN` clause: ``` sql SELECT s, arr -FROM arrays_test +FROM arrays_test LEFT ARRAY JOIN arr; ``` -``` +``` ┌─s───────────┬─arr─┐ │ Hello │ 1 │ │ Hello │ 2 │ @@ -228,7 +228,7 @@ LEFT ARRAY JOIN arr; │ World │ 5 │ │ Goodbye │ 0 │ └─────────────┴─────┘ -``` +``` #### Using Aliases @@ -240,7 +240,7 @@ FROM arrays_test ARRAY JOIN arr AS a; ``` -``` +``` ┌─s─────┬─arr─────┬─a─┐ │ Hello │ [1,2] │ 1 │ │ Hello │ [1,2] │ 2 │ @@ -254,7 +254,7 @@ Using aliases, you can perform `ARRAY JOIN` with an external array. For example: ``` sql SELECT s, arr_external -FROM arrays_test +FROM arrays_test ARRAY JOIN [1, 2, 3] AS arr_external; ``` @@ -325,7 +325,7 @@ INSERT INTO nested_test VALUES ('Hello', [1,2], [10,20]), ('World', [3,4,5], [30,40,50]), ('Goodbye', [], []); ``` -``` +``` ┌─s───────┬─nest.x──┬─nest.y─────┐ │ Hello │ [1,2] │ [10,20] │ │ World │ [3,4,5] │ [30,40,50] │ @@ -339,7 +339,7 @@ FROM nested_test ARRAY JOIN nest; ``` -``` +``` ┌─s─────┬─nest.x─┬─nest.y─┐ │ Hello │ 1 │ 10 │ │ Hello │ 2 │ 20 │ @@ -357,7 +357,7 @@ FROM nested_test ARRAY JOIN `nest.x`, `nest.y`; ``` -``` +``` ┌─s─────┬─nest.x─┬─nest.y─┐ │ Hello │ 1 │ 10 │ │ Hello │ 2 │ 20 │ @@ -375,7 +375,7 @@ FROM nested_test ARRAY JOIN `nest.x`; ``` -``` +``` ┌─s─────┬─nest.x─┬─nest.y─────┐ │ Hello │ 1 │ [10,20] │ │ Hello │ 2 │ [10,20] │ @@ -393,7 +393,7 @@ FROM nested_test ARRAY JOIN nest AS n; ``` -``` +``` ┌─s─────┬─n.x─┬─n.y─┬─nest.x──┬─nest.y─────┐ │ Hello │ 1 │ 10 │ [1,2] │ [10,20] │ │ Hello │ 2 │ 20 │ [1,2] │ [10,20] │ @@ -411,7 +411,7 @@ FROM nested_test ARRAY JOIN nest AS n, arrayEnumerate(`nest.x`) AS num; ``` -``` +``` ┌─s─────┬─n.x─┬─n.y─┬─nest.x──┬─nest.y─────┬─num─┐ │ Hello │ 1 │ 10 │ [1,2] │ [10,20] │ 1 │ │ Hello │ 2 │ 20 │ [1,2] │ [10,20] │ 2 │ @@ -669,11 +669,53 @@ When external aggregation is enabled, if there was less than ` max_bytes_before_ If you have an ORDER BY with a small LIMIT after GROUP BY, then the ORDER BY CLAUSE will not use significant amounts of RAM. But if the ORDER BY doesn't have LIMIT, don't forget to enable external sorting (`max_bytes_before_external_sort`). -### LIMIT N BY Clause +### LIMIT BY Clause -LIMIT N BY COLUMNS selects the top N rows for each group of COLUMNS. LIMIT N BY is not related to LIMIT; they can both be used in the same query. The key for LIMIT N BY can contain any number of columns or expressions. +The query with the `LIMIT n BY columns` clause selects the top `n` rows for each group of `columns`. `LIMIT BY` is not related to `LIMIT`, they can both be used in the same query. The key for `LIMIT BY` can contain any number of columns or expressions. -Example: +ClickHouse supports the following syntax: + +- `LIMIT [offset_value, ]n BY columns` +- `LIMIT n OFFSET offset_value BY columns` + +The `OFFSET` value sets the number of rows which ClickHouse skips from the beginning of the output. + +**Examples** + +Sample table: + +```sql +CREATE TABLE limit_by(id Int, val Int) ENGINE = Memory; +INSERT INTO limit_by values(1, 10), (1, 11), (1, 12), (2, 20), (2, 21); +``` + +Queries: + +```sql +SELECT * FROM limit_by ORDER BY id, val LIMIT 2 BY id +``` +```text +┌─id─┬─val─┐ +│ 1 │ 10 │ +│ 1 │ 11 │ +│ 2 │ 20 │ +│ 2 │ 21 │ +└────┴─────┘ +``` +```sql +SELECT * FROM limit_by ORDER BY id, val LIMIT 1, 2 BY id +``` +```text +┌─id─┬─val─┐ +│ 1 │ 11 │ +│ 1 │ 12 │ +│ 2 │ 21 │ +└────┴─────┘ +``` + +The `SELECT * FROM limit_by ORDER BY id, val LIMIT 2 OFFSET 1 BY id` query returns the same result. + +The following query returns the top 5 referrers for each `domain, device_type` pair, but not more than 100 rows (`LIMIT n BY + LIMIT`). ``` sql SELECT @@ -688,8 +730,6 @@ LIMIT 5 BY domain, device_type LIMIT 100 ``` -The query will select the top 5 referrers for each `domain, device_type` pair, but not more than 100 rows (`LIMIT n BY + LIMIT`). - ### HAVING Clause Allows filtering the result received after GROUP BY, similar to the WHERE clause. From 82974e5ed82d4f0af77f78b28d87ae74074d1150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=A3=8E=E5=95=B8?= Date: Tue, 7 May 2019 16:24:55 +0800 Subject: [PATCH 088/194] zhdocs: translate zh collapsingmergetree.md (#5168) * translate zh collapsingmergetree.md and fix zh attention format * fix the create table link --- .../table_engines/collapsingmergetree.md | 6 +- .../table_engines/collapsingmergetree.md | 116 +++++++++--------- .../table_engines/custom_partitioning_key.md | 4 +- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/docs/en/operations/table_engines/collapsingmergetree.md b/docs/en/operations/table_engines/collapsingmergetree.md index 2c65183de9d..cf521ac4cd1 100644 --- a/docs/en/operations/table_engines/collapsingmergetree.md +++ b/docs/en/operations/table_engines/collapsingmergetree.md @@ -110,9 +110,9 @@ When ClickHouse merges data parts, each group of consecutive rows with the same For each resulting data part ClickHouse saves: 1. The first "cancel" and the last "state" rows, if the number of "state" and "cancel" rows matches. - 1. The last "state" row, if there is one more "state" row than "cancel" rows. - 1. The first "cancel" row, if there is one more "cancel" row than "state" rows. - 1. None of the rows, in all other cases. + 2. The last "state" row, if there is one more "state" row than "cancel" rows. + 3. The first "cancel" row, if there is one more "cancel" row than "state" rows. + 4. None of the rows, in all other cases. The merge continues, but ClickHouse treats this situation as a logical error and records it in the server log. This error can occur if the same data were inserted more than once. diff --git a/docs/zh/operations/table_engines/collapsingmergetree.md b/docs/zh/operations/table_engines/collapsingmergetree.md index 8fd80265168..ce22aeadf29 100644 --- a/docs/zh/operations/table_engines/collapsingmergetree.md +++ b/docs/zh/operations/table_engines/collapsingmergetree.md @@ -1,12 +1,12 @@ # CollapsingMergeTree {#table_engine-collapsingmergetree} -The engine inherits from [MergeTree](mergetree.md) and adds the logic of rows collapsing to data parts merge algorithm. +该引擎继承于 [MergeTree](mergetree.md),并在数据块合并算法中添加了折叠行的逻辑。 -`CollapsingMergeTree` asynchronously deletes (collapses) pairs of rows if all of the fields in a row are equivalent excepting the particular field `Sign` which can have `1` and `-1` values. Rows without a pair are kept. For more details see the [Collapsing](#collapsing) section of the document. +`CollapsingMergeTree` 会异步的删除(折叠)这些除了特定列 `Sign` 有 `1` 和 `-1` 的值以外,其余所有字段的值都相等的成对的行。没有成对的行会被保留。更多的细节请看本文的[折叠](#table_engine-collapsingmergetree-collapsing)部分。 -The engine may significantly reduce the volume of storage and increase efficiency of `SELECT` query as a consequence. +因此,该引擎可以显著的降低存储量并提高 `SELECT` 查询效率。 -## Creating a Table +## 建表 ```sql CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] @@ -21,22 +21,22 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] [SETTINGS name=value, ...] ``` -For a description of request parameters, see [request description](../../query_language/create.md). +请求参数的描述,参考[请求参数](../../query_language/create.md)。 -**CollapsingMergeTree Parameters** +**CollapsingMergeTree 参数** -- `sign` — Name of the column with the type of row: `1` is a "state" row, `-1` is a "cancel" row. +- `sign` — 类型列的名称: `1` 是“状态”行,`-1` 是“取消”行。 - Column data type — `Int8`. + 列数据类型 — `Int8`。 -**Query clauses** +**子句** -When creating a `CollapsingMergeTree` table, the same [clauses](mergetree.md) are required, as when creating a `MergeTree` table. +创建 `CollapsingMergeTree` 表时,需要与创建 `MergeTree` 表时相同的[子句](mergetree.md#table_engine-mergetree-creating-a-table)。 -
Deprecated Method for Creating a Table +
已弃用的建表方法 -!!! attention - Do not use this method in new projects and, if possible, switch the old projects to the method described above. +!!! attention "注意" + 不要在新项目中使用该方法,可能的话,请将旧项目切换到上述方法。 ```sql CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] @@ -47,23 +47,23 @@ CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster] ) ENGINE [=] CollapsingMergeTree(date-column [, sampling_expression], (primary, key), index_granularity, sign) ``` -All of the parameters excepting `sign` have the same meaning as in `MergeTree`. +除了 `sign` 的所有参数都与 `MergeTree` 中的含义相同。 -- `sign` — Name of the column with the type of row: `1` — "state" row, `-1` — "cancel" row. +- `sign` — 类型列的名称: `1` 是“状态”行,`-1` 是“取消”行。 - Column Data Type — `Int8`. + 列数据类型 — `Int8`。
-## Collapsing +## 折叠 {#table_engine-collapsingmergetree-collapsing} -### Data +### 数据 -Consider the situation where you need to save continually changing data for some object. It sounds logical to have one row for an object and update it at any change, but update operation is expensive and slow for DBMS because it requires rewriting of the data in the storage. If you need to write data quickly, update not acceptable, but you can write the changes of an object sequentially as follows. +考虑你需要为某个对象保存不断变化的数据的情景。似乎为一个对象保存一行记录并在其发生任何变化时更新记录是合乎逻辑的,但是更新操作对 DBMS 来说是昂贵且缓慢的,因为它需要重写存储中的数据。如果你需要快速的写入数据,则更新操作是不可接受的,但是你可以按下面的描述顺序地更新一个对象的变化。 -Use the particular column `Sign` when writing row. If `Sign = 1` it means that the row is a state of an object, let's call it "state" row. If `Sign = -1` it means the cancellation of the state of an object with the same attributes, let's call it "cancel" row. +在写入行的时候使用特定的列 `Sign`。如果 `Sign = 1` 则表示这一行是对象的状态,我们称之为“状态”行。如果 `Sign = -1` 则表示是对具有相同属性的状态行的取消,我们称之为“取消”行。 -For example, we want to calculate how much pages users checked at some site and how long they were there. At some moment of time we write the following row with the state of user activity: +例如,我们想要计算用户在某个站点访问的页面页面数以及他们在那里停留的时间。在某个时候,我们将用户的活动状态写入下面这样的行。 ``` ┌──────────────UserID─┬─PageViews─┬─Duration─┬─Sign─┐ @@ -71,7 +71,7 @@ For example, we want to calculate how much pages users checked at some site and └─────────────────────┴───────────┴──────────┴──────┘ ``` -At some moment later we register the change of user activity and write it with the following two rows. +一段时间后,我们写入下面的两行来记录用户活动的变化。 ``` ┌──────────────UserID─┬─PageViews─┬─Duration─┬─Sign─┐ @@ -80,11 +80,11 @@ At some moment later we register the change of user activity and write it with t └─────────────────────┴───────────┴──────────┴──────┘ ``` -The first row cancels the previous state of the object (user). It should copy all of the fields of the canceled state excepting `Sign`. +第一行取消了这个对象(用户)的状态。它需要复制被取消的状态行的所有除了 `Sign` 的属性。 -The second row contains the current state. +第二行包含了当前的状态。 -As we need only the last state of user activity, the rows +因为我们只需要用户活动的最后状态,这些行 ``` ┌──────────────UserID─┬─PageViews─┬─Duration─┬─Sign─┐ @@ -93,43 +93,43 @@ As we need only the last state of user activity, the rows └─────────────────────┴───────────┴──────────┴──────┘ ``` -can be deleted collapsing the invalid (old) state of an object. `CollapsingMergeTree` does this while merging of the data parts. +可以在折叠对象的失效(老的)状态的时候被删除。`CollapsingMergeTree` 会在合并数据片段的时候做这件事。 -Why we need 2 rows for each change read in the "Algorithm" paragraph. +为什么我们每次改变需要 2 行可以阅读[算法](#table_engine-collapsingmergetree-collapsing-algorithm)段。 -**Peculiar properties of such approach** +**这种方法的特殊属性** -1. The program that writes the data should remember the state of an object to be able to cancel it. "Cancel" string should be the copy of "state" string with the opposite `Sign`. It increases the initial size of storage but allows to write the data quickly. -2. Long growing arrays in columns reduce the efficiency of the engine due to load for writing. The more straightforward data, the higher efficiency. -3. `SELECT` results depend strongly on the consistency of object changes history. Be accurate when preparing data for inserting. You can get unpredictable results in inconsistent data, for example, negative values for non-negative metrics such as session depth. +1. 写入的程序应该记住对象的状态从而可以取消它。“取消”字符串应该是“状态”字符串的复制,除了相反的 `Sign`。它增加了存储的初始数据的大小,但使得写入数据更快速。 +2. 由于写入的负载,列中长的增长阵列会降低引擎的效率。数据越简单,效率越高。 +3. `SELECT` 的结果很大程度取决于对象变更历史的一致性。在准备插入数据时要准确。在不一致的数据中会得到不可预料的结果,例如,像会话深度这种非负指标的负值。 -### Algorithm +### 算法 {#table_engine-collapsingmergetree-collapsing-algorithm} -When ClickHouse merges data parts, each group of consecutive rows with the same primary key is reduced to not more than two rows, one with `Sign = 1` ("state" row) and another with `Sign = -1` ("cancel" row). In other words, entries collapse. +当 ClickHouse 合并数据片段时,每组具有相同主键的连续行被减少到不超过两行,一行 `Sign = 1`(“状态”行),另一行 `Sign = -1` (“取消”行),换句话说,数据项被折叠了。 -For each resulting data part ClickHouse saves: +对每个结果的数据部分 ClickHouse 保存: - 1. The first "cancel" and the last "state" rows, if the number of "state" and "cancel" rows matches. - 1. The last "state" row, if there is one more "state" row than "cancel" rows. - 1. The first "cancel" row, if there is one more "cancel" row than "state" rows. - 1. None of the rows, in all other cases. + 1. 第一个“取消”和最后一个“状态”行,如果“状态”和“取消”行的数量匹配 + 2. 最后一个“状态”行,如果“状态”行比“取消”行多一个。 + 3. 第一个“取消”行,如果“取消”行比“状态”行多一个。 + 4. 没有行,在其他所有情况下。 - The merge continues, but ClickHouse treats this situation as a logical error and records it in the server log. This error can occur if the same data were inserted more than once. + 合并会继续,但是 ClickHouse 会把此情况视为逻辑错误并将其记录在服务日志中。这个错误会在相同的数据被插入超过一次时出现。 -Thus, collapsing should not change the results of calculating statistics. -Changes gradually collapsed so that in the end only the last state of almost every object left. +因此,折叠不应该改变统计数据的结果。 +变化逐渐地被折叠,因此最终几乎每个对象都只剩下了最后的状态。 -The `Sign` is required because the merging algorithm doesn't guarantee that all of the rows with the same primary key will be in the same resulting data part and even on the same physical server. ClickHouse process `SELECT` queries with multiple threads, and it can not predict the order of rows in the result. The aggregation is required if there is a need to get completely "collapsed" data from `CollapsingMergeTree` table. +`Sign` 是必须的因为合并算法不保证所有有相同主键的行都会在同一个结果数据片段中,甚至是在同一台物理服务器上。ClickHouse 用多线程来处理 `SELECT` 请求,所以它不能预测结果中行的顺序。如果要从 `CollapsingMergeTree` 表中获取完全“折叠”后的数据,则需要聚合。 -To finalize collapsing write a query with `GROUP BY` clause and aggregate functions that account for the sign. For example, to calculate quantity, use `sum(Sign)` instead of `count()`. To calculate the sum of something, use `sum(Sign * x)` instead of `sum(x)`, and so on, and also add `HAVING sum(Sign) > 0`. +要完成折叠,请使用 `GROUP BY` 子句和用于处理符号的聚合函数编写请求。例如,要计算数量,使用 `sum(Sign)` 而不是 `count()`。要计算某物的总和,使用 `sum(Sign * x)` 而不是 `sum(x)`,并添加 `HAVING sum(Sign) > 0` 子句。 -The aggregates `count`, `sum` and `avg` could be calculated this way. The aggregate `uniq` could be calculated if an object has at list one state not collapsed. The aggregates `min` and `max` could not be calculated because `CollapsingMergeTree` does not save values history of the collapsed states. +聚合体 `count`,`sum` 和 `avg` 可以用这种方式计算。如果一个对象至少有一个未被折叠的状态,则可以计算 `uniq` 聚合。`min` 和 `max` 聚合无法计算,因为 `CollaspingMergeTree` 不会保存折叠状态的值的历史记录。 -If you need to extract data without aggregation (for example, to check whether rows are present whose newest values match certain conditions), you can use the `FINAL` modifier for the `FROM` clause. This approach is significantly less efficient. +如果你需要在不进行聚合的情况下获取数据(例如,要检查是否存在最新值与特定条件匹配的行),你可以在 `FROM` 从句中使用 `FINAL` 修饰符。这种方法显然是更低效的。 -## Example of use +## 示例 -Example data: +示例数据: ``` ┌──────────────UserID─┬─PageViews─┬─Duration─┬─Sign─┐ @@ -139,7 +139,7 @@ Example data: └─────────────────────┴───────────┴──────────┴──────┘ ``` -Creation of the table: +建表: ```sql CREATE TABLE UAct @@ -153,7 +153,7 @@ ENGINE = CollapsingMergeTree(Sign) ORDER BY UserID ``` -Insertion of the data: +插入数据: ```sql INSERT INTO UAct VALUES (4324182021466249494, 5, 146, 1) @@ -162,9 +162,9 @@ INSERT INTO UAct VALUES (4324182021466249494, 5, 146, 1) INSERT INTO UAct VALUES (4324182021466249494, 5, 146, -1),(4324182021466249494, 6, 185, 1) ``` -We use two `INSERT` queries to create two different data parts. If we insert the data with one query ClickHouse creates one data part and will not perform any merge ever. +我们使用两次 `INSERT` 请求来创建两个不同的数据片段。如果我们使用一个请求插入数据,ClickHouse 只会创建一个数据片段且不会执行任何合并操作。 -Getting the data: +获取数据: ``` SELECT * FROM UAct @@ -180,11 +180,11 @@ SELECT * FROM UAct └─────────────────────┴───────────┴──────────┴──────┘ ``` -What do we see and where is collapsing? -With two `INSERT` queries, we created 2 data parts. The `SELECT` query was performed in 2 threads, and we got a random order of rows. -Collapsing not occurred because there was no merge of the data parts yet. ClickHouse merges data part in an unknown moment of time which we can not predict. +我们看到了什么,哪里有折叠? -Thus we need aggregation: +通过两个 `INSERT` 请求,我们创建了两个数据片段。`SELECT` 请求在两个线程中被执行,我们得到了随机顺序的行。没有发生折叠是因为还没有合并数据片段。ClickHouse 在一个我们无法预料的未知时刻合并数据片段。 + +因此我们需要聚合: ```sql SELECT @@ -201,7 +201,7 @@ HAVING sum(Sign) > 0 └─────────────────────┴───────────┴──────────┘ ``` -If we do not need aggregation and want to force collapsing, we can use `FINAL` modifier for `FROM` clause. +如果我们不需要聚合并想要强制进行折叠,我们可以在 `FROM` 从句中使用 `FINAL` 修饰语。 ```sql SELECT * FROM UAct FINAL @@ -212,6 +212,6 @@ SELECT * FROM UAct FINAL └─────────────────────┴───────────┴──────────┴──────┘ ``` -This way of selecting the data is very inefficient. Don't use it for big tables. +这种查询数据的方法是非常低效的。不要在大表中使用它。 -[Original article](https://clickhouse.yandex/docs/en/operations/table_engines/collapsingmergetree/) +[来源文章](https://clickhouse.yandex/docs/en/operations/table_engines/collapsingmergetree/) diff --git a/docs/zh/operations/table_engines/custom_partitioning_key.md b/docs/zh/operations/table_engines/custom_partitioning_key.md index 8ee25c19944..8f43f4068b8 100644 --- a/docs/zh/operations/table_engines/custom_partitioning_key.md +++ b/docs/zh/operations/table_engines/custom_partitioning_key.md @@ -30,7 +30,7 @@ ORDER BY (CounterID, StartDate, intHash32(UserID)); 新数据插入到表中时,这些数据会存储为按主键排序的新片段(块)。插入后 10-15 分钟,同一分区的各个片段会合并为一整个片段。 -!!! 注意 +!!! attention "注意" 那些有相同分区表达式值的数据片段才会合并。这意味着 **你不应该用太精细的分区方案**(超过一千个分区)。否则,会因为文件系统中的文件数量和需要找开的文件描述符过多,导致 `SELECT` 查询效率不佳。 可以通过 [system.parts](../system_tables.md#system_tables-parts) 表查看表片段和分区信息。例如,假设我们有一个 `visits` 表,按月分区。对 `system.parts` 表执行 `SELECT`: @@ -67,7 +67,7 @@ WHERE table = 'visits' - `3` 是数据块的最大编号。 - `1` 是块级别(即在由块组成的合并树中,该块在树中的深度)。 -!!! 注意 +!!! attention "注意" 旧类型表的片段名称为:`20190117_20190123_2_2_0`(最小日期 - 最大日期 - 最小块编号 - 最大块编号 - 块级别)。 `active` 列为片段状态。`1` 激活状态;`0` 非激活状态。非激活片段是那些在合并到较大片段之后剩余的源数据片段。损坏的数据片段也表示为非活动状态。 From 3893a4943d5b282b04898595b6aa252dc88ef431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=81=A5?= Date: Tue, 7 May 2019 16:27:24 +0800 Subject: [PATCH 089/194] Fix nulls_in test case. --- .../queries/0_stateless/00441_nulls_in.reference | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00441_nulls_in.reference b/dbms/tests/queries/0_stateless/00441_nulls_in.reference index 81e812f596f..591e55ae41a 100644 --- a/dbms/tests/queries/0_stateless/00441_nulls_in.reference +++ b/dbms/tests/queries/0_stateless/00441_nulls_in.reference @@ -5,12 +5,12 @@ 0 0 1 -0 +\N 1 0 0 1 -0 +\N 1 0 0 @@ -27,7 +27,7 @@ 1 0 1 -0 +\N 0 1 0 @@ -35,12 +35,12 @@ 0 0 1 -0 +\N 1 0 0 1 -0 +\N 1 0 0 @@ -57,7 +57,7 @@ 1 0 1 -0 +\N 0 1 0 From dc508220c9cb201c8c20361c22975d53cfb48c68 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Tue, 7 May 2019 17:40:19 +0300 Subject: [PATCH 090/194] DOCAPI-6554. Clarification of text. --- docs/en/query_language/select.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/en/query_language/select.md b/docs/en/query_language/select.md index cbcc5974f20..418b726d8c1 100644 --- a/docs/en/query_language/select.md +++ b/docs/en/query_language/select.md @@ -671,14 +671,16 @@ But if the ORDER BY doesn't have LIMIT, don't forget to enable external sorting ### LIMIT BY Clause -The query with the `LIMIT n BY columns` clause selects the top `n` rows for each group of `columns`. `LIMIT BY` is not related to `LIMIT`, they can both be used in the same query. The key for `LIMIT BY` can contain any number of columns or expressions. +The query with the `LIMIT n BY expressions` clause selects the first `n` rows for each distinct value of `expressions`. The key for `LIMIT BY` can contain any number of [expressions](syntax.md#syntax-expressions). ClickHouse supports the following syntax: -- `LIMIT [offset_value, ]n BY columns` -- `LIMIT n OFFSET offset_value BY columns` +- `LIMIT [offset_value, ]n BY expressions` +- `LIMIT n OFFSET offset_value BY expressions` -The `OFFSET` value sets the number of rows which ClickHouse skips from the beginning of the output. +During the query processing, ClickHouse selects data ordered by sorting key. Sorting key is set explicitly by [ORDER BY](#select-order-by) clause or implicitly as a property of table engine. Then ClickHouse applies `LIMIT n BY expressions` and returns the first `n` rows for each distinct combination of `expressions`. If `OFFSET` is specified, then for each data block, belonging to a distinct combination of `expressions`, ClickHouse skips `offset_value` rows from the beginning of the block, and returns not more than `n` rows as a result. If `offset_value` is bigger than the number of rows in the data block, then ClickHouse returns no rows from the block. + +`LIMIT BY` is not related to `LIMIT`, they can both be used in the same query. **Examples** @@ -737,7 +739,7 @@ WHERE and HAVING differ in that WHERE is performed before aggregation (GROUP BY) If aggregation is not performed, HAVING can't be used. -### ORDER BY Clause +### ORDER BY Clause {#select-order-by} The ORDER BY clause contains a list of expressions, which can each be assigned DESC or ASC (the sorting direction). If the direction is not specified, ASC is assumed. ASC is sorted in ascending order, and DESC in descending order. The sorting direction applies to a single expression, not to the entire list. Example: `ORDER BY Visits DESC, SearchPhrase` From 6bf5e1dd260ee1458324873f35162b6db245cfdb Mon Sep 17 00:00:00 2001 From: Winter Zhang Date: Tue, 7 May 2019 23:30:15 +0800 Subject: [PATCH 091/194] ISSUES-5062 fix cmake failure on osx (#5215) --- contrib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index abae6f7deec..e553773e84a 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -227,7 +227,7 @@ if (USE_INTERNAL_POCO_LIBRARY) set (ENABLE_TESTS 0) set (POCO_ENABLE_TESTS 0) set (CMAKE_DISABLE_FIND_PACKAGE_ZLIB 1) - if (MSVC) + if (MSVC OR NOT USE_POCO_DATAODBC) set (ENABLE_DATA_ODBC 0 CACHE INTERNAL "") # TODO (build fail) endif () add_subdirectory (poco) From 74feef7e53d7adb3fc4eebcf76ce82b1bac71ebc Mon Sep 17 00:00:00 2001 From: chertus Date: Tue, 7 May 2019 21:21:44 +0300 Subject: [PATCH 092/194] Join.h refactoring: remove unneeded specialisations --- dbms/src/Interpreters/Join.cpp | 9 +-- dbms/src/Interpreters/Join.h | 125 ++++++++++++++++++--------------- 2 files changed, 70 insertions(+), 64 deletions(-) diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp index 08d42331795..02557b5f01f 100644 --- a/dbms/src/Interpreters/Join.cpp +++ b/dbms/src/Interpreters/Join.cpp @@ -377,11 +377,11 @@ namespace template struct Inserter { - static ALWAYS_INLINE void insert(const Join &, Map & map, KeyGetter & key_getter, Block * stored_block, size_t i, Arena & pool) + static ALWAYS_INLINE void insert(const Join & join, Map & map, KeyGetter & key_getter, Block * stored_block, size_t i, Arena & pool) { auto emplace_result = key_getter.emplaceKey(map, i, pool); - if (emplace_result.isInserted() || emplace_result.getMapped().overwrite) + if (emplace_result.isInserted() || join.anyTakeLastRow()) new (&emplace_result.getMapped()) typename Map::mapped_type(stored_block, i); } }; @@ -1078,10 +1078,7 @@ void Join::joinGet(Block & block, const String & column_name) const if (kind == ASTTableJoin::Kind::Left && strictness == ASTTableJoin::Strictness::Any) { - if (any_take_last_row) - joinGetImpl(block, column_name, std::get(maps)); - else - joinGetImpl(block, column_name, std::get(maps)); + joinGetImpl(block, column_name, std::get(maps)); } else throw Exception("joinGet only supports StorageJoin of type Left Any", ErrorCodes::LOGICAL_ERROR); diff --git a/dbms/src/Interpreters/Join.h b/dbms/src/Interpreters/Join.h index 7a223f46b35..f910adf824a 100644 --- a/dbms/src/Interpreters/Join.h +++ b/dbms/src/Interpreters/Join.h @@ -25,6 +25,45 @@ namespace DB { + +namespace JoinStuff +{ +/** Depending on template parameter, adds or doesn't add a flag, that element was used (row was joined). + * Depending on template parameter, decide whether to overwrite existing values when encountering the same key again + * with_used is for implementation of RIGHT and FULL JOINs. + * NOTE: It is possible to store the flag in one bit of pointer to block or row_num. It seems not reasonable, because memory saving is minimal. + */ +template +struct WithFlags; + +template +struct WithFlags : Base +{ + mutable std::atomic used {}; + using Base::Base; + using Base_t = Base; + void setUsed() const { used.store(true, std::memory_order_relaxed); } /// Could be set simultaneously from different threads. + bool getUsed() const { return used; } +}; + +template +struct WithFlags : Base +{ + using Base::Base; + using Base_t = Base; + void setUsed() const {} + bool getUsed() const { return true; } +}; + + +using MappedAny = WithFlags; +using MappedAll = WithFlags; +using MappedAnyFull = WithFlags; +using MappedAllFull = WithFlags; +using MappedAsof = WithFlags; + +} + /** Data structure for implementation of JOIN. * It is just a hash table: keys -> rows of joined ("right") table. * Additionally, CROSS JOIN is supported: instead of hash table, it use just set of blocks without keys. @@ -132,36 +171,7 @@ public: ASTTableJoin::Kind getKind() const { return kind; } AsofRowRefs::Type getAsofType() const { return *asof_type; } - - /** Depending on template parameter, adds or doesn't add a flag, that element was used (row was joined). - * Depending on template parameter, decide whether to overwrite existing values when encountering the same key again - * with_used is for implementation of RIGHT and FULL JOINs. - * overwrite is for implementation of StorageJoin with overwrite setting enabled - * NOTE: It is possible to store the flag in one bit of pointer to block or row_num. It seems not reasonable, because memory saving is minimal. - */ - template - struct WithFlags; - - template - struct WithFlags : Base - { - static constexpr bool overwrite = overwrite_; - mutable std::atomic used {}; - using Base::Base; - using Base_t = Base; - void setUsed() const { used.store(true, std::memory_order_relaxed); } /// Could be set simultaneously from different threads. - bool getUsed() const { return used; } - }; - - template - struct WithFlags : Base - { - static constexpr bool overwrite = overwrite_; - using Base::Base; - using Base_t = Base; - void setUsed() const {} - bool getUsed() const { return true; } - }; + bool anyTakeLastRow() const { return any_take_last_row; } /// Different types of keys for maps. #define APPLY_FOR_JOIN_VARIANTS(M) \ @@ -257,13 +267,11 @@ public: } }; - using MapsAny = MapsTemplate>; - using MapsAnyOverwrite = MapsTemplate>; - using MapsAll = MapsTemplate>; - using MapsAnyFull = MapsTemplate>; - using MapsAnyFullOverwrite = MapsTemplate>; - using MapsAllFull = MapsTemplate>; - using MapsAsof = MapsTemplate>; + using MapsAny = MapsTemplate; + using MapsAll = MapsTemplate; + using MapsAnyFull = MapsTemplate; + using MapsAllFull = MapsTemplate; + using MapsAsof = MapsTemplate; template struct KindTrait @@ -276,13 +284,14 @@ public: static constexpr bool fill_right = static_in_v; }; - template + template struct MapGetterImpl; - template - using Map = typename MapGetterImpl::fill_right, strictness, overwrite>::Map; + template + using Map = typename MapGetterImpl::fill_right, strictness>::Map; - static constexpr std::array STRICTNESSES = {ASTTableJoin::Strictness::Any, ASTTableJoin::Strictness::All, ASTTableJoin::Strictness::Asof}; + static constexpr std::array STRICTNESSES + = {ASTTableJoin::Strictness::Any, ASTTableJoin::Strictness::All, ASTTableJoin::Strictness::Asof}; static constexpr std::array KINDS = {ASTTableJoin::Kind::Left, ASTTableJoin::Kind::Inner, ASTTableJoin::Kind::Full, ASTTableJoin::Kind::Right}; @@ -298,12 +307,12 @@ public: if (kind == KINDS[i] && strictness == ASTTableJoin::Strictness::Any) { if constexpr (std::is_same_v) - maps = Map(); + maps = Map(); else func( std::integral_constant(), std::integral_constant(), - std::get>(maps)); + std::get>(maps)); return true; } return false; @@ -320,12 +329,12 @@ public: if (kind == KINDS[i] && strictness == STRICTNESSES[j]) { if constexpr (std::is_same_v) - maps = Map(); + maps = Map(); else func( std::integral_constant(), std::integral_constant(), - std::get>(maps)); + std::get>(maps)); return true; } return false; @@ -359,7 +368,7 @@ private: */ BlocksList blocks; - std::variant maps; + std::variant maps; /// Additional data - strings for string keys and continuation elements of single-linked lists of references to rows. Arena pool; @@ -421,32 +430,32 @@ private: using JoinPtr = std::shared_ptr; using Joins = std::vector; -template -struct Join::MapGetterImpl +template <> +struct Join::MapGetterImpl { - using Map = std::conditional_t; -}; - -template -struct Join::MapGetterImpl -{ - using Map = std::conditional_t; + using Map = MapsAny; }; template <> -struct Join::MapGetterImpl +struct Join::MapGetterImpl +{ + using Map = MapsAnyFull; +}; + +template <> +struct Join::MapGetterImpl { using Map = MapsAll; }; template <> -struct Join::MapGetterImpl +struct Join::MapGetterImpl { using Map = MapsAllFull; }; template -struct Join::MapGetterImpl +struct Join::MapGetterImpl { using Map = MapsAsof; }; From 5bde1c69ab983c3e5768ef9631b6e483f296df0b Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Tue, 7 May 2019 23:41:15 +0300 Subject: [PATCH 093/194] last try? --- dbms/src/Storages/StorageMergeTree.cpp | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 347b2d3245a..16e74c266ed 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -209,25 +209,13 @@ std::vector StorageMergeTree::prepar size_t thread_pool_size = std::min(parts.size(), settings.max_alter_threads); ThreadPool thread_pool(thread_pool_size); - /*for (const auto & part : parts) - transactions.push_back(std::make_unique(part)); - - for (size_t i = 0; i < parts.size(); ++i) - { - thread_pool.schedule( - [this, i, &transactions, &columns_for_parts, &new_indices = new_indices.indices] - { - this->data.alterDataPart(columns_for_parts, new_indices, false, transactions[i]); - } - ); - }*/ for (const auto & part : parts) { transactions.push_back(std::make_unique(part)); thread_pool.schedule( - [this, &transaction = transactions.back(), columns_for_parts, new_indices = new_indices.indices] + [this, &transaction = transactions.back(), &columns_for_parts, &new_indices = new_indices.indices] { this->data.alterDataPart(columns_for_parts, new_indices, false, transaction); } @@ -236,14 +224,14 @@ std::vector StorageMergeTree::prepar thread_pool.wait(); - /*auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), + auto erase_pos = std::remove_if(transactions.begin(), transactions.end(), [](const MergeTreeData::AlterDataPartTransactionPtr & transaction) { return !transaction->isValid(); } ); transactions.erase(erase_pos, transactions.end()); - */ + return transactions; } From 3ff89198b7d4d045089131ba4269ac81de90fd82 Mon Sep 17 00:00:00 2001 From: BayoNet Date: Wed, 8 May 2019 01:50:37 +0300 Subject: [PATCH 094/194] DOCAPI-6207: JDBC engine EN description (#5112) * DOCAPI-6207: JDBC engine EN description. * DOCAPI-6207: Edits after review. --- docs/en/interfaces/formats.md | 3 +- docs/en/operations/table_engines/jdbc.md | 80 +++++++++++++++++++ docs/en/operations/table_engines/mergetree.md | 10 +-- docs/ru/interfaces/formats.md | 3 +- docs/toc_en.yml | 1 + 5 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 docs/en/operations/table_engines/jdbc.md diff --git a/docs/en/interfaces/formats.md b/docs/en/interfaces/formats.md index ef8964270df..38e8ab3194a 100644 --- a/docs/en/interfaces/formats.md +++ b/docs/en/interfaces/formats.md @@ -351,7 +351,8 @@ CREATE TABLE IF NOT EXISTS example_table - If `input_format_defaults_for_omitted_fields = 0`, then the default value for `x` and `a` equals `0` (as the default value for the `UInt32` data type). - If `input_format_defaults_for_omitted_fields = 1`, then the default value for `x` equals `0`, but the default value of `a` equals `x * 2`. -Enabling the option can affect the performance of inserts. +!!! note "Warning" + When inserting data with `insert_sample_with_metadata = 1`, ClickHouse consumes more computational resources, compared to insertion with `insert_sample_with_metadata = 0`. ### Selecting Data diff --git a/docs/en/operations/table_engines/jdbc.md b/docs/en/operations/table_engines/jdbc.md new file mode 100644 index 00000000000..4b5c3206d3e --- /dev/null +++ b/docs/en/operations/table_engines/jdbc.md @@ -0,0 +1,80 @@ +# JDBC + +Allows ClickHouse to connect to external databases via [JDBC](https://en.wikipedia.org/wiki/Java_Database_Connectivity). + +To implement JDBC connection, ClickHouse uses the separate program [clickhouse-jdbc-bridge](https://github.com/alex-krash/clickhouse-jdbc-bridge). You should run it as a daemon. + +This engine supports the [Nullable](../../data_types/nullable.md) data type. + +## Creating a Table + +``` +CREATE TABLE [IF NOT EXISTS] [db.]table_name ENGINE = JDBC(dbms_uri, external_database, external_table) +``` + +**Engine Parameters** + +- `dbms_uri` — URI of an external DBMS. + + Format: `jdbc:://:/?user=&password=`. + Example for MySQL: `jdbc:mysql://localhost:3306/?user=root&password=root`. + +- `external_database` — Database in an external DBMS. +- `external_table` — A name of the table in `external_database`. + +## Usage Example + +Creating a table in MySQL (using native MySQL engine): + +``` +mysql> CREATE TABLE `test`.`test` ( + -> `int_id` INT NOT NULL AUTO_INCREMENT, + -> `int_nullable` INT NULL DEFAULT NULL, + -> `float` FLOAT NOT NULL, + -> `float_nullable` FLOAT NULL DEFAULT NULL, + -> PRIMARY KEY (`int_id`)); +Query OK, 0 rows affected (0,09 sec) + +mysql> insert into test (`int_id`, `float`) VALUES (1,2); +Query OK, 1 row affected (0,00 sec) + +mysql> select * from test; ++--------+--------------+-------+----------------+ +| int_id | int_nullable | float | float_nullable | ++--------+--------------+-------+----------------+ +| 1 | NULL | 2 | NULL | ++--------+--------------+-------+----------------+ +1 row in set (0,00 sec) +``` + +Selecting data from the table in ClickHouse: + +``` +CREATE TABLE jdbc_table ENGINE JDBC('jdbc:mysql://localhost:3306/?user=root&password=root', 'test', 'test') + +Ok. + +DESCRIBE TABLE jdbc_table + +┌─name───────────────┬─type───────────────┬─default_type─┬─default_expression─┐ +│ int_id │ Int32 │ │ │ +│ int_nullable │ Nullable(Int32) │ │ │ +│ float │ Float32 │ │ │ +│ float_nullable │ Nullable(Float32) │ │ │ +└────────────────────┴────────────────────┴──────────────┴────────────────────┘ + +10 rows in set. Elapsed: 0.031 sec. + +SELECT * +FROM jdbc_table + +┌─int_id─┬─int_nullable─┬─float─┬─float_nullable─┐ +│ 1 │ ᴺᵁᴸᴸ │ 2 │ ᴺᵁᴸᴸ │ +└────────┴──────────────┴───────┴────────────────┘ + +1 rows in set. Elapsed: 0.055 sec. +``` + +## See Also + +- [JDBC table function](../../query_language/table_functions/jdbc.md). diff --git a/docs/en/operations/table_engines/mergetree.md b/docs/en/operations/table_engines/mergetree.md index f0167140a0e..b02e4189a12 100644 --- a/docs/en/operations/table_engines/mergetree.md +++ b/docs/en/operations/table_engines/mergetree.md @@ -49,7 +49,7 @@ For a description of request parameters, see [request description](../../query_l **Query clauses** -- `ENGINE` - Name and parameters of the engine. `ENGINE = MergeTree()`. `MergeTree` engine does not have parameters. +- `ENGINE` — Name and parameters of the engine. `ENGINE = MergeTree()`. `MergeTree` engine does not have parameters. - `PARTITION BY` — The [partitioning key](custom_partitioning_key.md). @@ -59,7 +59,7 @@ For a description of request parameters, see [request description](../../query_l A tuple of columns or arbitrary expressions. Example: `ORDER BY (CounterID, EventDate)`. -- `PRIMARY KEY` - The primary key if it [differs from the sorting key](mergetree.md). +- `PRIMARY KEY` — The primary key if it [differs from the sorting key](mergetree.md). By default the primary key is the same as the sorting key (which is specified by the `ORDER BY` clause). Thus in most cases it is unnecessary to specify a separate `PRIMARY KEY` clause. @@ -67,7 +67,7 @@ For a description of request parameters, see [request description](../../query_l If a sampling expression is used, the primary key must contain it. Example: `SAMPLE BY intHash32(UserID) ORDER BY (CounterID, EventDate, intHash32(UserID))`. -- `TTL` - An expression for setting storage time for rows. +- `TTL` — An expression for setting storage time for rows. It must depends on `Date` or `DateTime` column and has one `Date` or `DateTime` column as a result. Example: `TTL date + INTERVAL 1 DAY` @@ -78,7 +78,7 @@ For a description of request parameters, see [request description](../../query_l - `index_granularity` — The granularity of an index. The number of data rows between the "marks" of an index. By default, 8192. The list of all available parameters you can see in [MergeTreeSettings.h](https://github.com/yandex/ClickHouse/blob/master/dbms/src/Storages/MergeTree/MergeTreeSettings.h). - `use_minimalistic_part_header_in_zookeeper` — Storage method of the data parts headers in ZooKeeper. If `use_minimalistic_part_header_in_zookeeper=1`, then ZooKeeper stores less data. For more information refer the [setting description](../server_settings/settings.md#server-settings-use_minimalistic_part_header_in_zookeeper) in the "Server configuration parameters" chapter. - `min_merge_bytes_to_use_direct_io` — The minimum data volume for merge operation required for using of the direct I/O access to the storage disk. During the merging of the data parts, ClickHouse calculates summary storage volume of all the data to be merged. If the volume exceeds `min_merge_bytes_to_use_direct_io` bytes, then ClickHouse reads and writes the data using direct I/O interface (`O_DIRECT` option) to the storage disk. If `min_merge_bytes_to_use_direct_io = 0`, then the direct I/O is disabled. Default value: `10 * 1024 * 1024 * 1024` bytes. - - `merge_with_ttl_timeout` - Minimal time in seconds, when merge with TTL can be repeated. Default value: 86400 (1 day). + - `merge_with_ttl_timeout` — Minimal time in seconds, when merge with TTL can be repeated. Default value: 86400 (1 day). **Example of sections setting** @@ -310,7 +310,7 @@ Reading from a table is automatically parallelized. ## TTL for columns and tables -Data with expired TTL is removed while executing merges. +Data with expired TTL is removed while executing merges. If TTL is set for column, when it expires, value will be replaced by default. If all values in columns were zeroed in part, data for this column will be deleted from disk for part. You are not allowed to set TTL for all key columns. If TTL is set for table, when it expires, row will be deleted. diff --git a/docs/ru/interfaces/formats.md b/docs/ru/interfaces/formats.md index ce6cc59e93d..abaa8fd8fdd 100644 --- a/docs/ru/interfaces/formats.md +++ b/docs/ru/interfaces/formats.md @@ -349,7 +349,8 @@ CREATE TABLE IF NOT EXISTS example_table - Если `input_format_defaults_for_omitted_fields = 0`, то значение по умолчанию для `x` и `a` равняется `0` (поскольку это значение по умолчанию для типа данных `UInt32`.) - Если `input_format_defaults_for_omitted_fields = 1`, то значение по умолчанию для `x` равно `0`, а значение по умолчанию `a` равно `x * 2`. -Включение этой опции может негативно влиять на производительность вставок. +!!! note "Предупреждение" + Если `insert_sample_with_metadata = 1`, то при обработке запросов ClickHouse потребляет больше вычислительных ресурсов, чем если `insert_sample_with_metadata = 0`. ### Выборка данных diff --git a/docs/toc_en.yml b/docs/toc_en.yml index a67bc9cd309..5de621a80ee 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -91,6 +91,7 @@ nav: - 'MaterializedView': 'operations/table_engines/materializedview.md' - 'Memory': 'operations/table_engines/memory.md' - 'Buffer': 'operations/table_engines/buffer.md' + - 'JDBC': 'operations/table_engines/jdbc.md' - 'SQL Reference': - 'hidden': 'query_language/index.md' From bd76d27305efdd81bc3065e3d883a6f4e5f4e7ce Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 8 May 2019 10:40:27 +0300 Subject: [PATCH 095/194] Apple build fix --- cmake/find_icu.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/find_icu.cmake b/cmake/find_icu.cmake index 39991eef87d..d83a7ba4cb4 100644 --- a/cmake/find_icu.cmake +++ b/cmake/find_icu.cmake @@ -1,6 +1,9 @@ option(ENABLE_ICU "Enable ICU" ON) if(ENABLE_ICU) + if (APPLE) + set(ICU_ROOT "/usr/local/opt/icu4c" CACHE STRING "") + endif() find_package(ICU COMPONENTS i18n uc data) # TODO: remove Modules/FindICU.cmake after cmake 3.7 #set (ICU_LIBRARIES ${ICU_I18N_LIBRARY} ${ICU_UC_LIBRARY} ${ICU_DATA_LIBRARY} CACHE STRING "") if(ICU_FOUND) From aeee7a00a66ff2b6087cd97a586d6582adf842f0 Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 8 May 2019 10:45:52 +0300 Subject: [PATCH 096/194] wip --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b45792ef76..d04f858d627 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ project(ClickHouse) cmake_minimum_required(VERSION 3.3) cmake_policy(SET CMP0023 NEW) +cmake_policy(SET CMP0074 NEW) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") set(CMAKE_EXPORT_COMPILE_COMMANDS 1) # Write compile_commands.json set(CMAKE_LINK_DEPENDS_NO_SHARED 1) # Do not relink all depended targets on .so From cfb330eeb50e9468a99a125f394e1d2aedc2a9ca Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 8 May 2019 10:51:03 +0300 Subject: [PATCH 097/194] fix --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d04f858d627..df012c7a8af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,15 @@ project(ClickHouse) cmake_minimum_required(VERSION 3.3) -cmake_policy(SET CMP0023 NEW) -cmake_policy(SET CMP0074 NEW) + +foreach(policy + CMP0023 + CMP0074 # CMake 3.12 + ) + if(POLICY ${policy}) + cmake_policy(SET ${policy} NEW) + endif() +endforeach() + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") set(CMAKE_EXPORT_COMPILE_COMMANDS 1) # Write compile_commands.json set(CMAKE_LINK_DEPENDS_NO_SHARED 1) # Do not relink all depended targets on .so From b9385f9620d26808279b330e7bea8b03f48adbc6 Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 8 May 2019 13:09:41 +0300 Subject: [PATCH 098/194] Disable test in macos --- dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp b/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp index 66e4a1e5a6d..382182e8cbf 100644 --- a/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp +++ b/dbms/src/IO/tests/gtest_aio_seek_back_after_eof.cpp @@ -1,3 +1,5 @@ +#if defined(__linux__) || defined(__FreeBSD__) + #pragma GCC diagnostic ignored "-Wsign-compare" #ifdef __clang__ #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" @@ -69,3 +71,5 @@ TEST(ReadBufferAIOTest, TestReadAfterAIO) EXPECT_EQ(read_after_eof_big, data.length()); EXPECT_TRUE(testbuf.eof()); } + +#endif From 4969ad2f98c6e6f3e69a850a1e134046fa029cf8 Mon Sep 17 00:00:00 2001 From: chertus Date: Wed, 8 May 2019 13:53:45 +0300 Subject: [PATCH 099/194] correct comment & some renames --- dbms/src/Interpreters/Join.cpp | 4 ++-- dbms/src/Interpreters/Join.h | 38 +++++++++++++++---------------- dbms/src/Storages/StorageJoin.cpp | 2 +- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp index 02557b5f01f..0a56a208bf0 100644 --- a/dbms/src/Interpreters/Join.cpp +++ b/dbms/src/Interpreters/Join.cpp @@ -659,7 +659,7 @@ void addFoundRow(const typename Map::mapped_type & mapped, AddedColumns & added, if constexpr (STRICTNESS == ASTTableJoin::Strictness::All) { - for (auto current = &static_cast(mapped); current != nullptr; current = current->next) + for (auto current = &static_cast(mapped); current != nullptr; current = current->next) { added.appendFromBlock(*current->block, current->row_num); ++current_offset; @@ -1153,7 +1153,7 @@ struct AdderNonJoined { static void add(const Mapped & mapped, size_t & rows_added, MutableColumns & columns_right) { - for (auto current = &static_cast(mapped); current != nullptr; current = current->next) + for (auto current = &static_cast(mapped); current != nullptr; current = current->next) { for (size_t j = 0; j < columns_right.size(); ++j) columns_right[j]->insertFrom(*current->block->getByPosition(j).column.get(), current->row_num); diff --git a/dbms/src/Interpreters/Join.h b/dbms/src/Interpreters/Join.h index f910adf824a..cd0632527fd 100644 --- a/dbms/src/Interpreters/Join.h +++ b/dbms/src/Interpreters/Join.h @@ -28,39 +28,37 @@ namespace DB namespace JoinStuff { -/** Depending on template parameter, adds or doesn't add a flag, that element was used (row was joined). - * Depending on template parameter, decide whether to overwrite existing values when encountering the same key again - * with_used is for implementation of RIGHT and FULL JOINs. - * NOTE: It is possible to store the flag in one bit of pointer to block or row_num. It seems not reasonable, because memory saving is minimal. - */ -template + +/// Base class with optional flag attached that's needed to implement RIGHT and FULL JOINs. +template struct WithFlags; -template -struct WithFlags : Base +template +struct WithFlags : T { + using Base = T; + using T::T; + mutable std::atomic used {}; - using Base::Base; - using Base_t = Base; void setUsed() const { used.store(true, std::memory_order_relaxed); } /// Could be set simultaneously from different threads. bool getUsed() const { return used; } }; -template -struct WithFlags : Base +template +struct WithFlags : T { - using Base::Base; - using Base_t = Base; + using Base = T; + using T::T; + void setUsed() const {} bool getUsed() const { return true; } }; - -using MappedAny = WithFlags; -using MappedAll = WithFlags; -using MappedAnyFull = WithFlags; -using MappedAllFull = WithFlags; -using MappedAsof = WithFlags; +using MappedAny = WithFlags; +using MappedAll = WithFlags; +using MappedAnyFull = WithFlags; +using MappedAllFull = WithFlags; +using MappedAsof = WithFlags; } diff --git a/dbms/src/Storages/StorageJoin.cpp b/dbms/src/Storages/StorageJoin.cpp index 14184d8971f..e7debe45107 100644 --- a/dbms/src/Storages/StorageJoin.cpp +++ b/dbms/src/Storages/StorageJoin.cpp @@ -338,7 +338,7 @@ private: throw Exception("ASOF join storage is not implemented yet", ErrorCodes::NOT_IMPLEMENTED); } else - for (auto current = &static_cast(it->getSecond()); current != nullptr; + for (auto current = &static_cast(it->getSecond()); current != nullptr; current = current->next) { for (size_t j = 0; j < columns.size(); ++j) From 10c349e398111b522c20db3852455d067f7d9471 Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 8 May 2019 15:26:35 +0300 Subject: [PATCH 100/194] Fix macos build --- .../MergeTreeBaseSelectBlockInputStream.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp b/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp index 82518b077c5..22b4eedb3b5 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp @@ -88,26 +88,26 @@ Block MergeTreeBaseSelectBlockInputStream::readFromPart() /// Calculates number of rows will be read using preferred_block_size_bytes. /// Can't be less than avg_index_granularity. - UInt64 rows_to_read = current_task.size_predictor->estimateNumRows(current_preferred_block_size_bytes); + auto rows_to_read = current_task.size_predictor->estimateNumRows(current_preferred_block_size_bytes); if (!rows_to_read) return rows_to_read; - UInt64 total_row_in_current_granule = current_reader.numRowsInCurrentGranule(); - rows_to_read = std::max(total_row_in_current_granule, rows_to_read); + auto total_row_in_current_granule = current_reader.numRowsInCurrentGranule(); + rows_to_read = std::max(total_row_in_current_granule, rows_to_read); if (current_preferred_max_column_in_block_size_bytes) { /// Calculates number of rows will be read using preferred_max_column_in_block_size_bytes. - UInt64 rows_to_read_for_max_size_column + auto rows_to_read_for_max_size_column = current_task.size_predictor->estimateNumRowsForMaxSizeColumn(current_preferred_max_column_in_block_size_bytes); double filtration_ratio = std::max(min_filtration_ratio, 1.0 - current_task.size_predictor->filtered_rows_ratio); auto rows_to_read_for_max_size_column_with_filtration - = static_cast(rows_to_read_for_max_size_column / filtration_ratio); + = static_cast(rows_to_read_for_max_size_column / filtration_ratio); /// If preferred_max_column_in_block_size_bytes is used, number of rows to read can be less than current_index_granularity. rows_to_read = std::min(rows_to_read, rows_to_read_for_max_size_column_with_filtration); } - UInt64 unread_rows_in_current_granule = current_reader.numPendingRowsInCurrentGranule(); + auto unread_rows_in_current_granule = current_reader.numPendingRowsInCurrentGranule(); if (unread_rows_in_current_granule >= rows_to_read) return rows_to_read; From 560246c0c30102f92c4b93077fbc019b12940b1a Mon Sep 17 00:00:00 2001 From: hcz Date: Thu, 14 Mar 2019 10:55:04 +0800 Subject: [PATCH 101/194] Add Simdjson API --- contrib/CMakeLists.txt | 2 + contrib/simdjson | 1 + dbms/src/Functions/FunctionsJSON.cpp | 429 ++++++++++++++++++ dbms/src/Functions/FunctionsJSON.h | 227 +++++++++ dbms/src/Functions/registerFunctions.cpp | 2 + .../00918_json_simdjson_api.reference | 16 + .../0_stateless/00918_json_simdjson_api.sql | 16 + 7 files changed, 693 insertions(+) create mode 160000 contrib/simdjson create mode 100644 dbms/src/Functions/FunctionsJSON.cpp create mode 100644 dbms/src/Functions/FunctionsJSON.h create mode 100644 dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference create mode 100644 dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index e553773e84a..f7c6c0dc2c5 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -313,3 +313,5 @@ endif() if (USE_INTERNAL_HYPERSCAN_LIBRARY) add_subdirectory (hyperscan) endif() +add_subdirectory (simdjson) +set (SIMDJSON_BUILD_STATIC ON CACHE INTERNAL "") diff --git a/contrib/simdjson b/contrib/simdjson new file mode 160000 index 00000000000..b0c43028875 --- /dev/null +++ b/contrib/simdjson @@ -0,0 +1 @@ +Subproject commit b0c43028875e40461046774318088666e6284c52 diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp new file mode 100644 index 00000000000..2f6d9f0d4b2 --- /dev/null +++ b/dbms/src/Functions/FunctionsJSON.cpp @@ -0,0 +1,429 @@ +#include + +#include +#include +#include +#include +#include +#include + + +namespace DB +{ + +template +class JSONNullableImplBase +{ +public: + static DataTypePtr getType() + { + return std::make_shared( + std::make_shared() + ); + } + + static Field getDefault() + { + return {}; + } +}; + +class JSONHasImpl: public JSONNullableImplBase +{ +public: + static constexpr auto name {"jsonHas"}; + + static Field getValue(ParsedJson::iterator &) + { + return {1}; + } +}; + +class JSONLengthImpl: public JSONNullableImplBase +{ +public: + static constexpr auto name {"jsonLength"}; + + static Field getValue(ParsedJson::iterator & pjh) + { + if (!pjh.is_object_or_array()) + return getDefault(); + + size_t size = 0; + + if (pjh.down()) + { + size += 1; + + while (pjh.next()) + size += 1; + } + + return {size}; + } +}; + +class JSONTypeImpl: public JSONNullableImplBase +{ +public: + static constexpr auto name {"jsonType"}; + + static Field getValue(ParsedJson::iterator & pjh) + { + // types: [{"sltfn + return pjh.get_type(); + } +}; + +class JSONExtractImpl +{ +public: + static constexpr auto name {"jsonExtract"}; + + static DataTypePtr getType(const DataTypePtr & type) + { + WhichDataType which { + type + }; + + if (which.isNativeUInt()) + return std::make_shared( + std::make_shared() + ); + + if (which.isNativeInt()) + return std::make_shared( + std::make_shared() + ); + + if (which.isFloat()) + return std::make_shared( + std::make_shared() + ); + + if ( + which.isEnum() + || which.isDateOrDateTime() + || which.isStringOrFixedString() + || which.isInterval() + ) + return std::make_shared( + type + ); + + if (which.isArray()) + { + auto array_type { + static_cast(type.get()) + }; + + return std::make_shared( + getType(array_type->getNestedType()) + ); + } + + if (which.isTuple()) + { + auto tuple_type { + static_cast(type.get()) + }; + + DataTypes types; + types.reserve(tuple_type->getElements().size()); + + for (const DataTypePtr & element: tuple_type->getElements()) + { + types.push_back(getType(element)); + } + + return std::make_shared( + std::move(types) + ); + } + + throw Exception { + "Unsupported return type schema: " + type->getName(), + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT + }; + } + + static Field getDefault(const DataTypePtr & type) + { + WhichDataType which { + type + }; + + if ( + which.isNativeUInt() + || which.isNativeInt() + || which.isFloat() + || which.isEnum() + || which.isDateOrDateTime() + || which.isStringOrFixedString() + || which.isInterval() + ) + return {}; + + if (which.isArray()) + return {Array {}}; + + if (which.isTuple()) + { + auto tuple_type { + static_cast(type.get()) + }; + + Tuple tuple; + tuple.toUnderType().reserve(tuple_type->getElements().size()); + + for (const DataTypePtr & element: tuple_type->getElements()) + tuple.toUnderType().push_back(getDefault(element)); + + return {tuple}; + } + + // should not reach + throw Exception { + "Unsupported return type schema: " + type->getName(), + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT + }; + } + + static Field getValue(ParsedJson::iterator & pjh, const DataTypePtr & type) + { + WhichDataType which { + type + }; + + if ( + which.isNativeUInt() + || which.isNativeInt() + || which.isEnum() + || which.isDateOrDateTime() + || which.isInterval() + ) + { + if (pjh.is_integer()) + return {pjh.get_integer()}; + else + return getDefault(type); + } + + if (which.isFloat()) + { + if (pjh.is_integer()) + return {(double) pjh.get_integer()}; + else if (pjh.is_double()) + return {pjh.get_double()}; + else + return getDefault(type); + } + + if (which.isStringOrFixedString()) + { + if (pjh.is_string()) + return {String {pjh.get_string()}}; + else + return getDefault(type); + + } + + if (which.isArray()) + { + if (!pjh.is_object_or_array()) + return getDefault(type); + + auto array_type { + static_cast(type.get()) + }; + + Array array; + + bool first = true; + + while (first ? pjh.down() : pjh.next()) + { + first = false; + + ParsedJson::iterator pjh1 { + pjh + }; + + array.push_back(getValue(pjh1, array_type->getNestedType())); + } + + return {array}; + } + + if (which.isTuple()) + { + if (!pjh.is_object_or_array()) + return getDefault(type); + + auto tuple_type { + static_cast(type.get()) + }; + + Tuple tuple; + tuple.toUnderType().reserve(tuple_type->getElements().size()); + + bool valid = true; + bool first = true; + + for (const DataTypePtr & element: tuple_type->getElements()) + { + if (valid) + { + valid &= first ? pjh.down() : pjh.next(); + first = false; + + ParsedJson::iterator pjh1 { + pjh + }; + + tuple.toUnderType().push_back(getValue(pjh1, element)); + } + else + tuple.toUnderType().push_back(getDefault(element)); + } + + return {tuple}; + } + + // should not reach + throw Exception { + "Unsupported return type schema: " + type->getName(), + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT + }; + } +}; + +class JSONExtractUIntImpl: public JSONNullableImplBase +{ +public: + static constexpr auto name {"jsonExtractUInt"}; + + static Field getValue(ParsedJson::iterator & pjh) + { + if (pjh.is_integer()) + return {pjh.get_integer()}; + else + return getDefault(); + } +}; + +class JSONExtractIntImpl: public JSONNullableImplBase +{ +public: + static constexpr auto name {"jsonExtractInt"}; + + static Field getValue(ParsedJson::iterator & pjh) + { + if (pjh.is_integer()) + return {pjh.get_integer()}; + else + return getDefault(); + } +}; + +class JSONExtractFloatImpl: public JSONNullableImplBase +{ +public: + static constexpr auto name {"jsonExtractFloat"}; + + static Field getValue(ParsedJson::iterator & pjh) + { + if (pjh.is_double()) + return {pjh.get_double()}; + else + return getDefault(); + } +}; + +class JSONExtractBoolImpl: public JSONNullableImplBase +{ +public: + static constexpr auto name {"jsonExtractBool"}; + + static Field getValue(ParsedJson::iterator & pjh) + { + if (pjh.get_type() == 't') + return {1}; + else if (pjh.get_type() == 'f') + return {0}; + else + return getDefault(); + } +}; + +// class JSONExtractRawImpl: public JSONNullableImplBase +// { +// public: +// static constexpr auto name {"jsonExtractRaw"}; + +// static Field getValue(ParsedJson::iterator & pjh) +// { +// // +// } +// }; + +class JSONExtractStringImpl: public JSONNullableImplBase +{ +public: + static constexpr auto name {"jsonExtractString"}; + + static Field getValue(ParsedJson::iterator & pjh) + { + if (pjh.is_string()) + return {String {pjh.get_string()}}; + else + return getDefault(); + + } +}; + +void registerFunctionsJSON(FunctionFactory & factory) +{ + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + // factory.registerFunction>(); + factory.registerFunction>(); +} + +} diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h new file mode 100644 index 00000000000..b6c8f952f1e --- /dev/null +++ b/dbms/src/Functions/FunctionsJSON.h @@ -0,0 +1,227 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include +#include + + +namespace DB +{ + +namespace ErrorCodes +{ + extern const int ILLEGAL_TYPE_OF_ARGUMENT; + extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; +} + +template +class FunctionJSONBase : public IFunction +{ +private: + enum class Action + { + key = 1, + index = 2, + }; + + mutable std::vector actions; + mutable DataTypePtr virtual_type; + + bool tryMove( + ParsedJson::iterator & pjh, + Action action, + const Field & accessor + ) + { + switch (action) + { + case Action::key: + if ( + !pjh.is_object() + || !pjh.move_to_key(accessor.get().data()) + ) + return false; + + break; + case Action::index: + if ( + !pjh.is_object_or_array() + || !pjh.down() + ) + return false; + + int steps = accessor.get(); + + if (steps > 0) + steps -= 1; + else if (steps < 0) + { + steps += 1; + + ParsedJson::iterator pjh1 { + pjh + }; + + while (pjh1.next()) + steps += 1; + } + else + return false; + + for (const auto i : ext::range(0, steps)) + { + (void) i; + + if (!pjh.next()) + return false; + } + + break; + } + + return true; + } + +public: + static constexpr auto name = Impl::name; + + static FunctionPtr create(const Context &) + { + return std::make_shared(); + } + + String getName() const override + { + return Impl::name; + } + + bool isVariadic() const override + { + return true; + } + + size_t getNumberOfArguments() const override + { + return 0; + } + + bool useDefaultImplementationForConstants() const override + { + return true; + } + + DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override + { + if constexpr (ExtraArg) + { + if (arguments.size() < 2) + throw Exception { + "Function " + getName() + " requires at least two arguments", + ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH + }; + + virtual_type = arguments[1]; + } + else + { + if (arguments.size() < 1) + throw Exception { + "Function " + getName() + " requires at least one arguments", + ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH + }; + } + + if (!isString(arguments[0])) + throw Exception { + "Illegal type " + arguments[0]->getName() + + " of argument of function " + getName(), + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT + }; + + actions.reserve(arguments.size() - 1 - ExtraArg); + + for (const auto i : ext::range(1 + ExtraArg, arguments.size())) + { + if (isString(arguments[i])) + actions.push_back(Action::key); + else if (isInteger(arguments[i])) + actions.push_back(Action::index); + else + throw Exception { + "Illegal type " + arguments[i]->getName() + + " of argument of function " + getName(), + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT + }; + } + + if constexpr (ExtraArg) + return Impl::getType(virtual_type); + else + return Impl::getType(); + } + + void executeImpl( + Block & block, + const ColumnNumbers & arguments, + size_t result_pos, + size_t input_rows_count + ) override + { + MutableColumnPtr to { + block.getByPosition(result_pos).type->createColumn() + }; + to->reserve(input_rows_count); + + const ColumnPtr & arg_json = block.getByPosition(arguments[0]).column; + + for (const auto i : ext::range(0, input_rows_count)) + { + // TODO: avoid multiple memory allocation? + ParsedJson pj { + build_parsed_json((*arg_json)[i].get()) + }; + ParsedJson::iterator pjh { + pj + }; + + bool ok = true; + + for (const auto j : ext::range(0, actions.size())) + { + ok = tryMove( + pjh, + actions[j], + (*block.getByPosition(arguments[j + 1 + ExtraArg]).column)[i] + ); + + if (!ok) + break; + } + + if (ok) + { + if constexpr (ExtraArg) + to->insert(Impl::getValue(pjh, virtual_type)); + else + to->insert(Impl::getValue(pjh)); + } + else + { + if constexpr (ExtraArg) + to->insert(Impl::getDefault(virtual_type)); + else + to->insert(Impl::getDefault()); + } + } + + block.getByPosition(result_pos).column = std::move(to); + } +}; + +} diff --git a/dbms/src/Functions/registerFunctions.cpp b/dbms/src/Functions/registerFunctions.cpp index 4fa77aaa02d..af1bd6a34cf 100644 --- a/dbms/src/Functions/registerFunctions.cpp +++ b/dbms/src/Functions/registerFunctions.cpp @@ -40,6 +40,7 @@ void registerFunctionsMath(FunctionFactory &); void registerFunctionsGeo(FunctionFactory &); void registerFunctionsNull(FunctionFactory &); void registerFunctionsFindCluster(FunctionFactory &); +void registerFunctionsJSON(FunctionFactory &); void registerFunctionTransform(FunctionFactory &); #if USE_ICU @@ -82,6 +83,7 @@ void registerFunctions() registerFunctionsGeo(factory); registerFunctionsNull(factory); registerFunctionsFindCluster(factory); + registerFunctionsJSON(factory); registerFunctionTransform(factory); #if USE_ICU diff --git a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference new file mode 100644 index 00000000000..85ae16b842c --- /dev/null +++ b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference @@ -0,0 +1,16 @@ +4 +123 +1 +1 +a +hello +hello +3 +91 +-100 +200 +300 +('a','hello','b',[-100,200,300]) +[-100,NULL,300] +['a','hello','b',NULL] +[(NULL,NULL,NULL),(NULL,NULL,NULL),(NULL,NULL,NULL),(-100,200,300)] diff --git a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql new file mode 100644 index 00000000000..6fad2e5ce42 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql @@ -0,0 +1,16 @@ +select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}'); +select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}'); +select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'a'); +select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b'); +select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1); +select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 2); +select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a'); +select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b'); +select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b'); +select jsonExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1); +select jsonExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2); +select jsonExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1); +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', ('', '', '', [0.0])); +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', [-0], 'b'); +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', ['']); +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', [(-0, 0.0, 0)]); From 7308415bc77f4ec99fad01bffbc4e69d252ea199 Mon Sep 17 00:00:00 2001 From: hcz Date: Thu, 14 Mar 2019 11:21:46 +0800 Subject: [PATCH 102/194] Update gitmodules --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitmodules b/.gitmodules index 6b6b734989d..e19f56837da 100644 --- a/.gitmodules +++ b/.gitmodules @@ -79,3 +79,6 @@ [submodule "contrib/hyperscan"] path = contrib/hyperscan url = https://github.com/ClickHouse-Extras/hyperscan.git +[submodule "contrib/simdjson"] + path = contrib/simdjson + url = https://github.com/lemire/simdjson.git From 789b48410838d1c7815c238881539f09d789e7cd Mon Sep 17 00:00:00 2001 From: hcz Date: Thu, 14 Mar 2019 12:48:30 +0800 Subject: [PATCH 103/194] Fix cmakelists --- dbms/src/Functions/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbms/src/Functions/CMakeLists.txt b/dbms/src/Functions/CMakeLists.txt index 513cb2002a1..6a7f327ac56 100644 --- a/dbms/src/Functions/CMakeLists.txt +++ b/dbms/src/Functions/CMakeLists.txt @@ -69,3 +69,6 @@ if (USE_HYPERSCAN) target_link_libraries (clickhouse_functions PRIVATE ${HYPERSCAN_LIBRARY}) target_include_directories (clickhouse_functions SYSTEM PRIVATE ${HYPERSCAN_INCLUDE_DIR}) endif () + +target_include_directories(clickhouse_functions PRIVATE "${PROJECT_SOURCE_DIR}/contrib/simdjson/include") +target_link_libraries(clickhouse_functions PRIVATE simdjson) From e1a236f55c63cd05e9f65d48be224a6f213eb699 Mon Sep 17 00:00:00 2001 From: hcz Date: Thu, 14 Mar 2019 13:48:29 +0800 Subject: [PATCH 104/194] Update API --- dbms/src/Functions/FunctionsJSON.cpp | 20 ++++-------------- dbms/src/Functions/FunctionsJSON.h | 31 +++++++++++++++++++++------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp index 2f6d9f0d4b2..c3d535384b4 100644 --- a/dbms/src/Functions/FunctionsJSON.cpp +++ b/dbms/src/Functions/FunctionsJSON.cpp @@ -86,23 +86,11 @@ public: type }; - if (which.isNativeUInt()) - return std::make_shared( - std::make_shared() - ); - - if (which.isNativeInt()) - return std::make_shared( - std::make_shared() - ); - - if (which.isFloat()) - return std::make_shared( - std::make_shared() - ); - if ( - which.isEnum() + which.isNativeUInt() + || which.isNativeInt() + || which.isFloat() + || which.isEnum() || which.isDateOrDateTime() || which.isStringOrFixedString() || which.isInterval() diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h index b6c8f952f1e..d009bac7dc6 100644 --- a/dbms/src/Functions/FunctionsJSON.h +++ b/dbms/src/Functions/FunctionsJSON.h @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -116,7 +117,17 @@ public: return true; } - DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override + ColumnNumbers getArgumentsThatAreAlwaysConstant() const override + { + if constexpr (ExtraArg) + return {1}; + else + return {}; + } + + DataTypePtr getReturnTypeImpl( + const ColumnsWithTypeAndName & arguments + ) const override { if constexpr (ExtraArg) { @@ -126,7 +137,13 @@ public: ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH }; - virtual_type = arguments[1]; + auto col_type_const { + static_cast(arguments[1].column.get()) + }; + + virtual_type = DataTypeFactory::instance().get( + col_type_const->getValue() + ); } else { @@ -137,9 +154,9 @@ public: }; } - if (!isString(arguments[0])) + if (!isString(arguments[0].type)) throw Exception { - "Illegal type " + arguments[0]->getName() + "Illegal type " + arguments[0].type->getName() + " of argument of function " + getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT }; @@ -148,13 +165,13 @@ public: for (const auto i : ext::range(1 + ExtraArg, arguments.size())) { - if (isString(arguments[i])) + if (isString(arguments[i].type)) actions.push_back(Action::key); - else if (isInteger(arguments[i])) + else if (isInteger(arguments[i].type)) actions.push_back(Action::index); else throw Exception { - "Illegal type " + arguments[i]->getName() + "Illegal type " + arguments[i].type->getName() + " of argument of function " + getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT }; From b721ae11f5d9c8963600d05f360ffee4204d2b8a Mon Sep 17 00:00:00 2001 From: hcz Date: Thu, 14 Mar 2019 14:19:21 +0800 Subject: [PATCH 105/194] Fix const column detection --- dbms/src/Functions/FunctionsJSON.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h index d009bac7dc6..0b592a8fe15 100644 --- a/dbms/src/Functions/FunctionsJSON.h +++ b/dbms/src/Functions/FunctionsJSON.h @@ -1,11 +1,8 @@ #pragma once #include -#include #include #include -#include -#include #include #include @@ -17,6 +14,7 @@ namespace DB namespace ErrorCodes { + extern const int ILLEGAL_COLUMN; extern const int ILLEGAL_TYPE_OF_ARGUMENT; extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; } @@ -117,14 +115,6 @@ public: return true; } - ColumnNumbers getArgumentsThatAreAlwaysConstant() const override - { - if constexpr (ExtraArg) - return {1}; - else - return {}; - } - DataTypePtr getReturnTypeImpl( const ColumnsWithTypeAndName & arguments ) const override @@ -138,9 +128,16 @@ public: }; auto col_type_const { - static_cast(arguments[1].column.get()) + typeid_cast(arguments[1].column.get()) }; + if (!col_type_const) + throw Exception { + "The second argument for function " + getName() + + " must be constant", + ErrorCodes::ILLEGAL_COLUMN + }; + virtual_type = DataTypeFactory::instance().get( col_type_const->getValue() ); From 8cae381428e0584c06bbe46356f81bfa344c59bd Mon Sep 17 00:00:00 2001 From: hcz Date: Thu, 14 Mar 2019 16:07:25 +0800 Subject: [PATCH 106/194] Performance improvement --- dbms/src/Functions/FunctionsJSON.cpp | 20 +++------ dbms/src/Functions/FunctionsJSON.h | 64 ++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 29 deletions(-) diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp index c3d535384b4..62bb56a9f48 100644 --- a/dbms/src/Functions/FunctionsJSON.cpp +++ b/dbms/src/Functions/FunctionsJSON.cpp @@ -101,9 +101,7 @@ public: if (which.isArray()) { - auto array_type { - static_cast(type.get()) - }; + auto array_type = static_cast(type.get()); return std::make_shared( getType(array_type->getNestedType()) @@ -112,9 +110,7 @@ public: if (which.isTuple()) { - auto tuple_type { - static_cast(type.get()) - }; + auto tuple_type = static_cast(type.get()); DataTypes types; types.reserve(tuple_type->getElements().size()); @@ -157,9 +153,7 @@ public: if (which.isTuple()) { - auto tuple_type { - static_cast(type.get()) - }; + auto tuple_type = static_cast(type.get()); Tuple tuple; tuple.toUnderType().reserve(tuple_type->getElements().size()); @@ -221,9 +215,7 @@ public: if (!pjh.is_object_or_array()) return getDefault(type); - auto array_type { - static_cast(type.get()) - }; + auto array_type = static_cast(type.get()); Array array; @@ -248,9 +240,7 @@ public: if (!pjh.is_object_or_array()) return getDefault(type); - auto tuple_type { - static_cast(type.get()) - }; + auto tuple_type = static_cast(type.get()); Tuple tuple; tuple.toUnderType().reserve(tuple_type->getElements().size()); diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h index 0b592a8fe15..1d70c61b7b1 100644 --- a/dbms/src/Functions/FunctionsJSON.h +++ b/dbms/src/Functions/FunctionsJSON.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include #include @@ -14,6 +15,7 @@ namespace DB namespace ErrorCodes { + extern const int CANNOT_ALLOCATE_MEMORY; extern const int ILLEGAL_COLUMN; extern const int ILLEGAL_TYPE_OF_ARGUMENT; extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; @@ -127,14 +129,14 @@ public: ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH }; - auto col_type_const { - typeid_cast(arguments[1].column.get()) - }; + auto col_type_const = typeid_cast( + arguments[1].column.get() + ); if (!col_type_const) throw Exception { - "The second argument for function " + getName() - + " must be constant", + "Illegal non-const column " + arguments[1].column->getName() + + " of argument of function " + getName(), ErrorCodes::ILLEGAL_COLUMN }; @@ -194,28 +196,62 @@ public: const ColumnPtr & arg_json = block.getByPosition(arguments[0]).column; + auto col_json_const = typeid_cast( + arg_json.get() + ); + + auto col_json_string = typeid_cast( + col_json_const + ? col_json_const->getDataColumnPtr().get() + : arg_json.get() + ); + + if (!col_json_string) + throw Exception { + "Illegal column " + arg_json->getName() + + " of argument of function " + getName(), + ErrorCodes::ILLEGAL_COLUMN + }; + + const ColumnString::Chars & chars = col_json_string->getChars(); + const ColumnString::Offsets & offsets = col_json_string->getOffsets(); + + size_t max_size = 1; + + for (const auto i : ext::range(0, input_rows_count)) + if (max_size < offsets[i] - offsets[i - 1] - 1) + max_size = offsets[i] - offsets[i - 1] - 1; + + ParsedJson pj; + if (!pj.allocateCapacity(max_size)) + throw Exception { + "Can not allocate memory for " + std::to_string(max_size) + + " units when parsing JSON", + ErrorCodes::CANNOT_ALLOCATE_MEMORY + }; + for (const auto i : ext::range(0, input_rows_count)) { - // TODO: avoid multiple memory allocation? - ParsedJson pj { - build_parsed_json((*arg_json)[i].get()) - }; + bool ok = json_parse( + &chars[offsets[i - 1]], + offsets[i] - offsets[i - 1] - 1, + pj + ) == 0; + ParsedJson::iterator pjh { pj }; - bool ok = true; - for (const auto j : ext::range(0, actions.size())) { + if (!ok) + break; + ok = tryMove( pjh, actions[j], (*block.getByPosition(arguments[j + 1 + ExtraArg]).column)[i] ); - - if (!ok) - break; } if (ok) From 706f335042456f5c0dd435e33ef2540624093f3e Mon Sep 17 00:00:00 2001 From: hcz Date: Thu, 14 Mar 2019 16:30:15 +0800 Subject: [PATCH 107/194] Format code and update tests --- dbms/src/Functions/FunctionsJSON.cpp | 193 +++++------------- dbms/src/Functions/FunctionsJSON.h | 147 +++---------- .../00918_json_simdjson_api.reference | 2 +- .../0_stateless/00918_json_simdjson_api.sql | 8 +- 4 files changed, 92 insertions(+), 258 deletions(-) diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp index 62bb56a9f48..2f3c009de2e 100644 --- a/dbms/src/Functions/FunctionsJSON.cpp +++ b/dbms/src/Functions/FunctionsJSON.cpp @@ -2,47 +2,35 @@ #include #include -#include #include #include +#include #include namespace DB { - template class JSONNullableImplBase { public: - static DataTypePtr getType() - { - return std::make_shared( - std::make_shared() - ); - } + static DataTypePtr getType() { return std::make_shared(std::make_shared()); } - static Field getDefault() - { - return {}; - } + static Field getDefault() { return {}; } }; -class JSONHasImpl: public JSONNullableImplBase +class JSONHasImpl : public JSONNullableImplBase { public: - static constexpr auto name {"jsonHas"}; + static constexpr auto name{"jsonHas"}; - static Field getValue(ParsedJson::iterator &) - { - return {1}; - } + static Field getValue(ParsedJson::iterator &) { return {1}; } }; -class JSONLengthImpl: public JSONNullableImplBase +class JSONLengthImpl : public JSONNullableImplBase { public: - static constexpr auto name {"jsonLength"}; + static constexpr auto name{"jsonLength"}; static Field getValue(ParsedJson::iterator & pjh) { @@ -63,10 +51,10 @@ public: } }; -class JSONTypeImpl: public JSONNullableImplBase +class JSONTypeImpl : public JSONNullableImplBase { public: - static constexpr auto name {"jsonType"}; + static constexpr auto name{"jsonType"}; static Field getValue(ParsedJson::iterator & pjh) { @@ -78,34 +66,21 @@ public: class JSONExtractImpl { public: - static constexpr auto name {"jsonExtract"}; + static constexpr auto name{"jsonExtract"}; static DataTypePtr getType(const DataTypePtr & type) { - WhichDataType which { - type - }; + WhichDataType which{type}; - if ( - which.isNativeUInt() - || which.isNativeInt() - || which.isFloat() - || which.isEnum() - || which.isDateOrDateTime() - || which.isStringOrFixedString() - || which.isInterval() - ) - return std::make_shared( - type - ); + if (which.isNativeUInt() || which.isNativeInt() || which.isFloat() || which.isEnum() || which.isDateOrDateTime() + || which.isStringOrFixedString() || which.isInterval()) + return std::make_shared(type); if (which.isArray()) { auto array_type = static_cast(type.get()); - return std::make_shared( - getType(array_type->getNestedType()) - ); + return std::make_shared(getType(array_type->getNestedType())); } if (which.isTuple()) @@ -115,41 +90,27 @@ public: DataTypes types; types.reserve(tuple_type->getElements().size()); - for (const DataTypePtr & element: tuple_type->getElements()) + for (const DataTypePtr & element : tuple_type->getElements()) { types.push_back(getType(element)); } - return std::make_shared( - std::move(types) - ); + return std::make_shared(std::move(types)); } - throw Exception { - "Unsupported return type schema: " + type->getName(), - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT - }; + throw Exception{"Unsupported return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT}; } static Field getDefault(const DataTypePtr & type) { - WhichDataType which { - type - }; + WhichDataType which{type}; - if ( - which.isNativeUInt() - || which.isNativeInt() - || which.isFloat() - || which.isEnum() - || which.isDateOrDateTime() - || which.isStringOrFixedString() - || which.isInterval() - ) + if (which.isNativeUInt() || which.isNativeInt() || which.isFloat() || which.isEnum() || which.isDateOrDateTime() + || which.isStringOrFixedString() || which.isInterval()) return {}; if (which.isArray()) - return {Array {}}; + return {Array{}}; if (which.isTuple()) { @@ -158,32 +119,21 @@ public: Tuple tuple; tuple.toUnderType().reserve(tuple_type->getElements().size()); - for (const DataTypePtr & element: tuple_type->getElements()) + for (const DataTypePtr & element : tuple_type->getElements()) tuple.toUnderType().push_back(getDefault(element)); return {tuple}; } // should not reach - throw Exception { - "Unsupported return type schema: " + type->getName(), - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT - }; + throw Exception{"Unsupported return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT}; } static Field getValue(ParsedJson::iterator & pjh, const DataTypePtr & type) { - WhichDataType which { - type - }; + WhichDataType which{type}; - if ( - which.isNativeUInt() - || which.isNativeInt() - || which.isEnum() - || which.isDateOrDateTime() - || which.isInterval() - ) + if (which.isNativeUInt() || which.isNativeInt() || which.isEnum() || which.isDateOrDateTime() || which.isInterval()) { if (pjh.is_integer()) return {pjh.get_integer()}; @@ -194,7 +144,7 @@ public: if (which.isFloat()) { if (pjh.is_integer()) - return {(double) pjh.get_integer()}; + return {(double)pjh.get_integer()}; else if (pjh.is_double()) return {pjh.get_double()}; else @@ -204,10 +154,9 @@ public: if (which.isStringOrFixedString()) { if (pjh.is_string()) - return {String {pjh.get_string()}}; + return {String{pjh.get_string()}}; else return getDefault(type); - } if (which.isArray()) @@ -225,9 +174,7 @@ public: { first = false; - ParsedJson::iterator pjh1 { - pjh - }; + ParsedJson::iterator pjh1{pjh}; array.push_back(getValue(pjh1, array_type->getNestedType())); } @@ -248,16 +195,14 @@ public: bool valid = true; bool first = true; - for (const DataTypePtr & element: tuple_type->getElements()) + for (const DataTypePtr & element : tuple_type->getElements()) { if (valid) { valid &= first ? pjh.down() : pjh.next(); first = false; - ParsedJson::iterator pjh1 { - pjh - }; + ParsedJson::iterator pjh1{pjh}; tuple.toUnderType().push_back(getValue(pjh1, element)); } @@ -269,17 +214,14 @@ public: } // should not reach - throw Exception { - "Unsupported return type schema: " + type->getName(), - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT - }; + throw Exception{"Unsupported return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT}; } }; -class JSONExtractUIntImpl: public JSONNullableImplBase +class JSONExtractUIntImpl : public JSONNullableImplBase { public: - static constexpr auto name {"jsonExtractUInt"}; + static constexpr auto name{"jsonExtractUInt"}; static Field getValue(ParsedJson::iterator & pjh) { @@ -290,10 +232,10 @@ public: } }; -class JSONExtractIntImpl: public JSONNullableImplBase +class JSONExtractIntImpl : public JSONNullableImplBase { public: - static constexpr auto name {"jsonExtractInt"}; + static constexpr auto name{"jsonExtractInt"}; static Field getValue(ParsedJson::iterator & pjh) { @@ -304,10 +246,10 @@ public: } }; -class JSONExtractFloatImpl: public JSONNullableImplBase +class JSONExtractFloatImpl : public JSONNullableImplBase { public: - static constexpr auto name {"jsonExtractFloat"}; + static constexpr auto name{"jsonExtractFloat"}; static Field getValue(ParsedJson::iterator & pjh) { @@ -318,10 +260,10 @@ public: } }; -class JSONExtractBoolImpl: public JSONNullableImplBase +class JSONExtractBoolImpl : public JSONNullableImplBase { public: - static constexpr auto name {"jsonExtractBool"}; + static constexpr auto name{"jsonExtractBool"}; static Field getValue(ParsedJson::iterator & pjh) { @@ -345,63 +287,34 @@ public: // } // }; -class JSONExtractStringImpl: public JSONNullableImplBase +class JSONExtractStringImpl : public JSONNullableImplBase { public: - static constexpr auto name {"jsonExtractString"}; + static constexpr auto name{"jsonExtractString"}; static Field getValue(ParsedJson::iterator & pjh) { if (pjh.is_string()) - return {String {pjh.get_string()}}; + return {String{pjh.get_string()}}; else return getDefault(); - } }; void registerFunctionsJSON(FunctionFactory & factory) { - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); // factory.registerFunction>(); - factory.registerFunction>(); + factory.registerFunction>(); } - } diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h index 1d70c61b7b1..c9011157d85 100644 --- a/dbms/src/Functions/FunctionsJSON.h +++ b/dbms/src/Functions/FunctionsJSON.h @@ -2,17 +2,16 @@ #include #include -#include #include #include +#include -#include #include +#include namespace DB { - namespace ErrorCodes { extern const int CANNOT_ALLOCATE_MEMORY; @@ -34,27 +33,17 @@ private: mutable std::vector actions; mutable DataTypePtr virtual_type; - bool tryMove( - ParsedJson::iterator & pjh, - Action action, - const Field & accessor - ) + bool tryMove(ParsedJson::iterator & pjh, Action action, const Field & accessor) { switch (action) { case Action::key: - if ( - !pjh.is_object() - || !pjh.move_to_key(accessor.get().data()) - ) + if (!pjh.is_object() || !pjh.move_to_key(accessor.get().data())) return false; break; case Action::index: - if ( - !pjh.is_object_or_array() - || !pjh.down() - ) + if (!pjh.is_object_or_array() || !pjh.down()) return false; int steps = accessor.get(); @@ -65,9 +54,7 @@ private: { steps += 1; - ParsedJson::iterator pjh1 { - pjh - }; + ParsedJson::iterator pjh1{pjh}; while (pjh1.next()) steps += 1; @@ -77,7 +64,7 @@ private: for (const auto i : ext::range(0, steps)) { - (void) i; + (void)i; if (!pjh.next()) return false; @@ -92,73 +79,40 @@ private: public: static constexpr auto name = Impl::name; - static FunctionPtr create(const Context &) - { - return std::make_shared(); - } + static FunctionPtr create(const Context &) { return std::make_shared(); } - String getName() const override - { - return Impl::name; - } + String getName() const override { return Impl::name; } - bool isVariadic() const override - { - return true; - } + bool isVariadic() const override { return true; } - size_t getNumberOfArguments() const override - { - return 0; - } + size_t getNumberOfArguments() const override { return 0; } - bool useDefaultImplementationForConstants() const override - { - return true; - } + bool useDefaultImplementationForConstants() const override { return true; } - DataTypePtr getReturnTypeImpl( - const ColumnsWithTypeAndName & arguments - ) const override + DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override { if constexpr (ExtraArg) { if (arguments.size() < 2) - throw Exception { - "Function " + getName() + " requires at least two arguments", - ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH - }; + throw Exception{"Function " + getName() + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH}; - auto col_type_const = typeid_cast( - arguments[1].column.get() - ); + auto col_type_const = typeid_cast(arguments[1].column.get()); if (!col_type_const) - throw Exception { - "Illegal non-const column " + arguments[1].column->getName() - + " of argument of function " + getName(), - ErrorCodes::ILLEGAL_COLUMN - }; + throw Exception{"Illegal non-const column " + arguments[1].column->getName() + " of argument of function " + getName(), + ErrorCodes::ILLEGAL_COLUMN}; - virtual_type = DataTypeFactory::instance().get( - col_type_const->getValue() - ); + virtual_type = DataTypeFactory::instance().get(col_type_const->getValue()); } else { if (arguments.size() < 1) - throw Exception { - "Function " + getName() + " requires at least one arguments", - ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH - }; + throw Exception{"Function " + getName() + " requires at least one arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH}; } if (!isString(arguments[0].type)) - throw Exception { - "Illegal type " + arguments[0].type->getName() - + " of argument of function " + getName(), - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT - }; + throw Exception{"Illegal type " + arguments[0].type->getName() + " of argument of function " + getName(), + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT}; actions.reserve(arguments.size() - 1 - ExtraArg); @@ -169,11 +123,8 @@ public: else if (isInteger(arguments[i].type)) actions.push_back(Action::index); else - throw Exception { - "Illegal type " + arguments[i].type->getName() - + " of argument of function " + getName(), - ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT - }; + throw Exception{"Illegal type " + arguments[i].type->getName() + " of argument of function " + getName(), + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT}; } if constexpr (ExtraArg) @@ -182,36 +133,20 @@ public: return Impl::getType(); } - void executeImpl( - Block & block, - const ColumnNumbers & arguments, - size_t result_pos, - size_t input_rows_count - ) override + void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result_pos, size_t input_rows_count) override { - MutableColumnPtr to { - block.getByPosition(result_pos).type->createColumn() - }; + MutableColumnPtr to{block.getByPosition(result_pos).type->createColumn()}; to->reserve(input_rows_count); const ColumnPtr & arg_json = block.getByPosition(arguments[0]).column; - auto col_json_const = typeid_cast( - arg_json.get() - ); + auto col_json_const = typeid_cast(arg_json.get()); - auto col_json_string = typeid_cast( - col_json_const - ? col_json_const->getDataColumnPtr().get() - : arg_json.get() - ); + auto col_json_string + = typeid_cast(col_json_const ? col_json_const->getDataColumnPtr().get() : arg_json.get()); if (!col_json_string) - throw Exception { - "Illegal column " + arg_json->getName() - + " of argument of function " + getName(), - ErrorCodes::ILLEGAL_COLUMN - }; + throw Exception{"Illegal column " + arg_json->getName() + " of argument of function " + getName(), ErrorCodes::ILLEGAL_COLUMN}; const ColumnString::Chars & chars = col_json_string->getChars(); const ColumnString::Offsets & offsets = col_json_string->getOffsets(); @@ -224,34 +159,21 @@ public: ParsedJson pj; if (!pj.allocateCapacity(max_size)) - throw Exception { - "Can not allocate memory for " + std::to_string(max_size) - + " units when parsing JSON", - ErrorCodes::CANNOT_ALLOCATE_MEMORY - }; + throw Exception{"Can not allocate memory for " + std::to_string(max_size) + " units when parsing JSON", + ErrorCodes::CANNOT_ALLOCATE_MEMORY}; for (const auto i : ext::range(0, input_rows_count)) { - bool ok = json_parse( - &chars[offsets[i - 1]], - offsets[i] - offsets[i - 1] - 1, - pj - ) == 0; + bool ok = json_parse(&chars[offsets[i - 1]], offsets[i] - offsets[i - 1] - 1, pj) == 0; - ParsedJson::iterator pjh { - pj - }; + ParsedJson::iterator pjh{pj}; for (const auto j : ext::range(0, actions.size())) { if (!ok) break; - ok = tryMove( - pjh, - actions[j], - (*block.getByPosition(arguments[j + 1 + ExtraArg]).column)[i] - ); + ok = tryMove(pjh, actions[j], (*block.getByPosition(arguments[j + 1 + ExtraArg]).column)[i]); } if (ok) @@ -273,5 +195,4 @@ public: block.getByPosition(result_pos).column = std::move(to); } }; - } diff --git a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference index 85ae16b842c..18a2d2bc60c 100644 --- a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference +++ b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference @@ -13,4 +13,4 @@ hello ('a','hello','b',[-100,200,300]) [-100,NULL,300] ['a','hello','b',NULL] -[(NULL,NULL,NULL),(NULL,NULL,NULL),(NULL,NULL,NULL),(-100,200,300)] +[(NULL,NULL,NULL),(NULL,NULL,NULL),(NULL,NULL,NULL),(-100,200,44)] diff --git a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql index 6fad2e5ce42..da14e8c93da 100644 --- a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql +++ b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql @@ -10,7 +10,7 @@ select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b'); select jsonExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1); select jsonExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2); select jsonExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1); -select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', ('', '', '', [0.0])); -select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', [-0], 'b'); -select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', ['']); -select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', [(-0, 0.0, 0)]); +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))'); +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Int32)', 'b'); +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(String)'); +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Tuple(Int16, Float32, UInt8))'); From 682ce99133caad5b7f44427dbdd2ec501dc8f4ba Mon Sep 17 00:00:00 2001 From: hcz Date: Wed, 24 Apr 2019 11:52:22 +0800 Subject: [PATCH 108/194] Return strings in jsonType --- dbms/src/Functions/FunctionsJSON.cpp | 25 ++++++++++++++++--- .../00918_json_simdjson_api.reference | 4 +-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp index 2f3c009de2e..2227febd4cc 100644 --- a/dbms/src/Functions/FunctionsJSON.cpp +++ b/dbms/src/Functions/FunctionsJSON.cpp @@ -51,15 +51,34 @@ public: } }; -class JSONTypeImpl : public JSONNullableImplBase +class JSONTypeImpl : public JSONNullableImplBase { public: static constexpr auto name{"jsonType"}; static Field getValue(ParsedJson::iterator & pjh) { - // types: [{"sltfn - return pjh.get_type(); + switch (pjh.get_type()) + { + case '[': + return "Array"; + case '{': + return "Object"; + case '"': + return "String"; + case 'l': + return "Int64"; + case 'd': + return "Float64"; + case 't': + return "Bool"; + case 'f': + return "Bool"; + case 'n': + return "Null"; + default: + return "Unknown"; + } } }; diff --git a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference index 18a2d2bc60c..00e5c947847 100644 --- a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference +++ b/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference @@ -1,12 +1,12 @@ 4 -123 +Object 1 1 a hello hello 3 -91 +Array -100 200 300 From 304c793b5f99d6a8a2653427100bb83d53f32c93 Mon Sep 17 00:00:00 2001 From: hcz Date: Wed, 24 Apr 2019 12:23:14 +0800 Subject: [PATCH 109/194] Add docs for json functions --- .../functions/json_functions.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/docs/en/query_language/functions/json_functions.md b/docs/en/query_language/functions/json_functions.md index f28b329690d..67c102da09f 100644 --- a/docs/en/query_language/functions/json_functions.md +++ b/docs/en/query_language/functions/json_functions.md @@ -57,3 +57,101 @@ There is currently no support for code points in the format `\uXXXX\uYYYY` that [Original article](https://clickhouse.yandex/docs/en/query_language/functions/json_functions/) + +The following functions are based on [simdjson](https://github.com/lemire/simdjson) designed for more complex JSON parsing requirements. The assumption 2 mentioned above still applies. + +## jsonHas(params[, accessors]...) + +If the value exists in the JSON document, `1` will be returned. + +If the value does not exist, `null` will be returned. + +Examples: + +``` +select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 1 +select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 4) = null +``` + +An accessor can be either a string, a positive integer or a negative integer. + +* String = access object member by key. +* Positive integer = access the n-th member/key from the beginning. +* Negative integer = access the n-th member/key from the end. + +You may use integers to access both JSON arrays and JSON objects. JSON objects are accessed as an array with the `[key, value, key, value, ...]` layout. + +So, for example: + +``` +select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1) = 'a' +select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 2) = 'hello' +select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', -2) = 'b' +``` + +## jsonLength(params[, accessors]...) + +Return the length of a JSON array or a JSON object. For JSON objects, both keys and values are included. + +If the value does not exist or has a wrong type, `null` will be returned. + +Examples: + +``` +select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 3 +select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}') = 4 +``` + +The usage of accessors is the same as above. + +## jsonType(params[, accessors]...) + +Return the type of a JSON value. + +If the value does not exist, `null` will be returned. + +Examples: + +``` +select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}') = 'Object' +select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}', 'a') = 'String' +select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 'Array' +``` + +The usage of accessors is the same as above. + +## jsonExtractUInt(params[, accessors]...) +## jsonExtractInt(params[, accessors]...) +## jsonExtractFloat(params[, accessors]...) +## jsonExtractBool(params[, accessors]...) +## jsonExtractString(params[, accessors]...) + +Parse data from JSON values which is similar to `visitParam` functions. + +If the value does not exist or has a wrong type, `null` will be returned. + +Examples: + +``` +select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a') = 'hello' +select jsonExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1) = -100 +select jsonExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2) = 200.0 +select jsonExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1) = 300 +``` + +The usage of accessors is the same as above. + +## jsonExtract(params, type[, accessors]...) + +Parse data from JSON values with a given ClickHouse data type. + +If the value does not exist or has a wrong type, `null` will be returned. + +Examples: + +``` +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Int8', 'b', 1) = -100 +select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))') = ('a', 'hello', 'b', [-100.0, 200.0, 300.0]) +``` + +The usage of accessors is the same as above. From 12d8dbeaedba959639872dcabd57db4280be93d2 Mon Sep 17 00:00:00 2001 From: hcz Date: Tue, 23 Apr 2019 21:18:40 +0800 Subject: [PATCH 110/194] Update simdjson --- contrib/simdjson | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/simdjson b/contrib/simdjson index b0c43028875..681cd336986 160000 --- a/contrib/simdjson +++ b/contrib/simdjson @@ -1 +1 @@ -Subproject commit b0c43028875e40461046774318088666e6284c52 +Subproject commit 681cd3369860f4eada49a387cbff93030f759c95 From 14d58737dd6ee74e4e3a18b6865d82f265f5a809 Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Sat, 27 Apr 2019 00:58:14 +0300 Subject: [PATCH 111/194] Fix error: use of old-style cast --- dbms/src/Functions/FunctionsJSON.cpp | 2 +- dbms/src/Functions/FunctionsJSON.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp index 2227febd4cc..9daaa394352 100644 --- a/dbms/src/Functions/FunctionsJSON.cpp +++ b/dbms/src/Functions/FunctionsJSON.cpp @@ -163,7 +163,7 @@ public: if (which.isFloat()) { if (pjh.is_integer()) - return {(double)pjh.get_integer()}; + return {static_cast(pjh.get_integer())}; else if (pjh.is_double()) return {pjh.get_double()}; else diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h index c9011157d85..fb1cffc19a3 100644 --- a/dbms/src/Functions/FunctionsJSON.h +++ b/dbms/src/Functions/FunctionsJSON.h @@ -5,9 +5,18 @@ #include #include #include +#include + +#ifdef __clang__ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wold-style-cast" +#endif #include -#include + +#ifdef __clang__ + #pragma clang diagnostic pop +#endif namespace DB From 7ace113ac0067e9f15e8d6506cf63181463c1c0f Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Wed, 8 May 2019 02:31:35 +0300 Subject: [PATCH 112/194] Use custom cmake file for simdjson and fix build --- CMakeLists.txt | 1 + cmake/find_simdjson.cmake | 14 ++++ contrib/CMakeLists.txt | 6 +- contrib/simdjson-cmake/CMakeLists.txt | 26 +++++++ dbms/src/Common/config.h.in | 1 + dbms/src/Functions/CMakeLists.txt | 6 +- dbms/src/Functions/FunctionsJSON.cpp | 67 +++++++++++++++---- dbms/src/Functions/FunctionsJSON.h | 40 ++++++++++- ...ce => 00918_json_functions_avx2.reference} | 0 ..._api.sql => 00918_json_functions_avx2.sql} | 0 10 files changed, 141 insertions(+), 20 deletions(-) create mode 100644 cmake/find_simdjson.cmake create mode 100644 contrib/simdjson-cmake/CMakeLists.txt rename dbms/tests/queries/0_stateless/{00918_json_simdjson_api.reference => 00918_json_functions_avx2.reference} (100%) rename dbms/tests/queries/0_stateless/{00918_json_simdjson_api.sql => 00918_json_functions_avx2.sql} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b45792ef76..1092471a5e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -318,6 +318,7 @@ include (cmake/find_consistent-hashing.cmake) include (cmake/find_base64.cmake) include (cmake/find_hyperscan.cmake) include (cmake/find_lfalloc.cmake) +include (cmake/find_simdjson.cmake) find_contrib_lib(cityhash) find_contrib_lib(farmhash) find_contrib_lib(metrohash) diff --git a/cmake/find_simdjson.cmake b/cmake/find_simdjson.cmake new file mode 100644 index 00000000000..2c6f233a6ad --- /dev/null +++ b/cmake/find_simdjson.cmake @@ -0,0 +1,14 @@ +if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/simdjson/include/simdjson/jsonparser.h") + message (WARNING "submodule contrib/simdjson is missing. to fix try run: \n git submodule update --init --recursive") + return() +endif () + +if (NOT HAVE_AVX2) + message (WARNING "submodule contrib/simdjson requires AVX2 support") + return() +endif () + +option (USE_SIMDJSON "Use simdjson" ON) + +set (SIMDJSON_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/simdjson/include") +set (SIMDJSON_LIBRARY "simdjson") diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index f7c6c0dc2c5..71c269ad2bc 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -313,5 +313,7 @@ endif() if (USE_INTERNAL_HYPERSCAN_LIBRARY) add_subdirectory (hyperscan) endif() -add_subdirectory (simdjson) -set (SIMDJSON_BUILD_STATIC ON CACHE INTERNAL "") + +if (USE_SIMDJSON) + add_subdirectory (simdjson-cmake) +endif() diff --git a/contrib/simdjson-cmake/CMakeLists.txt b/contrib/simdjson-cmake/CMakeLists.txt new file mode 100644 index 00000000000..3788745bf92 --- /dev/null +++ b/contrib/simdjson-cmake/CMakeLists.txt @@ -0,0 +1,26 @@ +if (NOT HAVE_AVX2) + message (FATAL_ERROR "No AVX2 support") +endif () + +if(MAKE_STATIC_LIBRARIES) + set(SIMDJSON_LIB_TYPE STATIC) + MESSAGE(STATUS "Building static library ${SIMDJSON_LIBRARY}") +else() + set(SIMDJSON_LIB_TYPE SHARED) + MESSAGE(STATUS "Building dynamic library ${SIMDJSON_LIBRARY}") +endif() + +set(SIMDJSON_SRC_DIR "${SIMDJSON_INCLUDE_DIR}/../src") +set(SIMDJSON_SRC + ${SIMDJSON_SRC_DIR}/jsonioutil.cpp + ${SIMDJSON_SRC_DIR}/jsonminifier.cpp + ${SIMDJSON_SRC_DIR}/jsonparser.cpp + ${SIMDJSON_SRC_DIR}/stage1_find_marks.cpp + ${SIMDJSON_SRC_DIR}/stage2_build_tape.cpp + ${SIMDJSON_SRC_DIR}/parsedjson.cpp + ${SIMDJSON_SRC_DIR}/parsedjsoniterator.cpp +) + +add_library(${SIMDJSON_LIBRARY} ${SIMDJSON_LIB_TYPE} ${SIMDJSON_SRC}) +target_include_directories(${SIMDJSON_LIBRARY} PRIVATE "${SIMDJSON_INCLUDE_DIR}") +target_compile_options(${SIMDJSON_LIBRARY} PRIVATE -mavx2 -mbmi -mbmi2 -mpclmul) diff --git a/dbms/src/Common/config.h.in b/dbms/src/Common/config.h.in index d6fc6d146f0..a1d2074686c 100644 --- a/dbms/src/Common/config.h.in +++ b/dbms/src/Common/config.h.in @@ -25,6 +25,7 @@ #cmakedefine01 USE_BROTLI #cmakedefine01 USE_SSL #cmakedefine01 USE_HYPERSCAN +#cmakedefine01 USE_SIMDJSON #cmakedefine01 USE_LFALLOC #cmakedefine01 USE_LFALLOC_RANDOM_HINT diff --git a/dbms/src/Functions/CMakeLists.txt b/dbms/src/Functions/CMakeLists.txt index 6a7f327ac56..9fd9a920041 100644 --- a/dbms/src/Functions/CMakeLists.txt +++ b/dbms/src/Functions/CMakeLists.txt @@ -70,5 +70,7 @@ if (USE_HYPERSCAN) target_include_directories (clickhouse_functions SYSTEM PRIVATE ${HYPERSCAN_INCLUDE_DIR}) endif () -target_include_directories(clickhouse_functions PRIVATE "${PROJECT_SOURCE_DIR}/contrib/simdjson/include") -target_link_libraries(clickhouse_functions PRIVATE simdjson) +if (USE_SIMDJSON) + target_link_libraries(clickhouse_functions PRIVATE ${SIMDJSON_LIBRARY}) + target_include_directories(clickhouse_functions PRIVATE ${SIMDJSON_INCLUDE_DIR}) +endif () diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp index 9daaa394352..b936b59bd8d 100644 --- a/dbms/src/Functions/FunctionsJSON.cpp +++ b/dbms/src/Functions/FunctionsJSON.cpp @@ -1,11 +1,13 @@ #include +#include +#include +#if USE_SIMDJSON #include #include #include #include #include -#include namespace DB @@ -320,20 +322,57 @@ public: } }; +} +#else +namespace DB +{ +struct JSONHasImpl { static constexpr auto name{"jsonHas"}; }; +struct JSONLengthImpl { static constexpr auto name{"jsonLength"}; }; +struct JSONTypeImpl { static constexpr auto name{"jsonType"}; }; +struct JSONExtractImpl { static constexpr auto name{"jsonExtract"}; }; +struct JSONExtractUIntImpl { static constexpr auto name{"jsonExtractUInt"}; }; +struct JSONExtractIntImpl { static constexpr auto name{"jsonExtractInt"}; }; +struct JSONExtractFloatImpl { static constexpr auto name{"jsonExtractFloat"}; }; +struct JSONExtractBoolImpl { static constexpr auto name{"jsonExtractBool"}; }; +//struct JSONExtractRawImpl { static constexpr auto name {"jsonExtractRaw"}; }; +struct JSONExtractStringImpl { static constexpr auto name{"jsonExtractString"}; }; +} +#endif + +namespace DB +{ + void registerFunctionsJSON(FunctionFactory & factory) { - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - factory.registerFunction>(); - // factory.registerFunction>(); - factory.registerFunction>(); +#if USE_SIMDJSON + if (__builtin_cpu_supports("avx2")) + { + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + // factory.registerFunction>(); + factory.registerFunction>(); + return; + } +#endif + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + factory.registerFunction>(); + //factory.registerFunction>(); + factory.registerFunction>(); } + } diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h index fb1cffc19a3..b0722309e63 100644 --- a/dbms/src/Functions/FunctionsJSON.h +++ b/dbms/src/Functions/FunctionsJSON.h @@ -1,15 +1,20 @@ #pragma once +#include +#include + +#if USE_SIMDJSON + #include #include #include -#include #include #include #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wold-style-cast" + #pragma clang diagnostic ignored "-Wnewline-eof" #endif #include @@ -18,7 +23,6 @@ #pragma clang diagnostic pop #endif - namespace DB { namespace ErrorCodes @@ -205,3 +209,35 @@ public: } }; } +#endif + +namespace DB +{ +namespace ErrorCodes +{ + extern const int NOT_IMPLEMENTED; +} + +template +class FunctionJSONDummy : public IFunction +{ +public: + static constexpr auto name = Impl::name; + static FunctionPtr create(const Context &) { return std::make_shared(); } + + String getName() const override { return Impl::name; } + bool isVariadic() const override { return true; } + size_t getNumberOfArguments() const override { return 0; } + + DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName &) const override + { + throw Exception{"Function " + getName() + " is not supported without AVX2", ErrorCodes::NOT_IMPLEMENTED}; + } + + void executeImpl(Block &, const ColumnNumbers &, size_t, size_t) override + { + throw Exception{"Function " + getName() + " is not supported without AVX2", ErrorCodes::NOT_IMPLEMENTED}; + } +}; + +} diff --git a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00918_json_simdjson_api.reference rename to dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference diff --git a/dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql similarity index 100% rename from dbms/tests/queries/0_stateless/00918_json_simdjson_api.sql rename to dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql From deddb40bf203bc7ef21b3cb29a858a71992c2937 Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 8 May 2019 17:25:17 +0300 Subject: [PATCH 113/194] fix --- .../MergeTree/MergeTreeBaseSelectBlockInputStream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp b/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp index 22b4eedb3b5..5c007890550 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeBaseSelectBlockInputStream.cpp @@ -84,11 +84,11 @@ Block MergeTreeBaseSelectBlockInputStream::readFromPart() MergeTreeReadTask & current_task, MergeTreeRangeReader & current_reader) { if (!current_task.size_predictor) - return current_max_block_size_rows; + return static_cast(current_max_block_size_rows); /// Calculates number of rows will be read using preferred_block_size_bytes. /// Can't be less than avg_index_granularity. - auto rows_to_read = current_task.size_predictor->estimateNumRows(current_preferred_block_size_bytes); + size_t rows_to_read = current_task.size_predictor->estimateNumRows(current_preferred_block_size_bytes); if (!rows_to_read) return rows_to_read; auto total_row_in_current_granule = current_reader.numRowsInCurrentGranule(); From 5a6ccab06037646bc8745cc25769792e068662b9 Mon Sep 17 00:00:00 2001 From: proller Date: Wed, 8 May 2019 17:49:53 +0300 Subject: [PATCH 114/194] Fix --- cmake/find_lfalloc.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/find_lfalloc.cmake b/cmake/find_lfalloc.cmake index c9b2ce5d436..81b1827e44c 100644 --- a/cmake/find_lfalloc.cmake +++ b/cmake/find_lfalloc.cmake @@ -1,4 +1,4 @@ -if (NOT SANITIZE AND NOT ARCH_ARM AND NOT ARCH_32 AND NOT ARCH_PPC64LE AND NOT OS_FREEBSD) +if (NOT SANITIZE AND NOT ARCH_ARM AND NOT ARCH_32 AND NOT ARCH_PPC64LE AND NOT OS_FREEBSD AND NOT APPLE) option (ENABLE_LFALLOC "Set to FALSE to use system libgsasl library instead of bundled" ${NOT_UNBUNDLED}) endif () From 750d12d814b5f762b95615a284835711b0be3ef5 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Wed, 8 May 2019 22:14:56 +0300 Subject: [PATCH 115/194] Remove past event --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 02a50be007b..7d2b4b052ff 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ ClickHouse is an open-source column-oriented database management system that all * You can also [fill this form](https://forms.yandex.com/surveys/meet-yandex-clickhouse-team/) to meet Yandex ClickHouse team in person. ## Upcoming Events -* [ClickHouse Community Meetup in Limassol](https://www.facebook.com/events/386638262181785/) on May 7. * ClickHouse at [Percona Live 2019](https://www.percona.com/live/19/other-open-source-databases-track) in Austin on May 28-30. * [ClickHouse Community Meetup in Beijing](https://www.huodongxing.com/event/2483759276200) on June 8. * [ClickHouse Community Meetup in Shenzhen](https://www.huodongxing.com/event/3483759917300) on October 20. From c8bf190f843b9d26d50584101376fd2596a86811 Mon Sep 17 00:00:00 2001 From: Guillaume Tassery Date: Thu, 9 May 2019 13:12:02 +0700 Subject: [PATCH 116/194] add unsafe function member for (add|remove)dependency for calling manually the context locking --- dbms/src/Interpreters/Context.cpp | 16 +++++++++++++--- dbms/src/Interpreters/Context.h | 4 ++++ dbms/src/Storages/StorageMaterializedView.cpp | 10 ++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/dbms/src/Interpreters/Context.cpp b/dbms/src/Interpreters/Context.cpp index f2b9dfd9508..5e429c6ce06 100644 --- a/dbms/src/Interpreters/Context.cpp +++ b/dbms/src/Interpreters/Context.cpp @@ -702,9 +702,8 @@ void Context::checkDatabaseAccessRightsImpl(const std::string & database_name) c throw Exception("Access denied to database " + database_name + " for user " + client_info.current_user , ErrorCodes::DATABASE_ACCESS_DENIED); } -void Context::addDependency(const DatabaseAndTableName & from, const DatabaseAndTableName & where) +void Context::addDependencyUnsafe(const DatabaseAndTableName & from, const DatabaseAndTableName & where) { - auto lock = getLock(); checkDatabaseAccessRightsImpl(from.first); checkDatabaseAccessRightsImpl(where.first); shared->view_dependencies[from].insert(where); @@ -715,9 +714,14 @@ void Context::addDependency(const DatabaseAndTableName & from, const DatabaseAnd table->updateDependencies(); } -void Context::removeDependency(const DatabaseAndTableName & from, const DatabaseAndTableName & where) +void Context::addDependency(const DatabaseAndTableName & from, const DatabaseAndTableName & where) { auto lock = getLock(); + addDependencyUnsafe(from, where); +} + +void Context::removeDependencyUnsafe(const DatabaseAndTableName & from, const DatabaseAndTableName & where) +{ checkDatabaseAccessRightsImpl(from.first); checkDatabaseAccessRightsImpl(where.first); shared->view_dependencies[from].erase(where); @@ -728,6 +732,12 @@ void Context::removeDependency(const DatabaseAndTableName & from, const Database table->updateDependencies(); } +void Context::removeDependency(const DatabaseAndTableName & from, const DatabaseAndTableName & where) +{ + auto lock = getLock(); + removeDependencyUnsafe(from, where); +} + Dependencies Context::getDependencies(const String & database_name, const String & table_name) const { auto lock = getLock(); diff --git a/dbms/src/Interpreters/Context.h b/dbms/src/Interpreters/Context.h index 3bfd7d06d3b..d590bb41c4c 100644 --- a/dbms/src/Interpreters/Context.h +++ b/dbms/src/Interpreters/Context.h @@ -215,6 +215,10 @@ public: void removeDependency(const DatabaseAndTableName & from, const DatabaseAndTableName & where); Dependencies getDependencies(const String & database_name, const String & table_name) const; + /// Functions where we can lock the context manually + void addDependencyUnsafe(const DatabaseAndTableName & from, const DatabaseAndTableName & where); + void removeDependencyUnsafe(const DatabaseAndTableName & from, const DatabaseAndTableName & where); + /// Checking the existence of the table/database. Database can be empty - in this case the current database is used. bool isTableExist(const String & database_name, const String & table_name) const; bool isDatabaseExist(const String & database_name) const; diff --git a/dbms/src/Storages/StorageMaterializedView.cpp b/dbms/src/Storages/StorageMaterializedView.cpp index 7b4322cb85f..93c42473d46 100644 --- a/dbms/src/Storages/StorageMaterializedView.cpp +++ b/dbms/src/Storages/StorageMaterializedView.cpp @@ -303,14 +303,16 @@ void StorageMaterializedView::rename(const String & /*new_path_to_db*/, const St executeRenameQuery(global_context, target_database_name, target_table_name, new_target_table_name); target_table_name = new_target_table_name; } - - global_context.removeDependency( + + auto lock = global_context.getLock(); + + global_context.removeDependencyUnsafe( DatabaseAndTableName(select_database_name, select_table_name), DatabaseAndTableName(database_name, table_name)); table_name = new_table_name; - - global_context.addDependency( + + global_context.addDependencyUnsafe( DatabaseAndTableName(select_database_name, select_table_name), DatabaseAndTableName(database_name, table_name)); } From 5b28a8693021065296e0a7e9681558d74a4c570e Mon Sep 17 00:00:00 2001 From: proller Date: Thu, 9 May 2019 12:03:06 +0300 Subject: [PATCH 117/194] Add comment --- dbms/tests/clickhouse-test-server | 2 +- debian/clickhouse-server.init | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dbms/tests/clickhouse-test-server b/dbms/tests/clickhouse-test-server index c029275a7a8..256a2f157cb 100755 --- a/dbms/tests/clickhouse-test-server +++ b/dbms/tests/clickhouse-test-server @@ -56,7 +56,7 @@ if [ "$DATA_DIR_PATTERN" != "$DATA_DIR" ]; then cat $CLICKHOUSE_CONFIG | sed -e s!$DATA_DIR_PATTERN!$DATA_DIR! > $DATA_DIR/etc/server-config.xml export CLICKHOUSE_CONFIG=$DATA_DIR/etc/server-config.xml cp $CLICKHOUSE_CONFIG_USERS $DATA_DIR/etc - cp -r -L $CLICKHOUSE_CONFIG_USERS_D $DATA_DIR/etc + cp -R -L $CLICKHOUSE_CONFIG_USERS_D $DATA_DIR/etc fi CLICKHOUSE_EXTRACT_CONFIG=${CLICKHOUSE_EXTRACT_CONFIG:="${CLICKHOUSE_EXTRACT} --config=$CLICKHOUSE_CONFIG"} diff --git a/debian/clickhouse-server.init b/debian/clickhouse-server.init index 8660ed87c6d..69d5e89cb73 100755 --- a/debian/clickhouse-server.init +++ b/debian/clickhouse-server.init @@ -301,6 +301,7 @@ main() restart && enable_cron ;; forcestop) + # disable_cron returns false if cron disabled (with systemd) - not checking return status disable_cron forcestop ;; From 4b666226011e1dd92edc255f94a77681a2eb430f Mon Sep 17 00:00:00 2001 From: Andy Yang Date: Thu, 9 May 2019 17:24:36 +0800 Subject: [PATCH 118/194] Fix bitmap functions crash the server bug segfault --- dbms/src/Functions/FunctionsBitmap.h | 14 +++++++++-- .../00829_bitmap_function.reference | 4 ++++ .../0_stateless/00829_bitmap_function.sql | 23 ++++++++++++++++++- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/dbms/src/Functions/FunctionsBitmap.h b/dbms/src/Functions/FunctionsBitmap.h index 88c17feeb5c..c5b0bc78d61 100644 --- a/dbms/src/Functions/FunctionsBitmap.h +++ b/dbms/src/Functions/FunctionsBitmap.h @@ -406,7 +406,12 @@ private: { const ColumnAggregateFunction * columns[2]; for (size_t i = 0; i < 2; ++i) - columns[i] = typeid_cast(block.getByPosition(arguments[i]).column.get()); + { + if (auto argument_column_const = typeid_cast(block.getByPosition(arguments[i]).column.get())) + columns[i] = typeid_cast(argument_column_const->getDataColumnPtr().get()); + else + columns[i] = typeid_cast(block.getByPosition(arguments[i]).column.get()); + } for (size_t i = 0; i < input_rows_count; ++i) { @@ -511,7 +516,12 @@ private: { const ColumnAggregateFunction * columns[2]; for (size_t i = 0; i < 2; ++i) - columns[i] = typeid_cast(block.getByPosition(arguments[i]).column.get()); + { + if (auto argument_column_const = typeid_cast(block.getByPosition(arguments[i]).column.get())) + columns[i] = typeid_cast(argument_column_const->getDataColumnPtr().get()); + else + columns[i] = typeid_cast(block.getByPosition(arguments[i]).column.get()); + } auto col_to = ColumnAggregateFunction::create(columns[0]->getAggregateFunction()); diff --git a/dbms/tests/queries/0_stateless/00829_bitmap_function.reference b/dbms/tests/queries/0_stateless/00829_bitmap_function.reference index cc159d2aaf8..be27c9c7edb 100644 --- a/dbms/tests/queries/0_stateless/00829_bitmap_function.reference +++ b/dbms/tests/queries/0_stateless/00829_bitmap_function.reference @@ -15,3 +15,7 @@ 60 50 70 40 20 30 2019-01-01 50 2019-01-02 60 +1 +1 +1 +1 diff --git a/dbms/tests/queries/0_stateless/00829_bitmap_function.sql b/dbms/tests/queries/0_stateless/00829_bitmap_function.sql index 9013b53d99e..2c43bb07e90 100644 --- a/dbms/tests/queries/0_stateless/00829_bitmap_function.sql +++ b/dbms/tests/queries/0_stateless/00829_bitmap_function.sql @@ -1,3 +1,4 @@ +USE test; SELECT bitmapToArray(bitmapBuild([1, 2, 3, 4, 5])); SELECT bitmapToArray(bitmapAnd(bitmapBuild([1,2,3]),bitmapBuild([3,4,5]))); SELECT bitmapToArray(bitmapOr(bitmapBuild([1,2,3]),bitmapBuild([3,4,5]))); @@ -53,7 +54,7 @@ ALL LEFT JOIN ) USING city_id; - +-- bitmap state test DROP TABLE IF EXISTS bitmap_state_test; CREATE TABLE bitmap_state_test ( @@ -72,6 +73,26 @@ GROUP BY pickup_date, city_id; SELECT pickup_date, groupBitmapMerge(uv) AS users from bitmap_state_test group by pickup_date; +-- between column and expression test +DROP TABLE IF EXISTS bitmap_column_expr_test; +CREATE TABLE bitmap_column_expr_test +( + t DateTime, + z AggregateFunction(groupBitmap, UInt32) +) +ENGINE = MergeTree +PARTITION BY toYYYYMMDD(t) +ORDER BY t; + +INSERT INTO bitmap_column_expr_test VALUES (now(), bitmapBuild(cast([3,19,47] as Array(UInt32)))); + +SELECT bitmapAndCardinality( bitmapBuild(cast([19,7] as Array(UInt32))), z) from bitmap_column_expr_test; +SELECT bitmapAndCardinality( z, bitmapBuild(cast([19,7] as Array(UInt32))) ) from bitmap_column_expr_test; + +select bitmapCardinality(bitmapAnd(bitmapBuild(cast([19,7] as Array(UInt32))), z )) from bitmap_column_expr_test; +select bitmapCardinality(bitmapAnd(z, bitmapBuild(cast([19,7] as Array(UInt32))))) from bitmap_column_expr_test; + DROP TABLE IF EXISTS bitmap_test; DROP TABLE IF EXISTS bitmap_state_test; +DROP TABLE IF EXISTS bitmap_column_expr_test; From 8be1bc009a18cd13a7e7c79ff53a12e554c88a3b Mon Sep 17 00:00:00 2001 From: Danila Kutenin Date: Thu, 9 May 2019 13:33:40 +0300 Subject: [PATCH 119/194] move CpuId to Common --- dbms/src/{Core => Common}/CpuId.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dbms/src/{Core => Common}/CpuId.h (100%) diff --git a/dbms/src/Core/CpuId.h b/dbms/src/Common/CpuId.h similarity index 100% rename from dbms/src/Core/CpuId.h rename to dbms/src/Common/CpuId.h From b7f4d1ace12cd8461db5400a9c54555387b678e7 Mon Sep 17 00:00:00 2001 From: Vasily Nemkov Date: Fri, 10 May 2019 09:10:29 +0300 Subject: [PATCH 120/194] A script to set symlinks to docs missing in other languages. --- docs/tools/make_links.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 docs/tools/make_links.sh diff --git a/docs/tools/make_links.sh b/docs/tools/make_links.sh new file mode 100755 index 00000000000..cca2f5feb6b --- /dev/null +++ b/docs/tools/make_links.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Fixes missing documentation in other languages +# by putting relative symbolic links to the original doc file. +# This is to be run from root of language directory, like "docs/en". + +function do_make_links() +{ + langs=(en ru fa zh) + src_file="$1" + for lang in "${langs[@]}" + do + # replacing "/./" with / + dst_file="../${lang}/${src_file}" + dst_file="${dst_file/\/\.\//\/}" + + mkdir -p $(dirname "${dst_file}") + ln -sr "${src_file}" "${dst_file}" + done +} + +export -f do_make_links +find . -iname '*.md' -exec /bin/bash -c 'do_make_links "{}"' \; From 4c17864685ac2295819bd345a80158ea599fa246 Mon Sep 17 00:00:00 2001 From: Vasily Nemkov Date: Mon, 6 May 2019 20:33:14 +0300 Subject: [PATCH 121/194] IPv4 and IPv6 domain docs. --- docs/en/data_types/domains/ipv4.md | 79 +++++++++++++++++++ docs/en/data_types/domains/ipv6.md | 79 +++++++++++++++++++ docs/en/data_types/domains/overview.md | 26 ++++++ .../functions/ip_address_functions.md | 65 ++++++++++++++- docs/fa/data_types/domains/ipv4.md | 1 + docs/fa/data_types/domains/ipv6.md | 1 + docs/fa/data_types/domains/overview.md | 1 + docs/ru/data_types/domains/ipv4.md | 1 + docs/ru/data_types/domains/ipv6.md | 1 + docs/ru/data_types/domains/overview.md | 1 + docs/toc_en.yml | 4 + docs/toc_fa.yml | 4 + docs/toc_ru.yml | 4 + docs/toc_zh.yml | 4 + docs/zh/data_types/domains/ipv4.md | 1 + docs/zh/data_types/domains/ipv6.md | 1 + docs/zh/data_types/domains/overview.md | 1 + 17 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 docs/en/data_types/domains/ipv4.md create mode 100644 docs/en/data_types/domains/ipv6.md create mode 100644 docs/en/data_types/domains/overview.md create mode 120000 docs/fa/data_types/domains/ipv4.md create mode 120000 docs/fa/data_types/domains/ipv6.md create mode 120000 docs/fa/data_types/domains/overview.md create mode 120000 docs/ru/data_types/domains/ipv4.md create mode 120000 docs/ru/data_types/domains/ipv6.md create mode 120000 docs/ru/data_types/domains/overview.md create mode 120000 docs/zh/data_types/domains/ipv4.md create mode 120000 docs/zh/data_types/domains/ipv6.md create mode 120000 docs/zh/data_types/domains/overview.md diff --git a/docs/en/data_types/domains/ipv4.md b/docs/en/data_types/domains/ipv4.md new file mode 100644 index 00000000000..dd7e08d673e --- /dev/null +++ b/docs/en/data_types/domains/ipv4.md @@ -0,0 +1,79 @@ +## IPv4 + +`IPv4` is a domain based on `UInt32` type and serves as typed replacement for storing IPv4 values. It provides compact storage with human-friendly input-output format, and column type information on inspection. + +### Basic Usage + +``` sql +CREATE TABLE hits (url String, from IPv4) ENGINE = MergeTree() ORDER BY url; + +DESCRIBE TABLE hits; +``` + +``` +┌─name─┬─type───┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┐ +│ url │ String │ │ │ │ │ +│ from │ IPv4 │ │ │ │ │ +└──────┴────────┴──────────────┴────────────────────┴─────────┴──────────────────┘ +``` + +OR you can use IPv4 domain as a key: + +``` sql +CREATE TABLE hits (url String, from IPv4) ENGINE = MergeTree() ORDER BY from; +``` + +`IPv4` domain supports custom input format as IPv4-strings: + +``` sql +INSERT INTO hits (url, from) VALUES ('https://wikipedia.org', '116.253.40.133')('https://clickhouse.yandex', '183.247.232.58')('https://clickhouse.yandex/docs/en/', '116.106.34.242'); + +SELECT * FROM hits; +``` + +``` +┌─url────────────────────────────────┬───────────from─┐ +│ https://clickhouse.yandex/docs/en/ │ 116.106.34.242 │ +│ https://wikipedia.org │ 116.253.40.133 │ +│ https://clickhouse.yandex │ 183.247.232.58 │ +└────────────────────────────────────┴────────────────┘ +``` + +Values are stored in compact binary form: + +``` sql +SELECT toTypeName(from), hex(from) FROM hits LIMIT 1; +``` + +``` +┌─toTypeName(from)─┬─hex(from)─┐ +│ IPv4 │ B7F7E83A │ +└──────────────────┴───────────┘ +``` + +Domain values are not implicitly convertible to types other than `UInt32`. +If you want to convert `IPv4` value to a string, you have to do that explicitly with `IPv4NumToString()` function: + +``` sql +SELECT toTypeName(s), IPv4NumToString(from) as s FROM hits LIMIT 1; +``` + +``` +┌─toTypeName(IPv4NumToString(from))─┬─s──────────────┐ +│ String │ 183.247.232.58 │ +└───────────────────────────────────┴────────────────┘ +``` + +Or cast to a `UInt32` value: + +``` sql +SELECT toTypeName(i), CAST(from as UInt32) as i FROM hits LIMIT 1; +``` + +``` +┌─toTypeName(CAST(from, 'UInt32'))─┬──────────i─┐ +│ UInt32 │ 3086477370 │ +└──────────────────────────────────┴────────────┘ +``` + +[Original article](https://clickhouse.yandex/docs/en/data_types/domains/ipv4) diff --git a/docs/en/data_types/domains/ipv6.md b/docs/en/data_types/domains/ipv6.md new file mode 100644 index 00000000000..1bfbe3400b5 --- /dev/null +++ b/docs/en/data_types/domains/ipv6.md @@ -0,0 +1,79 @@ +## IPv6 + +`IPv6` is a domain based on `FixedString(16)` type and serves as typed replacement for storing IPv6 values. It provides compact storage with human-friendly input-output format, and column type information on inspection. + +### Basic Usage + +``` sql +CREATE TABLE hits (url String, from IPv6) ENGINE = MergeTree() ORDER BY url; + +DESCRIBE TABLE hits; +``` + +``` +┌─name─┬─type───┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┐ +│ url │ String │ │ │ │ │ +│ from │ IPv6 │ │ │ │ │ +└──────┴────────┴──────────────┴────────────────────┴─────────┴──────────────────┘ +``` + +OR you can use `IPv6` domain as a key: + +``` sql +CREATE TABLE hits (url String, from IPv6) ENGINE = MergeTree() ORDER BY from; +``` + +`IPv6` domain supports custom input as IPv6-strings: + +``` sql +INSERT INTO hits (url, from) VALUES ('https://wikipedia.org', '2a02:aa08:e000:3100::2')('https://clickhouse.yandex', '2001:44c8:129:2632:33:0:252:2')('https://clickhouse.yandex/docs/en/', '2a02:e980:1e::1'); + +SELECT * FROM hits; +``` + +``` +┌─url────────────────────────────────┬─from──────────────────────────┐ +│ https://clickhouse.yandex │ 2001:44c8:129:2632:33:0:252:2 │ +│ https://clickhouse.yandex/docs/en/ │ 2a02:e980:1e::1 │ +│ https://wikipedia.org │ 2a02:aa08:e000:3100::2 │ +└────────────────────────────────────┴───────────────────────────────┘ +``` + +Values are stored in compact binary form: + +``` sql +SELECT toTypeName(from), hex(from) FROM hits LIMIT 1; +``` + +``` +┌─toTypeName(from)─┬─hex(from)────────────────────────┐ +│ IPv6 │ 200144C8012926320033000002520002 │ +└──────────────────┴──────────────────────────────────┘ +``` + +Domain values are not implicitly convertible to types other than `FixedString(16)`. +If you want to convert `IPv6` value to a string, you have to do that explicitly with `IPv6NumToString()` function: + +``` sql +SELECT toTypeName(s), IPv6NumToString(from) as s FROM hits LIMIT 1; +``` + +``` +┌─toTypeName(IPv6NumToString(from))─┬─s─────────────────────────────┐ +│ String │ 2001:44c8:129:2632:33:0:252:2 │ +└───────────────────────────────────┴───────────────────────────────┘ +``` + +Or cast to a `FixedString(16)` value: + +``` sql +SELECT toTypeName(i), CAST(from as FixedString(16)) as i FROM hits LIMIT 1; +``` + +``` +┌─toTypeName(CAST(from, 'FixedString(16)'))─┬─i───────┐ +│ FixedString(16) │ ��� │ +└───────────────────────────────────────────┴─────────┘ +``` + +[Original article](https://clickhouse.yandex/docs/en/data_types/domains/ipv6) diff --git a/docs/en/data_types/domains/overview.md b/docs/en/data_types/domains/overview.md new file mode 100644 index 00000000000..fe7cd82df28 --- /dev/null +++ b/docs/en/data_types/domains/overview.md @@ -0,0 +1,26 @@ +# Domains + +Domains are special-purpose types, that add some extra features atop of existing base type, leaving on-wire and on-disc format of underlying table intact. At the moment, ClickHouse does not support user-defined domains. + +You can use domains anywhere corresponding base type can be used: + +* Create a column of domain type +* Read/write values from/to domain column +* Use it as index if base type can be used as index +* Call functions with values of domain column +* etc. + +### Extra Features of Domains + +* Explicit column type name in `SHOW CREATE TABLE` or `DESCRIBE TABLE` +* Input from human-friendly format with `INSERT INTO domain_table(domain_column) VALUES(...)` +* Output to human-friendly format for `SELECT domain_column FROM domain_table` +* Loading data from external source in human-friendly format: `INSERT INTO domain_table FORMAT CSV ...` + +### Limitations + +* Can't convert index column of base type to domain type via `ALTER TABLE`. +* Can't implicitly convert string values into domain values when inserting data from another column or table. +* Domain adds no constrains on stored values. + +[Original article](https://clickhouse.yandex/docs/en/data_types/domains/overview) \ No newline at end of file diff --git a/docs/en/query_language/functions/ip_address_functions.md b/docs/en/query_language/functions/ip_address_functions.md index 8cc6caff462..70dcb1cdf0e 100644 --- a/docs/en/query_language/functions/ip_address_functions.md +++ b/docs/en/query_language/functions/ip_address_functions.md @@ -131,7 +131,7 @@ SELECT IPv6NumToString(IPv4ToIPv6(IPv4StringToNum('192.168.0.1'))) AS addr Accepts a FixedString(16) value containing the IPv6 address in binary format. Returns a string containing the address of the specified number of bits removed in text format. For example: -```sql +``` sql WITH IPv6StringToNum('2001:0DB8:AC10:FE01:FEED:BABE:CAFE:F00D') AS ipv6, IPv4ToIPv6(IPv4StringToNum('192.168.0.1')) AS ipv4 @@ -178,5 +178,68 @@ SELECT IPv6CIDRtoIPv6Range(toIPv6('2001:0db8:0000:85a3:0000:0000:ac1f:8001'), 32 └────────────────────────────────────────────────────────────────────────────┘ ``` +## toIPv4(string) + +An alias to `IPv4StringToNum()` that takes a string form of IPv4 address and returns value of [IPv4](../../data_types/domains/ipv4.md) type, which is binary equal to value returned by `IPv4StringToNum()`. + +``` sql +WITH + '171.225.130.45' as IPv4_string +SELECT + toTypeName(IPv4StringToNum(IPv4_string)), + toTypeName(toIPv4(IPv4_string)) +``` + +``` +┌─toTypeName(IPv4StringToNum(IPv4_string))─┬─toTypeName(toIPv4(IPv4_string))─┐ +│ UInt32 │ IPv4 │ +└──────────────────────────────────────────┴─────────────────────────────────┘ +``` + +``` sql +WITH + '171.225.130.45' as IPv4_string +SELECT + hex(IPv4StringToNum(IPv4_string)), + hex(toIPv4(IPv4_string)) +``` + +``` +┌─hex(IPv4StringToNum(IPv4_string))─┬─hex(toIPv4(IPv4_string))─┐ +│ ABE1822D │ ABE1822D │ +└───────────────────────────────────┴──────────────────────────┘ +``` + +## toIPv6(string) + +An alias to `IPv6StringToNum()` that takes a string form of IPv6 address and returns value of [IPv6](../../data_types/domains/ipv6.md) type, which is binary equal to value returned by `IPv6StringToNum()`. + +``` sql +WITH + '2001:438:ffff::407d:1bc1' as IPv6_string +SELECT + toTypeName(IPv6StringToNum(IPv6_string)), + toTypeName(toIPv6(IPv6_string)) +``` + +``` +┌─toTypeName(IPv6StringToNum(IPv6_string))─┬─toTypeName(toIPv6(IPv6_string))─┐ +│ FixedString(16) │ IPv6 │ +└──────────────────────────────────────────┴─────────────────────────────────┘ +``` + +``` sql +WITH + '2001:438:ffff::407d:1bc1' as IPv6_string +SELECT + hex(IPv6StringToNum(IPv6_string)), + hex(toIPv6(IPv6_string)) +``` + +``` +┌─hex(IPv6StringToNum(IPv6_string))─┬─hex(toIPv6(IPv6_string))─────────┐ +│ 20010438FFFF000000000000407D1BC1 │ 20010438FFFF000000000000407D1BC1 │ +└───────────────────────────────────┴──────────────────────────────────┘ +``` [Original article](https://clickhouse.yandex/docs/en/query_language/functions/ip_address_functions/) diff --git a/docs/fa/data_types/domains/ipv4.md b/docs/fa/data_types/domains/ipv4.md new file mode 120000 index 00000000000..eb4cc7d57b5 --- /dev/null +++ b/docs/fa/data_types/domains/ipv4.md @@ -0,0 +1 @@ +../../../en/data_types/domains/ipv4.md \ No newline at end of file diff --git a/docs/fa/data_types/domains/ipv6.md b/docs/fa/data_types/domains/ipv6.md new file mode 120000 index 00000000000..cca37a22458 --- /dev/null +++ b/docs/fa/data_types/domains/ipv6.md @@ -0,0 +1 @@ +../../../en/data_types/domains/ipv6.md \ No newline at end of file diff --git a/docs/fa/data_types/domains/overview.md b/docs/fa/data_types/domains/overview.md new file mode 120000 index 00000000000..13465d655ee --- /dev/null +++ b/docs/fa/data_types/domains/overview.md @@ -0,0 +1 @@ +../../../en/data_types/domains/overview.md \ No newline at end of file diff --git a/docs/ru/data_types/domains/ipv4.md b/docs/ru/data_types/domains/ipv4.md new file mode 120000 index 00000000000..eb4cc7d57b5 --- /dev/null +++ b/docs/ru/data_types/domains/ipv4.md @@ -0,0 +1 @@ +../../../en/data_types/domains/ipv4.md \ No newline at end of file diff --git a/docs/ru/data_types/domains/ipv6.md b/docs/ru/data_types/domains/ipv6.md new file mode 120000 index 00000000000..cca37a22458 --- /dev/null +++ b/docs/ru/data_types/domains/ipv6.md @@ -0,0 +1 @@ +../../../en/data_types/domains/ipv6.md \ No newline at end of file diff --git a/docs/ru/data_types/domains/overview.md b/docs/ru/data_types/domains/overview.md new file mode 120000 index 00000000000..13465d655ee --- /dev/null +++ b/docs/ru/data_types/domains/overview.md @@ -0,0 +1 @@ +../../../en/data_types/domains/overview.md \ No newline at end of file diff --git a/docs/toc_en.yml b/docs/toc_en.yml index a67bc9cd309..50d8a373a3d 100644 --- a/docs/toc_en.yml +++ b/docs/toc_en.yml @@ -56,6 +56,10 @@ nav: - 'Expression': 'data_types/special_data_types/expression.md' - 'Set': 'data_types/special_data_types/set.md' - 'Nothing': 'data_types/special_data_types/nothing.md' + - 'Domains': + - 'Overview': 'data_types/domains/overview.md' + - 'IPv4': 'data_types/domains/ipv4.md' + - 'IPv6': 'data_types/domains/ipv6.md' - 'Table Engines': - 'Introduction': 'operations/table_engines/index.md' diff --git a/docs/toc_fa.yml b/docs/toc_fa.yml index 67335934850..95784495d36 100644 --- a/docs/toc_fa.yml +++ b/docs/toc_fa.yml @@ -56,6 +56,10 @@ nav: - 'Expression': 'data_types/special_data_types/expression.md' - 'Set': 'data_types/special_data_types/set.md' - 'Nothing': 'data_types/special_data_types/nothing.md' + - 'Domains': + - 'Overview': 'data_types/domains/overview.md' + - 'IPv4': 'data_types/domains/ipv4.md' + - 'IPv6': 'data_types/domains/ipv6.md' - 'Table Engines': - 'Introduction': 'operations/table_engines/index.md' diff --git a/docs/toc_ru.yml b/docs/toc_ru.yml index 2840eaed6db..3229dedf0ce 100644 --- a/docs/toc_ru.yml +++ b/docs/toc_ru.yml @@ -57,6 +57,10 @@ nav: - 'Expression': 'data_types/special_data_types/expression.md' - 'Set': 'data_types/special_data_types/set.md' - 'Nothing': 'data_types/special_data_types/nothing.md' + - 'Domains': + - 'Overview': 'data_types/domains/overview.md' + - 'IPv4': 'data_types/domains/ipv4.md' + - 'IPv6': 'data_types/domains/ipv6.md' - 'Движки таблиц': - 'Введение': 'operations/table_engines/index.md' diff --git a/docs/toc_zh.yml b/docs/toc_zh.yml index 81866ae7af8..f159b481944 100644 --- a/docs/toc_zh.yml +++ b/docs/toc_zh.yml @@ -55,6 +55,10 @@ nav: - 'Expression': 'data_types/special_data_types/expression.md' - 'Set': 'data_types/special_data_types/set.md' - 'Nothing': 'data_types/special_data_types/nothing.md' + - 'Domains': + - 'Overview': 'data_types/domains/overview.md' + - 'IPv4': 'data_types/domains/ipv4.md' + - 'IPv6': 'data_types/domains/ipv6.md' - 'Table Engines': - 'Introduction': 'operations/table_engines/index.md' diff --git a/docs/zh/data_types/domains/ipv4.md b/docs/zh/data_types/domains/ipv4.md new file mode 120000 index 00000000000..eb4cc7d57b5 --- /dev/null +++ b/docs/zh/data_types/domains/ipv4.md @@ -0,0 +1 @@ +../../../en/data_types/domains/ipv4.md \ No newline at end of file diff --git a/docs/zh/data_types/domains/ipv6.md b/docs/zh/data_types/domains/ipv6.md new file mode 120000 index 00000000000..cca37a22458 --- /dev/null +++ b/docs/zh/data_types/domains/ipv6.md @@ -0,0 +1 @@ +../../../en/data_types/domains/ipv6.md \ No newline at end of file diff --git a/docs/zh/data_types/domains/overview.md b/docs/zh/data_types/domains/overview.md new file mode 120000 index 00000000000..13465d655ee --- /dev/null +++ b/docs/zh/data_types/domains/overview.md @@ -0,0 +1 @@ +../../../en/data_types/domains/overview.md \ No newline at end of file From bd43e8bada90a71bd317a759bc8307c24870a568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=81=A5?= Date: Fri, 10 May 2019 18:42:00 +0800 Subject: [PATCH 122/194] Fix if, multiIf's nullable bug. --- dbms/src/Functions/if.cpp | 31 +- dbms/src/Functions/multiIf.cpp | 10 +- .../0_stateless/00395_nullable.reference | 24 +- .../queries/0_stateless/00395_nullable.sql | 15 + .../0_stateless/00431_if_nulls.reference | 315 +++++++++--------- .../queries/0_stateless/00431_if_nulls.sql | 5 + 6 files changed, 211 insertions(+), 189 deletions(-) diff --git a/dbms/src/Functions/if.cpp b/dbms/src/Functions/if.cpp index 272351956c1..ff034848460 100644 --- a/dbms/src/Functions/if.cpp +++ b/dbms/src/Functions/if.cpp @@ -656,7 +656,7 @@ private: block.getByPosition(result).column = std::move(result_column); } - bool executeForNullableCondition(Block & block, const ColumnNumbers & arguments, size_t result, size_t input_rows_count) + bool executeForNullableCondition(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) { const ColumnWithTypeAndName & arg_cond = block.getByPosition(arguments[0]); bool cond_is_null = arg_cond.column->onlyNull(); @@ -664,7 +664,7 @@ private: if (cond_is_null) { - block.getByPosition(result).column = block.getByPosition(result).type->createColumnConstWithDefaultValue(input_rows_count); + block.getByPosition(result).column = std::move(block.getByPosition(arguments[2]).column); return true; } @@ -680,25 +680,8 @@ private: executeImpl(temporary_block, {0, 1, 2}, 3, temporary_block.rows()); - const ColumnPtr & result_column = temporary_block.getByPosition(3).column; - if (result_column->isColumnNullable()) - { - MutableColumnPtr mutable_result_column = (*std::move(result_column)).mutate(); - static_cast(*mutable_result_column).applyNullMap(static_cast(*arg_cond.column)); - block.getByPosition(result).column = std::move(mutable_result_column); - return true; - } - else if (result_column->onlyNull()) - { - block.getByPosition(result).column = block.getByPosition(result).type->createColumnConstWithDefaultValue(input_rows_count); - return true; - } - else - { - block.getByPosition(result).column = ColumnNullable::create( - materializeColumnIfConst(result_column), static_cast(*arg_cond.column).getNullMapColumnPtr()); - return true; - } + block.getByPosition(result).column = std::move(temporary_block.getByPosition(3).column); + return true; } return false; @@ -917,11 +900,11 @@ public: DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override { if (arguments[0]->onlyNull()) - return arguments[0]; + return arguments[2]; if (arguments[0]->isNullable()) - return makeNullable(getReturnTypeImpl({ - removeNullable(arguments[0]), arguments[1], arguments[2]})); + return getReturnTypeImpl({ + removeNullable(arguments[0]), arguments[1], arguments[2]}); if (!WhichDataType(arguments[0]).isUInt8()) throw Exception("Illegal type " + arguments[0]->getName() + " of first argument (condition) of function if. Must be UInt8.", diff --git a/dbms/src/Functions/multiIf.cpp b/dbms/src/Functions/multiIf.cpp index 818a8f946c6..f5b27e798b3 100644 --- a/dbms/src/Functions/multiIf.cpp +++ b/dbms/src/Functions/multiIf.cpp @@ -63,16 +63,12 @@ public: throw Exception{"Invalid number of arguments for function " + getName(), ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH}; - /// Conditions must be UInt8, Nullable(UInt8) or Null. If one of conditions is Nullable, the result is also Nullable. - bool have_nullable_condition = false; for_conditions([&](const DataTypePtr & arg) { const IDataType * nested_type; if (arg->isNullable()) { - have_nullable_condition = true; - if (arg->onlyNull()) return; @@ -98,11 +94,7 @@ public: types_of_branches.emplace_back(arg); }); - DataTypePtr common_type_of_branches = getLeastSupertype(types_of_branches); - - return have_nullable_condition - ? makeNullable(common_type_of_branches) - : common_type_of_branches; + return getLeastSupertype(types_of_branches); } void executeImpl(Block & block, const ColumnNumbers & args, size_t result, size_t input_rows_count) override diff --git a/dbms/tests/queries/0_stateless/00395_nullable.reference b/dbms/tests/queries/0_stateless/00395_nullable.reference index 64af8c3d21d..5ab0e1843ca 100644 --- a/dbms/tests/queries/0_stateless/00395_nullable.reference +++ b/dbms/tests/queries/0_stateless/00395_nullable.reference @@ -66,7 +66,7 @@ \N \N \N 2 7 2 5 1 5 -9 \N \N +9 \N 9 42 42 \N \N 6 \N \N \N \N @@ -100,6 +100,28 @@ 42 \N \N +----- if ----- +a 1 UInt8 +b 1 UInt8 +c 0 UInt8 +\N 0 UInt8 +a \N Nullable(UInt8) +b \N Nullable(UInt8) +c 0 Nullable(UInt8) +\N 0 Nullable(UInt8) +----- case when ----- +a 1 UInt8 +b 1 UInt8 +c 0 UInt8 +\N 0 UInt8 +a \N Nullable(UInt8) +b \N Nullable(UInt8) +c 0 Nullable(UInt8) +\N 0 Nullable(UInt8) +a 1 Nullable(UInt8) +b 1 Nullable(UInt8) +c \N Nullable(UInt8) +\N \N Nullable(UInt8) ----- multiIf ----- \N 2 diff --git a/dbms/tests/queries/0_stateless/00395_nullable.sql b/dbms/tests/queries/0_stateless/00395_nullable.sql index 77efc018a8a..92ede10567a 100644 --- a/dbms/tests/queries/0_stateless/00395_nullable.sql +++ b/dbms/tests/queries/0_stateless/00395_nullable.sql @@ -146,6 +146,21 @@ SELECT '----- IS NULL, IS NOT NULL -----'; SELECT col1 FROM test1 WHERE col1 IS NOT NULL ORDER BY col1 ASC; SELECT col1 FROM test1 WHERE col1 IS NULL; +SELECT '----- if -----'; + +DROP TABLE IF EXISTS test.test1; +CREATE TABLE test.test1 (col1 Nullable(String)) ENGINE=TinyLog; +INSERT INTO test.test1 VALUES ('a'), ('b'), ('c'), (NULL); + +SELECT col1, if(col1 IN ('a' ,'b'), 1, 0) AS t, toTypeName(t) FROM test.test1; +SELECT col1, if(col1 IN ('a' ,'b'), NULL, 0) AS t, toTypeName(t) FROM test.test1; + +SELECT '----- case when -----'; + +SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN 1 ELSE 0 END AS t, toTypeName(t) FROM test.test1; +SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN NULL ELSE 0 END AS t, toTypeName(t) FROM test.test1; +SELECT col1, CASE WHEN col1 IN ('a' ,'b') THEN 1 END AS t, toTypeName(t) FROM test.test1; + SELECT '----- multiIf -----'; SELECT multiIf(1, NULL, 1, 3, 4); diff --git a/dbms/tests/queries/0_stateless/00431_if_nulls.reference b/dbms/tests/queries/0_stateless/00431_if_nulls.reference index 428a6518fc3..a6e880eedc3 100644 --- a/dbms/tests/queries/0_stateless/00431_if_nulls.reference +++ b/dbms/tests/queries/0_stateless/00431_if_nulls.reference @@ -1,3 +1,4 @@ +---------- constant_true ---------- Hello Hello Hello @@ -158,6 +159,7 @@ Hello 7 8 9 +---------- constant_false ---------- World World World @@ -318,6 +320,17 @@ World -7 -8 -9 +---------- constant_null ---------- +World +World +World +World +World +World +World +World +World +World \N \N \N @@ -328,7 +341,36 @@ World \N \N \N +0 +-1 +-2 +-3 +-4 +-5 +-6 +-7 +-8 +-9 +0 +-1 +-2 +-3 +-4 \N +-6 +-7 +-8 +-9 +World +World +World +World +World +World +World +World +World +World \N \N \N @@ -339,7 +381,36 @@ World \N \N \N +0 +-1 +-2 +-3 +-4 +-5 +-6 +-7 +-8 +-9 +0 +-1 +-2 +-3 +-4 \N +-6 +-7 +-8 +-9 +World +World +World +World +World +World +World +World +World +World \N \N \N @@ -350,7 +421,36 @@ World \N \N \N +0 +-1 +-2 +-3 +-4 +-5 +-6 +-7 +-8 +-9 +0 +-1 +-2 +-3 +-4 \N +-6 +-7 +-8 +-9 +World +World +World +World +World +World +World +World +World +World \N \N \N @@ -361,123 +461,27 @@ World \N \N \N +0 +-1 +-2 +-3 +-4 +-5 +-6 +-7 +-8 +-9 +0 +-1 +-2 +-3 +-4 \N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N -\N +-6 +-7 +-8 +-9 +---------- cond_non_constant ---------- World Hello World @@ -638,15 +642,16 @@ World 7 -8 -9 +---------- cond_non_constant_nullable ---------- World Hello -\N +World World Hello -\N +World World Hello -\N +World World \N Hello @@ -660,33 +665,33 @@ Hello \N 0 Hello -\N +-2 +-3 +Hello +-5 +-6 +Hello +-8 +-9 +0 +Hello +-2 -3 Hello \N -6 Hello -\N --9 -0 -Hello -\N --3 -Hello -\N --6 -Hello -\N +-8 -9 World \N -\N +World World \N -\N +World World \N -\N +World World \N \N @@ -700,33 +705,33 @@ World \N 0 \N -\N +-2 -3 \N -\N +-5 -6 \N -\N +-8 -9 0 \N -\N +-2 -3 \N \N -6 \N -\N +-8 -9 World 1 -\N +World World 4 -\N +World World 7 -\N +World World \N 1 @@ -740,33 +745,33 @@ World \N 0 1 -\N +-2 -3 4 -\N +-5 -6 7 -\N +-8 -9 0 1 -\N +-2 -3 4 \N -6 7 -\N +-8 -9 World 1 -\N +World World 4 -\N +World World 7 -\N +World World \N 1 @@ -780,21 +785,21 @@ World \N 0 1 -\N +-2 -3 4 -\N +-5 -6 7 -\N +-8 -9 0 1 -\N +-2 -3 4 \N -6 7 -\N +-8 -9 diff --git a/dbms/tests/queries/0_stateless/00431_if_nulls.sql b/dbms/tests/queries/0_stateless/00431_if_nulls.sql index 1e78c2b27a3..024f2494410 100644 --- a/dbms/tests/queries/0_stateless/00431_if_nulls.sql +++ b/dbms/tests/queries/0_stateless/00431_if_nulls.sql @@ -31,6 +31,7 @@ AS SELECT nullIf(toString(-number), '-5') AS else_non_constant_nullable FROM system.numbers LIMIT 10; +SELECT '---------- constant_true ----------'; SELECT constant_true ? then_constant : else_constant AS res FROM nullable_00431; SELECT constant_true ? then_constant : constant_null AS res FROM nullable_00431; @@ -52,6 +53,7 @@ SELECT constant_true ? then_non_constant_nullable : constant_null AS res FROM nu SELECT constant_true ? then_non_constant_nullable : else_non_constant AS res FROM nullable_00431; SELECT constant_true ? then_non_constant_nullable : else_non_constant_nullable AS res FROM nullable_00431; +SELECT '---------- constant_false ----------'; SELECT constant_false ? then_constant : else_constant AS res FROM nullable_00431; SELECT constant_false ? then_constant : constant_null AS res FROM nullable_00431; @@ -73,6 +75,7 @@ SELECT constant_false ? then_non_constant_nullable : constant_null AS res FROM n SELECT constant_false ? then_non_constant_nullable : else_non_constant AS res FROM nullable_00431; SELECT constant_false ? then_non_constant_nullable : else_non_constant_nullable AS res FROM nullable_00431; +SELECT '---------- constant_null ----------'; SELECT constant_null ? then_constant : else_constant AS res FROM nullable_00431; SELECT constant_null ? then_constant : constant_null AS res FROM nullable_00431; @@ -94,6 +97,7 @@ SELECT constant_null ? then_non_constant_nullable : constant_null AS res FROM nu SELECT constant_null ? then_non_constant_nullable : else_non_constant AS res FROM nullable_00431; SELECT constant_null ? then_non_constant_nullable : else_non_constant_nullable AS res FROM nullable_00431; +SELECT '---------- cond_non_constant ----------'; SELECT cond_non_constant ? then_constant : else_constant AS res FROM nullable_00431; SELECT cond_non_constant ? then_constant : constant_null AS res FROM nullable_00431; @@ -115,6 +119,7 @@ SELECT cond_non_constant ? then_non_constant_nullable : constant_null AS res FRO SELECT cond_non_constant ? then_non_constant_nullable : else_non_constant AS res FROM nullable_00431; SELECT cond_non_constant ? then_non_constant_nullable : else_non_constant_nullable AS res FROM nullable_00431; +SELECT '---------- cond_non_constant_nullable ----------'; SELECT cond_non_constant_nullable ? then_constant : else_constant AS res FROM nullable_00431; SELECT cond_non_constant_nullable ? then_constant : constant_null AS res FROM nullable_00431; From e4988110ec11500a83c618e0f2e772883a906179 Mon Sep 17 00:00:00 2001 From: Vasily Nemkov Date: Tue, 9 Apr 2019 22:19:30 +0300 Subject: [PATCH 123/194] Implementation of geohashEncode and geohashDecode functions; Function signatures: * geohashEncode(float lon, float lat, int precision) => string * geohashDecode(string encoded) => (float llon, float lat) With test cases and documentation; --- dbms/src/DataTypes/IDataType.h | 7 + dbms/src/Functions/FunctionHelpers.cpp | 19 ++ dbms/src/Functions/FunctionHelpers.h | 9 +- dbms/src/Functions/FunctionsGeo.cpp | 199 ++++++++++++++- dbms/src/Functions/GeoUtils.cpp | 232 ++++++++++++++++++ dbms/src/Functions/GeoUtils.h | 4 + .../funtions_geo/functions_geo.xml | 29 +++ .../00932_geohash_support.reference | 227 +++++++++++++++++ .../0_stateless/00932_geohash_support.sql | 67 +++++ docs/en/query_language/functions/geo.md | 52 ++++ 10 files changed, 838 insertions(+), 7 deletions(-) create mode 100644 dbms/src/Functions/GeoUtils.cpp create mode 100644 dbms/tests/performance/funtions_geo/functions_geo.xml create mode 100644 dbms/tests/queries/0_stateless/00932_geohash_support.reference create mode 100644 dbms/tests/queries/0_stateless/00932_geohash_support.sql diff --git a/dbms/src/DataTypes/IDataType.h b/dbms/src/DataTypes/IDataType.h index 60124cd3d5d..ad03b3cdd48 100644 --- a/dbms/src/DataTypes/IDataType.h +++ b/dbms/src/DataTypes/IDataType.h @@ -573,6 +573,13 @@ inline bool isInteger(const T & data_type) return which.isInt() || which.isUInt(); } +template +inline bool isFloat(const T & data_type) +{ + WhichDataType which(data_type); + return which.isFloat(); +} + template inline bool isNumber(const T & data_type) { diff --git a/dbms/src/Functions/FunctionHelpers.cpp b/dbms/src/Functions/FunctionHelpers.cpp index 1a05d3c2bfe..42fcebd5848 100644 --- a/dbms/src/Functions/FunctionHelpers.cpp +++ b/dbms/src/Functions/FunctionHelpers.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -13,6 +14,7 @@ namespace DB namespace ErrorCodes { extern const int ILLEGAL_COLUMN; + extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH; } const ColumnConst * checkAndGetColumnConstStringOrFixedString(const IColumn * column) @@ -99,4 +101,21 @@ Block createBlockWithNestedColumns(const Block & block, const ColumnNumbers & ar return createBlockWithNestedColumnsImpl(block, args_set); } +void validateArgumentType(const IFunction & func, const DataTypes & arguments, + size_t argument_index, bool (* validator_func)(const IDataType &), + const char * expected_type_description) +{ + if (arguments.size() <= argument_index) + throw Exception("Incorrect number of arguments of function " + func.getName(), + ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); + + const auto & argument = arguments[argument_index]; + if (validator_func(*argument) == false) + throw Exception("Illegal type " + argument->getName() + + " of " + std::to_string(argument_index) + + " argument of function " + func.getName() + + " expected " + expected_type_description, + ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT); +} + } diff --git a/dbms/src/Functions/FunctionHelpers.h b/dbms/src/Functions/FunctionHelpers.h index 6be58f32c5e..8e1efd113f8 100644 --- a/dbms/src/Functions/FunctionHelpers.h +++ b/dbms/src/Functions/FunctionHelpers.h @@ -12,6 +12,8 @@ namespace DB { +class IFunction; + /// Methods, that helps dispatching over real column types. template @@ -64,7 +66,6 @@ bool checkColumnConst(const IColumn * column) return checkAndGetColumnConst(column); } - /// Returns non-nullptr if column is ColumnConst with ColumnString or ColumnFixedString inside. const ColumnConst * checkAndGetColumnConstStringOrFixedString(const IColumn * column); @@ -94,4 +95,10 @@ Block createBlockWithNestedColumns(const Block & block, const ColumnNumbers & ar /// Similar function as above. Additionally transform the result type if needed. Block createBlockWithNestedColumns(const Block & block, const ColumnNumbers & args, size_t result); +/// Checks argument type at specified index with predicate. +/// throws if there is no argument at specified index or if predicate returns false. +void validateArgumentType(const IFunction & func, const DataTypes & arguments, + size_t argument_index, bool (* validator_func)(const IDataType &), + const char * expected_type_description); + } diff --git a/dbms/src/Functions/FunctionsGeo.cpp b/dbms/src/Functions/FunctionsGeo.cpp index 0d13914f103..7b45fb8a668 100644 --- a/dbms/src/Functions/FunctionsGeo.cpp +++ b/dbms/src/Functions/FunctionsGeo.cpp @@ -1,19 +1,24 @@ #include #include #include +#include #include #include #include -#include -#include -#include -#include -#include #include -#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include + #include #include @@ -246,6 +251,186 @@ private: }; +const size_t GEOHASH_MAX_TEXT_LENGTH = 16; + +// geohashEncode(lon float32/64, lat float32/64, length UInt8) => string +class FunctionGeohashEncode : public IFunction +{ +public: + static constexpr auto name = "geohashEncode"; + static FunctionPtr create(const Context &) { return std::make_shared(); } + + String getName() const override + { + return name; + } + + bool isVariadic() const override { return true; } + size_t getNumberOfArguments() const override { return 0; } + ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {2}; } + bool useDefaultImplementationForConstants() const override { return true; } + + DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override + { + validateArgumentType(*this, arguments, 0, isFloat, "float"); + validateArgumentType(*this, arguments, 1, isFloat, "float"); + if (arguments.size() == 3) + { + validateArgumentType(*this, arguments, 2, isInteger, "integer"); + } + if (arguments.size() > 3) + { + throw Exception("Too many arguments for function " + getName() + + " expected at most 3", + ErrorCodes::TOO_MANY_ARGUMENTS_FOR_FUNCTION); + } + + return std::make_shared(); + } + + template + bool tryExecute(const IColumn * lon_column, const IColumn * lat_column, UInt64 precision_value, ColumnPtr & result) + { + const ColumnVector * longitude = checkAndGetColumn>(lon_column); + const ColumnVector * latitude = checkAndGetColumn>(lat_column); + if (!latitude || !longitude) + return false; + + auto col_str = ColumnString::create(); + ColumnString::Chars & out_vec = col_str->getChars(); + ColumnString::Offsets & out_offsets = col_str->getOffsets(); + + const size_t size = lat_column->size(); + + out_offsets.resize(size); + out_vec.resize(size * (GEOHASH_MAX_TEXT_LENGTH + 1)); + + char * begin = reinterpret_cast(out_vec.data()); + char * pos = begin; + + for (size_t i = 0; i < size; ++i) + { + const Float64 longitude_value = longitude->getElement(i); + const Float64 latitude_value = latitude->getElement(i); + + const size_t encoded_size = GeoUtils::geohashEncode(longitude_value, latitude_value, precision_value, pos); + + pos += encoded_size; + *pos = '\0'; + out_offsets[i] = ++pos - begin; + } + out_vec.resize(pos - begin); + + if (!out_offsets.empty() && out_offsets.back() != out_vec.size()) + throw Exception("Column size mismatch (internal logical error)", ErrorCodes::LOGICAL_ERROR); + + result = std::move(col_str); + + return true; + + } + + void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override + { + const IColumn * longitude = block.getByPosition(arguments[0]).column.get(); + const IColumn * latitude = block.getByPosition(arguments[1]).column.get(); + + const UInt64 precision_value = std::min(GEOHASH_MAX_TEXT_LENGTH, + arguments.size() == 3 ? block.getByPosition(arguments[2]).column->get64(0) : GEOHASH_MAX_TEXT_LENGTH); + + ColumnPtr & res_column = block.getByPosition(result).column; + + if (tryExecute(longitude, latitude, precision_value, res_column) || + tryExecute(longitude, latitude, precision_value, res_column) || + tryExecute(longitude, latitude, precision_value, res_column) || + tryExecute(longitude, latitude, precision_value, res_column)) + return; + + const char sep[] = ", "; + std::string arguments_description = ""; + for (size_t i = 0; i < arguments.size(); ++i) + { + arguments_description += block.getByPosition(arguments[i]).column->getName() + sep; + } + if (arguments_description.size() > sizeof(sep)) + { + arguments_description.erase(arguments_description.size() - sizeof(sep) - 1); + } + + throw Exception("Unsupported argument types: " + arguments_description + + + " for function " + getName(), + ErrorCodes::ILLEGAL_COLUMN); + } +}; + +// geohashDecode(string) => (lon float64, lat float64) +class FunctionGeohashDecode : public IFunction +{ +public: + static constexpr auto name = "geohashDecode"; + static FunctionPtr create(const Context &) { return std::make_shared(); } + + String getName() const override + { + return name; + } + + size_t getNumberOfArguments() const override { return 1; } + bool useDefaultImplementationForConstants() const override { return true; } + + DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override + { + validateArgumentType(*this, arguments, 0, isStringOrFixedString, "string or fixed string"); + + return std::make_shared( + DataTypes{std::make_shared(), std::make_shared()}, + Strings{"longitude", "latitude"}); + } + + template + bool tryExecute(const IColumn * encoded_column, ColumnPtr & result_column) + { + const auto * encoded = checkAndGetColumn(encoded_column); + if (!encoded) + return false; + + const size_t count = encoded->size(); + + auto latitude = ColumnFloat64::create(count); + auto longitude = ColumnFloat64::create(count); + + ColumnFloat64::Container & lon_data = longitude->getData(); + ColumnFloat64::Container & lat_data = latitude->getData(); + + for (size_t i = 0; i < count; ++i) + { + StringRef encoded_string = encoded->getDataAt(i); + GeoUtils::geohashDecode(encoded_string.data, encoded_string.size, &lon_data[i], &lat_data[i]); + } + + MutableColumns result; + result.emplace_back(std::move(longitude)); + result.emplace_back(std::move(latitude)); + result_column = ColumnTuple::create(std::move(result)); + + return true; + } + + void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result, size_t /*input_rows_count*/) override + { + const IColumn * encoded = block.getByPosition(arguments[0]).column.get(); + ColumnPtr & res_column = block.getByPosition(result).column; + + if (tryExecute(encoded, res_column) || + tryExecute(encoded, res_column)) + return; + + throw Exception("Unsupported argument type:" + block.getByPosition(arguments[0]).column->getName() + + " of argument of function " + getName(), + ErrorCodes::ILLEGAL_COLUMN); + } +}; + template using Point = boost::geometry::model::d2::point_xy; @@ -261,5 +446,7 @@ void registerFunctionsGeo(FunctionFactory & factory) factory.registerFunction(); factory.registerFunction>(); + factory.registerFunction(); + factory.registerFunction(); } } diff --git a/dbms/src/Functions/GeoUtils.cpp b/dbms/src/Functions/GeoUtils.cpp new file mode 100644 index 00000000000..8624b1c3b45 --- /dev/null +++ b/dbms/src/Functions/GeoUtils.cpp @@ -0,0 +1,232 @@ +#include +#include + +namespace +{ + +using namespace DB; + +const char geohash_base32_encode_lookup_table[32] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'j', 'k', 'm', + 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', + 'y', 'z', +}; + +// TODO: this could be halved by excluding 128-255 range. +const UInt8 geohash_base32_decode_lookup_table[256] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 10, 11, 12, 13, 14, 15, 16, 0xFF, 17, 18, 0xFF, 19, 20, 0xFF, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +}; + +const size_t BITS_PER_SYMBOL = 5; +const size_t MAX_PRECISION = 12; +const size_t MAX_BITS = MAX_PRECISION * BITS_PER_SYMBOL * 1.5; + +using Encoded = std::array; + +enum CoordType +{ + LATITUDE, + LONGITUDE, +}; + +inline UInt8 singleCoordBitsPrecision(UInt8 precision, CoordType type) +{ + // Single coordinate occupies only half of the total bits. + const UInt8 bits = (precision * BITS_PER_SYMBOL) / 2; + if (precision & 0x1 && type == LONGITUDE) + { + return bits + 1; + } + + return bits; +} + +inline Encoded encodeCoordinate(Float64 coord, Float64 min, Float64 max, UInt8 bits) +{ + Encoded result; + result.fill(0); + + for (int i = 0; i < bits; ++i) + { + Float64 mid = (max + min) / 2; + if (coord >= mid) + { + result[i] = 1; + min = mid; + } + else + { + result[i] = 0; + max = mid; + } + } + + return result; +} + +inline Float64 decodeCoordinate(const Encoded & coord, Float64 min, Float64 max, UInt8 bits) +{ + Float64 mid = (max + min) / 2; + for (int i = 0; i < bits; ++i) + { + const auto c = coord[i]; + if (c == 1) + { + min = mid; + } + else + { + max = mid; + } + + mid = (max + min) / 2; + } + + return mid; +} + +inline Encoded merge(const Encoded & encodedLon, const Encoded & encodedLat, UInt8 precision) +{ + Encoded result; + result.fill(0); + + const auto bits = (precision * BITS_PER_SYMBOL) / 2; + UInt8 i = 0; + for (; i < bits; ++i) + { + result[i * 2 + 0] = encodedLon[i]; + result[i * 2 + 1] = encodedLat[i]; + } + // in case of even precision, add last bit of longitude + if (precision & 0x1) + { + result[i * 2] = encodedLon[i]; + } + + return result; +} + +inline std::tuple split(const Encoded & combined, UInt8 precision) +{ + Encoded lat, lon; + lat.fill(0); + lon.fill(0); + + UInt8 i = 0; + for (; i < precision * BITS_PER_SYMBOL - 1; i += 2) + { + // longitude is even bits + lon[i/2] = combined[i]; + lat[i/2] = combined[i + 1]; + } + // precision is even, read the last bit as lat. + if (precision & 0x1) + { + lon[i/2] = combined[precision * BITS_PER_SYMBOL - 1]; + } + + return std::tie(lon, lat); +} + +inline void base32Encode(const Encoded & binary, UInt8 precision, char * out) +{ + extern const char geohash_base32_encode_lookup_table[32]; + + for (UInt8 i = 0; i < precision * BITS_PER_SYMBOL; i += 5) + { + UInt8 v = binary[i]; + v <<= 1; + v |= binary[i + 1]; + v <<= 1; + v |= binary[i + 2]; + v <<= 1; + v |= binary[i + 3]; + v <<= 1; + v |= binary[i + 4]; + + assert(v < 32); + + *out = geohash_base32_encode_lookup_table[v]; + ++out; + } +} + +inline Encoded base32Decode(const char * encoded_string, size_t encoded_length) +{ + extern const UInt8 geohash_base32_decode_lookup_table[256]; + + Encoded result; + + for (size_t i = 0; i < encoded_length; ++i) + { + const UInt8 c = static_cast(encoded_string[i]); + const UInt8 decoded = geohash_base32_decode_lookup_table[c] & 0x1F; + result[i * 5 + 4] = (decoded >> 0) & 0x01; + result[i * 5 + 3] = (decoded >> 1) & 0x01; + result[i * 5 + 2] = (decoded >> 2) & 0x01; + result[i * 5 + 1] = (decoded >> 3) & 0x01; + result[i * 5 + 0] = (decoded >> 4) & 0x01; + } + + return result; +} + +} // namespace + +namespace DB +{ + +namespace GeoUtils +{ + +size_t geohashEncode(Float64 longitude, Float64 latitude, UInt8 precision, char *& out) +{ + if (precision == 0 || precision > MAX_PRECISION) + { + precision = MAX_PRECISION; + } + + const Encoded combined = merge( + encodeCoordinate(longitude, -180, 180, singleCoordBitsPrecision(precision, LONGITUDE)), + encodeCoordinate(latitude, -90, 90, singleCoordBitsPrecision(precision, LATITUDE)), + precision); + + base32Encode(combined, precision, out); + + return precision; +} + +void geohashDecode(const char * encoded_string, size_t encoded_len, Float64 * longitude, Float64 * latitude) +{ + const UInt8 precision = std::min(encoded_len, MAX_PRECISION); + if (precision == 0) + { + return; + } + + Encoded lat_encoded, lon_encoded; + std::tie(lon_encoded, lat_encoded) = split(base32Decode(encoded_string, precision), precision); + + *longitude = decodeCoordinate(lon_encoded, -180, 180, singleCoordBitsPrecision(precision, LONGITUDE)); + *latitude = decodeCoordinate(lat_encoded, -90, 90, singleCoordBitsPrecision(precision, LATITUDE)); +} + +} // namespace GeoUtils + +} // namespace DB diff --git a/dbms/src/Functions/GeoUtils.h b/dbms/src/Functions/GeoUtils.h index 425377f17ae..731305cd705 100644 --- a/dbms/src/Functions/GeoUtils.h +++ b/dbms/src/Functions/GeoUtils.h @@ -699,6 +699,10 @@ std::string serialize(Polygon && polygon) return result; } +size_t geohashEncode(Float64 longitude, Float64 latitude, UInt8 precision, char *& out); + +void geohashDecode(const char * encoded_string, size_t encoded_len, Float64 * longitude, Float64 * latitude); + } /// GeoUtils diff --git a/dbms/tests/performance/funtions_geo/functions_geo.xml b/dbms/tests/performance/funtions_geo/functions_geo.xml new file mode 100644 index 00000000000..b1ea38be447 --- /dev/null +++ b/dbms/tests/performance/funtions_geo/functions_geo.xml @@ -0,0 +1,29 @@ + + functions_coding + once + + + + 300 + 1000 + + + + + + + + + + + + SELECT count() FROM system.numbers WHERE NOT ignore(geohashEncode((number % 150)*1.1 - 75, (number * 3.14 % 300)*1.1 - 150)) + SELECT count() FROM system.numbers WHERE NOT ignore(geohashDecode(toString(number % 1000000))) + + SELECT count() FROM system.numbers WHERE NOT ignore(geohashEncode(1.0/rand(), 2.0/rand())) + SELECT count() FROM system.numbers WHERE NOT ignore(geohashDecode(toString(rand() % 1000000))) + + + SELECT count() FROM system.numbers WHERE NOT ignore(geohashEncode(number + 91.0, number + 181.0)) + SELECT count() FROM system.numbers WHERE NOT ignore(geohashDecode(hex(number))) + diff --git a/dbms/tests/queries/0_stateless/00932_geohash_support.reference b/dbms/tests/queries/0_stateless/00932_geohash_support.reference new file mode 100644 index 00000000000..ffc290681c7 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00932_geohash_support.reference @@ -0,0 +1,227 @@ +invalid values: +zzzzzzzzzzzz +000000000000 +1 +constant values: +ezs42d000000 +-5.60303 42.60498 +default precision: +ezs42d000000 +mixing const and non-const-columns: +ezs42d000000 +from table (with const precision): +1 6 Ok +1 6 Ok +1 6 Ok +1 7 Ok +1 7 Ok +1 k Ok +1 k Ok +1 k Ok +1 7 Ok +1 7 Ok +1 k Ok +1 k Ok +1 k Ok +1 e Ok +1 e Ok +1 s Ok +1 s Ok +1 s Ok +1 e Ok +1 e Ok +1 s Ok +1 s Ok +1 s Ok +1 e Ok +1 e Ok +1 s Ok +1 s Ok +1 s Ok +1 w Ok +1 g Ok +1 u Ok +2 6g Ok +2 6g Ok +2 6g Ok +2 7z Ok +2 7z Ok +2 kp Ok +2 kp Ok +2 kp Ok +2 7z Ok +2 7z Ok +2 kp Ok +2 kp Ok +2 kp Ok +2 eb Ok +2 eb Ok +2 s0 Ok +2 s0 Ok +2 s0 Ok +2 eb Ok +2 eb Ok +2 s0 Ok +2 s0 Ok +2 s0 Ok +2 eb Ok +2 eb Ok +2 s0 Ok +2 s0 Ok +2 s0 Ok +2 w1 Ok +2 gc Ok +2 u9 Ok +3 6gk Ok +3 6gk Ok +3 6gk Ok +3 7zz Ok +3 7zz Ok +3 kpb Ok +3 kpb Ok +3 kpb Ok +3 7zz Ok +3 7zz Ok +3 kpb Ok +3 kpb Ok +3 kpb Ok +3 ebp Ok +3 ebp Ok +3 s00 Ok +3 s00 Ok +3 s00 Ok +3 ebp Ok +3 ebp Ok +3 s00 Ok +3 s00 Ok +3 s00 Ok +3 ebp Ok +3 ebp Ok +3 s00 Ok +3 s00 Ok +3 s00 Ok +3 w1m Ok +3 gcp Ok +3 u9e Ok +4 6gkz Ok +4 6gkz Ok +4 6gkz Ok +4 7zzz Ok +4 7zzz Ok +4 kpbp Ok +4 kpbp Ok +4 kpbp Ok +4 7zzz Ok +4 7zzz Ok +4 kpbp Ok +4 kpbp Ok +4 kpbp Ok +4 ebpb Ok +4 ebpb Ok +4 s000 Ok +4 s000 Ok +4 s000 Ok +4 ebpb Ok +4 ebpb Ok +4 s000 Ok +4 s000 Ok +4 s000 Ok +4 ebpb Ok +4 ebpb Ok +4 s000 Ok +4 s000 Ok +4 s000 Ok +4 w1mu Ok +4 gcpv Ok +4 u9ed Ok +5 6gkzm Ok +5 6gkzw Ok +5 6gkzw Ok +5 7zzzm Ok +5 7zzzr Ok +5 kpbp2 Ok +5 kpbp2 Ok +5 kpbp6 Ok +5 7zzzv Ok +5 7zzzz Ok +5 kpbpb Ok +5 kpbpb Ok +5 kpbpf Ok +5 ebpbj Ok +5 ebpbp Ok +5 s0000 Ok +5 s0004 Ok +5 ebpbj Ok +5 ebpbp Ok +5 s0000 Ok +5 s0000 Ok +5 s0004 Ok +5 ebpbt Ok +5 ebpbx Ok +5 s0008 Ok +5 s0008 Ok +5 s000d Ok +5 w1muy Ok +5 gcpvn Ok +5 u9edu Ok +6 6gkzmg Ok +6 6gkzwg Ok +6 6gkzwg Ok +6 7zzzrv Ok +6 kpbp2j Ok +6 7zzzvw Ok +6 7zzzzy Ok +6 kpbpbn Ok +6 kpbpbn Ok +6 kpbpfq Ok +6 ebpbpb Ok +6 s00000 Ok +6 ebpbj9 Ok +6 ebpbpc Ok +6 s00001 Ok +6 s00001 Ok +6 s00043 Ok +6 ebpbxf Ok +6 s00084 Ok +6 w1muy6 Ok +6 gcpvn5 Ok +6 u9edu0 Ok +7 6gkzmg1 Ok +7 6gkzwgj Ok +7 6gkzwgj Ok +7 7zzzrvb Ok +7 kpbp2jz Ok +7 7zzzzy0 Ok +7 kpbpbnp Ok +7 ebpbpb0 Ok +7 s00000p Ok +7 ebpbpcb Ok +7 s00001z Ok +7 ebpbxf0 Ok +7 s00084p Ok +7 w1muy6d Ok +7 gcpvn5w Ok +7 u9edu0q Ok +8 6gkzmg1u Ok +8 6gkzwgjt Ok +8 6gkzwgjz Ok +8 w1muy6dt Ok +8 gcpvn5w2 Ok +8 u9edu0qs Ok +9 6gkzwgjzn Ok +9 w1muy6dt2 Ok +9 gcpvn5w2e Ok +9 u9edu0qsf Ok +10 6gkzwgjzn8 Ok +10 w1muy6dt2p Ok +10 gcpvn5w2eu Ok +10 u9edu0qsf7 Ok +11 6gkzwgjzn82 Ok +11 w1muy6dt2pt Ok +11 gcpvn5w2euk Ok +11 u9edu0qsf7d Ok +12 6gkzwgjzn820 Ok +12 w1muy6dt2ptk Ok +12 gcpvn5w2euky Ok +12 u9edu0qsf7dn Ok +incorrectly decoded values: diff --git a/dbms/tests/queries/0_stateless/00932_geohash_support.sql b/dbms/tests/queries/0_stateless/00932_geohash_support.sql new file mode 100644 index 00000000000..a477332b532 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00932_geohash_support.sql @@ -0,0 +1,67 @@ +drop table if exists geohash_test_data; + +create table geohash_test_data ( + latitude Float64, + longitude Float64, + encoded String +) engine = MergeTree order by (latitude, longitude, encoded); + +-- data obtained from geohash.com +insert into geohash_test_data values (-25.427, -49.315, '6'), (-25.427, -49.315, '6g'), (-25.427, -49.315, '6gk'), (-25.427, -49.315, '6gkz'), (-25.427, -49.315, '6gkzm'), (-25.427, -49.315, '6gkzmg'), (-25.427, -49.315, '6gkzmg1'), (-25.427, -49.315, '6gkzmg1u'), (-25.383, -49.266, '6'), (-25.383, -49.266, '6g'), (-25.383, -49.266, '6gk'), (-25.383, -49.266, '6gkz'), (-25.383, -49.266, '6gkzw'), (-25.383, -49.266, '6gkzwg'), (-25.383, -49.266, '6gkzwgj'), (-25.383, -49.266, '6gkzwgjt'), (-25.382708, -49.265506, '6'), (-25.382708, -49.265506, '6g'), (-25.382708, -49.265506, '6gk'), (-25.382708, -49.265506, '6gkz'), (-25.382708, -49.265506, '6gkzw'), (-25.382708, -49.265506, '6gkzwg'), (-25.382708, -49.265506, '6gkzwgj'), (-25.382708, -49.265506, '6gkzwgjz'), (-25.382708, -49.265506, '6gkzwgjzn'), (-25.382708, -49.265506, '6gkzwgjzn8'), (-25.382708, -49.265506, '6gkzwgjzn82'), (-25.382708, -49.265506, '6gkzwgjzn820'), (-0.1, -0.1, '7'), (-0.1, -0.1, '7z'), (-0.1, -0.1, '7zz'), (-0.1, -0.1, '7zzz'), (-0.1, -0.1, '7zzzm'), (-0.1, -0.01, '7'), (-0.1, -0.01, '7z'), (-0.1, -0.01, '7zz'), (-0.1, -0.01, '7zzz'), (-0.1, -0.01, '7zzzr'), (-0.1, -0.01, '7zzzrv'), (-0.1, -0.01, '7zzzrvb'), (-0.1, 0, 'k'), (-0.1, 0, 'kp'), (-0.1, 0, 'kpb'), (-0.1, 0, 'kpbp'), (-0.1, 0, 'kpbp2'), (-0.1, 0.01, 'k'), (-0.1, 0.01, 'kp'), (-0.1, 0.01, 'kpb'), (-0.1, 0.01, 'kpbp'), (-0.1, 0.01, 'kpbp2'), (-0.1, 0.01, 'kpbp2j'), (-0.1, 0.01, 'kpbp2jz'), (-0.1, 0.1, 'k'), (-0.1, 0.1, 'kp'), (-0.1, 0.1, 'kpb'), (-0.1, 0.1, 'kpbp'), (-0.1, 0.1, 'kpbp6'), (-0.01, -0.1, '7'), (-0.01, -0.1, '7z'), (-0.01, -0.1, '7zz'), (-0.01, -0.1, '7zzz'), (-0.01, -0.1, '7zzzv'), (-0.01, -0.1, '7zzzvw'), (-0.01, -0.01, '7'), (-0.01, -0.01, '7z'), (-0.01, -0.01, '7zz'), (-0.01, -0.01, '7zzz'), (-0.01, -0.01, '7zzzz'), (-0.01, -0.01, '7zzzzy'), (-0.01, -0.01, '7zzzzy0'), (-0.01, 0, 'k'), (-0.01, 0, 'kp'), (-0.01, 0, 'kpb'), (-0.01, 0, 'kpbp'), (-0.01, 0, 'kpbpb'), (-0.01, 0, 'kpbpbn'), (-0.01, 0.01, 'k'), (-0.01, 0.01, 'kp'), (-0.01, 0.01, 'kpb'), (-0.01, 0.01, 'kpbp'), (-0.01, 0.01, 'kpbpb'), (-0.01, 0.01, 'kpbpbn'), (-0.01, 0.01, 'kpbpbnp'), (-0.01, 0.1, 'k'), (-0.01, 0.1, 'kp'), (-0.01, 0.1, 'kpb'), (-0.01, 0.1, 'kpbp'), (-0.01, 0.1, 'kpbpf'), (-0.01, 0.1, 'kpbpfq'), (0, -0.1, 'e'), (0, -0.1, 'eb'), (0, -0.1, 'ebp'), (0, -0.1, 'ebpb'), (0, -0.1, 'ebpbj'), (0, -0.01, 'e'), (0, -0.01, 'eb'), (0, -0.01, 'ebp'), (0, -0.01, 'ebpb'), (0, -0.01, 'ebpbp'), (0, -0.01, 'ebpbpb'), (0, -0.01, 'ebpbpb0'), (0, 0, 's'), (0, 0, 's0'), (0, 0, 's00'), (0, 0, 's000'), (0, 0.01, 's'), (0, 0.01, 's0'), (0, 0.01, 's00'), (0, 0.01, 's000'), (0, 0.01, 's0000'), (0, 0.01, 's00000'), (0, 0.01, 's00000p'), (0, 0.1, 's'), (0, 0.1, 's0'), (0, 0.1, 's00'), (0, 0.1, 's000'), (0, 0.1, 's0004'), (0.01, -0.1, 'e'), (0.01, -0.1, 'eb'), (0.01, -0.1, 'ebp'), (0.01, -0.1, 'ebpb'), (0.01, -0.1, 'ebpbj'), (0.01, -0.1, 'ebpbj9'), (0.01, -0.01, 'e'), (0.01, -0.01, 'eb'), (0.01, -0.01, 'ebp'), (0.01, -0.01, 'ebpb'), (0.01, -0.01, 'ebpbp'), (0.01, -0.01, 'ebpbpc'), (0.01, -0.01, 'ebpbpcb'), (0.01, 0, 's'), (0.01, 0, 's0'), (0.01, 0, 's00'), (0.01, 0, 's000'), (0.01, 0, 's0000'), (0.01, 0, 's00001'), (0.01, 0.01, 's'), (0.01, 0.01, 's0'), (0.01, 0.01, 's00'), (0.01, 0.01, 's000'), (0.01, 0.01, 's0000'), (0.01, 0.01, 's00001'), (0.01, 0.01, 's00001z'), (0.01, 0.1, 's'), (0.01, 0.1, 's0'), (0.01, 0.1, 's00'), (0.01, 0.1, 's000'), (0.01, 0.1, 's0004'), (0.01, 0.1, 's00043'), (0.1, -0.1, 'e'), (0.1, -0.1, 'eb'), (0.1, -0.1, 'ebp'), (0.1, -0.1, 'ebpb'), (0.1, -0.1, 'ebpbt'), (0.1, -0.01, 'e'), (0.1, -0.01, 'eb'), (0.1, -0.01, 'ebp'), (0.1, -0.01, 'ebpb'), (0.1, -0.01, 'ebpbx'), (0.1, -0.01, 'ebpbxf'), (0.1, -0.01, 'ebpbxf0'), (0.1, 0, 's'), (0.1, 0, 's0'), (0.1, 0, 's00'), (0.1, 0, 's000'), (0.1, 0, 's0008'), (0.1, 0.01, 's'), (0.1, 0.01, 's0'), (0.1, 0.01, 's00'), (0.1, 0.01, 's000'), (0.1, 0.01, 's0008'), (0.1, 0.01, 's00084'), (0.1, 0.01, 's00084p'), (0.1, 0.1, 's'), (0.1, 0.1, 's0'), (0.1, 0.1, 's00'), (0.1, 0.1, 's000'), (0.1, 0.1, 's000d'), (7.880886, 98.3640363, 'w'), (7.880886, 98.3640363, 'w1'), (7.880886, 98.3640363, 'w1m'), (7.880886, 98.3640363, 'w1mu'), (7.880886, 98.3640363, 'w1muy'), (7.880886, 98.3640363, 'w1muy6'), (7.880886, 98.3640363, 'w1muy6d'), (7.880886, 98.3640363, 'w1muy6dt'), (7.880886, 98.3640363, 'w1muy6dt2'), (7.880886, 98.3640363, 'w1muy6dt2p'), (7.880886, 98.3640363, 'w1muy6dt2pt'), (7.880886, 98.3640363, 'w1muy6dt2ptk'), (51.523242, -0.07914, 'g'), (51.523242, -0.07914, 'gc'), (51.523242, -0.07914, 'gcp'), (51.523242, -0.07914, 'gcpv'), (51.523242, -0.07914, 'gcpvn'), (51.523242, -0.07914, 'gcpvn5'), (51.523242, -0.07914, 'gcpvn5w'), (51.523242, -0.07914, 'gcpvn5w2'), (51.523242, -0.07914, 'gcpvn5w2e'), (51.523242, -0.07914, 'gcpvn5w2eu'), (51.523242, -0.07914, 'gcpvn5w2euk'), (51.523242, -0.07914, 'gcpvn5w2euky'), (53.923107, 27.606682, 'u'), (53.923107, 27.606682, 'u9'), (53.923107, 27.606682, 'u9e'), (53.923107, 27.606682, 'u9ed'), (53.923107, 27.606682, 'u9edu'), (53.923107, 27.606682, 'u9edu0'), (53.923107, 27.606682, 'u9edu0q'), (53.923107, 27.606682, 'u9edu0qs'), (53.923107, 27.606682, 'u9edu0qsf'), (53.923107, 27.606682, 'u9edu0qsf7'), (53.923107, 27.606682, 'u9edu0qsf7d'), (53.923107, 27.606682, 'u9edu0qsf7dn'); + + +select 'invalid values:'; -- must not crash +select geohashEncode(181.0, 91.0); +select geohashEncode(-181.0, -91.0); +select count(geohashDecode('abcdefghijklmnopqrstuvwxyz')); + +select 'constant values:'; +select geohashEncode(-5.60302734375, 42.593994140625, 0); +select round(geohashDecode('ezs42').1, 5), round(geohashDecode('ezs42').2, 5); + +select 'default precision:'; +select geohashEncode(-5.60302734375, 42.593994140625); + +select 'mixing const and non-const-columns:'; +select geohashEncode(materialize(-5.60302734375), materialize(42.593994140625), 0); +select geohashEncode(materialize(-5.60302734375), materialize(42.593994140625), materialize(0)); -- { serverError 44 } + + +select 'from table (with const precision):'; + +-- here results are strings, so reference may contain values to match for equality. +select 1 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 2 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 3 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 4 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 5 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 6 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 7 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 8 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 9 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 10 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 11 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; +select 12 as p, geohashEncode(longitude, latitude, p) as actual, if(actual = encoded, 'Ok', concat('expected: ', encoded)) from geohash_test_data WHERE length(encoded) = p; + +-- Here results are floats, and hence may not be compared for equality directly. +-- We select all values that are off by some reasonable value: +-- each byte of encoded string provides 5 bits of precison, (roughly 2.5 for lon and lat) +-- each bit of precision divides value range by 2. +-- hence max error is roughly value range 2.5 times divided by 2 for each precision bit. +-- initial value range is [-90..90] for latitude and [-180..180] for longitude. +select 'incorrectly decoded values:'; +select + geohashDecode(encoded) as actual, + 'expected:', encoded, '=>', latitude, longitude, + 'length:', length(encoded), + 'max lat error:', 180 / power(2, 2.5 * length(encoded)) as latitude_max_error, + 'max lon error:', 360 / power(2, 2.5 * length(encoded)) as longitude_max_error, + 'err:', (actual.2 - latitude) as lat_error, (actual.1 - longitude) as lon_error, + 'derr:', abs(lat_error) - latitude_max_error, abs(lon_error) - longitude_max_error +from geohash_test_data +where + abs(lat_error) > latitude_max_error + or + abs(lon_error) > longitude_max_error; + +drop table if exists geohash_test_data; diff --git a/docs/en/query_language/functions/geo.md b/docs/en/query_language/functions/geo.md index 2c9a3aac38f..97c4d1b5b4f 100644 --- a/docs/en/query_language/functions/geo.md +++ b/docs/en/query_language/functions/geo.md @@ -98,5 +98,57 @@ SELECT pointInPolygon((3., 3.), [(6, 0), (8, 4), (5, 8), (0, 2)]) AS res └─────┘ ``` +## geohashEncode + +Encodes latitude and longitude as a geohash-string, please see (http://geohash.org/, https://en.wikipedia.org/wiki/Geohash). +``` +geohashEncode(longitude, latitude, [precision]) +``` + +**Input values** + +- longitude - longitude part of the coordinate you want to encode. Floating in range`[-180°, 180°]` +- latitude - latitude part of the coordinate you want to encode. Floating in range `[-90°, 90°]` +- precision - Optional, length of the resulting encoded string, defaults to `12`. Integer in range `[1, 12]`. Any value less than `1` or greater than `12` is silently converted to `12`. + +**Returned values** + +- alphanumeric `String` of encoded coordinate (modified version of the base32-encoding alphabet is used). + +**Example** + +``` sql +SELECT geohashEncode(-5.60302734375, 42.593994140625, 0) AS res +``` + +``` +┌─res──────────┐ +│ ezs42d000000 │ +└──────────────┘ +``` + +## geohashDecode + +Decodes any geohash-encoded string into longitude and latitude. + +**Input values** + +- encoded string - geohash-encoded string. + +**Returned values** + +- (longitude, latitude) - 2-tuple of `Float64` values of longitude and latitude. + +**Example** + +``` sql +SELECT geohashDecode('ezs42') AS res +``` + +``` +┌─res─────────────────────────────┐ +│ (-5.60302734375,42.60498046875) │ +└─────────────────────────────────┘ +``` [Original article](https://clickhouse.yandex/docs/en/query_language/functions/geo/) From ab6558b8b4f9c92710d8fb4ad600e64e7890816e Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Fri, 10 May 2019 17:29:13 +0300 Subject: [PATCH 124/194] add spaces amp --- dbms/src/Storages/MergeTree/MergeTreeData.cpp | 4 ++-- dbms/src/Storages/MergeTree/MergeTreeData.h | 2 +- dbms/src/Storages/StorageMergeTree.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.cpp b/dbms/src/Storages/MergeTree/MergeTreeData.cpp index 503d1708300..ea51159d9ba 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeData.cpp @@ -1439,10 +1439,10 @@ void MergeTreeData::alterDataPart( const NamesAndTypesList & new_columns, const IndicesASTs & new_indices, bool skip_sanity_checks, - AlterDataPartTransactionPtr& transaction) + AlterDataPartTransactionPtr & transaction) { ExpressionActionsPtr expression; - const auto& part = transaction->getDataPart(); + const auto & part = transaction->getDataPart(); bool force_update_metadata; createConvertExpression(part, part->columns, new_columns, getIndices().indices, new_indices, diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.h b/dbms/src/Storages/MergeTree/MergeTreeData.h index 98ce5b4c371..fecddb28540 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.h +++ b/dbms/src/Storages/MergeTree/MergeTreeData.h @@ -228,7 +228,7 @@ public: const DataPart::Checksums & getNewChecksums() const { return new_checksums; } AlterDataPartTransaction(DataPartPtr data_part_) : data_part(data_part_), alter_lock(data_part->alter_mutex) {} - const DataPartPtr& getDataPart() const { return data_part; } + const DataPartPtr & getDataPart() const { return data_part; } bool isValid() const; private: diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index d80a05a8bab..fe66a11e6d6 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -203,7 +203,7 @@ std::vector StorageMergeTree::prepar std::vector transactions; transactions.reserve(parts.size()); - const auto& columns_for_parts = new_columns.getAllPhysical(); + const auto & columns_for_parts = new_columns.getAllPhysical(); const Settings & settings = context.getSettingsRef(); size_t thread_pool_size = std::min(parts.size(), settings.max_alter_threads); @@ -215,7 +215,7 @@ std::vector StorageMergeTree::prepar transactions.push_back(std::make_unique(part)); thread_pool.schedule( - [this, &transaction = transactions.back(), &columns_for_parts, &new_indices = new_indices.indices] + [this, & transaction = transactions.back(), & columns_for_parts, & new_indices = new_indices.indices] { this->alterDataPart(columns_for_parts, new_indices, false, transaction); } From ebdd5af7abb9be9a9fc40788bda47e59cebf2fcf Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Sat, 11 May 2019 00:13:50 +0300 Subject: [PATCH 125/194] add test --- ...4_alter_modify_column_partitions.reference | 206 ++++++++++++++++++ .../00754_alter_modify_column_partitions.sql | 24 ++ 2 files changed, 230 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.reference create mode 100644 dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql diff --git a/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.reference b/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.reference new file mode 100644 index 00000000000..0aedcdf32c5 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.reference @@ -0,0 +1,206 @@ +*** Check SHOW CREATE TABLE *** +CREATE TABLE test.alter_column (`x` UInt32, `y` Int32) ENGINE = MergeTree PARTITION BY x ORDER BY x SETTINGS index_granularity = 8192 +*** Check parts *** +0 0 +10 -10 +11 -11 +12 -12 +13 -13 +14 -14 +15 -15 +16 -16 +17 -17 +18 -18 +19 -19 +1 -1 +20 -20 +21 -21 +22 -22 +23 -23 +24 -24 +25 -25 +26 -26 +27 -27 +28 -28 +29 -29 +2 -2 +30 -30 +31 -31 +32 -32 +33 -33 +34 -34 +35 -35 +36 -36 +37 -37 +38 -38 +39 -39 +3 -3 +40 -40 +41 -41 +42 -42 +43 -43 +44 -44 +45 -45 +46 -46 +47 -47 +48 -48 +49 -49 +4 -4 +50 -50 +51 -51 +52 -52 +53 -53 +54 -54 +55 -55 +56 -56 +57 -57 +58 -58 +59 -59 +5 -5 +60 -60 +61 -61 +62 -62 +63 -63 +64 -64 +65 -65 +66 -66 +67 -67 +68 -68 +69 -69 +6 -6 +70 -70 +71 -71 +72 -72 +73 -73 +74 -74 +75 -75 +76 -76 +77 -77 +78 -78 +79 -79 +7 -7 +80 -80 +81 -81 +82 -82 +83 -83 +84 -84 +85 -85 +86 -86 +87 -87 +88 -88 +89 -89 +8 -8 +90 -90 +91 -91 +92 -92 +93 -93 +94 -94 +95 -95 +96 -96 +97 -97 +98 -98 +99 -99 +9 -9 +*** Check SHOW CREATE TABLE after ALTER MODIFY *** +CREATE TABLE test.alter_column (`x` UInt32, `y` Int64) ENGINE = MergeTree PARTITION BY x ORDER BY x SETTINGS index_granularity = 8192 +*** Check parts after ALTER MODIFY *** +0 0 +10 -10 +11 -11 +12 -12 +13 -13 +14 -14 +15 -15 +16 -16 +17 -17 +18 -18 +19 -19 +1 -1 +20 -20 +21 -21 +22 -22 +23 -23 +24 -24 +25 -25 +26 -26 +27 -27 +28 -28 +29 -29 +2 -2 +30 -30 +31 -31 +32 -32 +33 -33 +34 -34 +35 -35 +36 -36 +37 -37 +38 -38 +39 -39 +3 -3 +40 -40 +41 -41 +42 -42 +43 -43 +44 -44 +45 -45 +46 -46 +47 -47 +48 -48 +49 -49 +4 -4 +50 -50 +51 -51 +52 -52 +53 -53 +54 -54 +55 -55 +56 -56 +57 -57 +58 -58 +59 -59 +5 -5 +60 -60 +61 -61 +62 -62 +63 -63 +64 -64 +65 -65 +66 -66 +67 -67 +68 -68 +69 -69 +6 -6 +70 -70 +71 -71 +72 -72 +73 -73 +74 -74 +75 -75 +76 -76 +77 -77 +78 -78 +79 -79 +7 -7 +80 -80 +81 -81 +82 -82 +83 -83 +84 -84 +85 -85 +86 -86 +87 -87 +88 -88 +89 -89 +8 -8 +90 -90 +91 -91 +92 -92 +93 -93 +94 -94 +95 -95 +96 -96 +97 -97 +98 -98 +99 -99 +9 -9 diff --git a/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql b/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql new file mode 100644 index 00000000000..71c482c8d53 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql @@ -0,0 +1,24 @@ +-- check ALTER MODIFY COLUMN with partitions + +SET send_logs_level = 'none'; + +DROP TABLE IF EXISTS test.alter_column; + +CREATE TABLE test.alter_column(x UInt32, y Int32) ENGINE MergeTree PARTITION BY x ORDER BY x; +INSERT INTO test.alter_column (x, y) SELECT number AS x, -number AS y FROM system.numbers LIMIT 100; + +SELECT '*** Check SHOW CREATE TABLE ***'; +SHOW CREATE TABLE test.alter_column; + +SELECT '*** Check parts ***'; +SELECT * FROM test.alter_column ORDER BY _part; + +ALTER TABLE test.alter_column MODIFY COLUMN y Int64; + +SELECT '*** Check SHOW CREATE TABLE after ALTER MODIFY ***'; +SHOW CREATE TABLE test.alter_column; + +SELECT '*** Check parts after ALTER MODIFY ***'; +SELECT * FROM test.alter_column ORDER BY _part; + +DROP TABLE test.alter_column; From 5f6ab5eb10cbea5dfbecd83b00953ede9fd782af Mon Sep 17 00:00:00 2001 From: ivan-kush Date: Sat, 11 May 2019 21:28:06 +0300 Subject: [PATCH 126/194] tsan? --- ...4_alter_modify_column_partitions.reference | 100 ------------------ .../00754_alter_modify_column_partitions.sql | 2 +- 2 files changed, 1 insertion(+), 101 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.reference b/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.reference index 0aedcdf32c5..058704085bb 100644 --- a/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.reference +++ b/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.reference @@ -46,60 +46,10 @@ CREATE TABLE test.alter_column (`x` UInt32, `y` Int32) ENGINE = MergeTree PARTIT 48 -48 49 -49 4 -4 -50 -50 -51 -51 -52 -52 -53 -53 -54 -54 -55 -55 -56 -56 -57 -57 -58 -58 -59 -59 5 -5 -60 -60 -61 -61 -62 -62 -63 -63 -64 -64 -65 -65 -66 -66 -67 -67 -68 -68 -69 -69 6 -6 -70 -70 -71 -71 -72 -72 -73 -73 -74 -74 -75 -75 -76 -76 -77 -77 -78 -78 -79 -79 7 -7 -80 -80 -81 -81 -82 -82 -83 -83 -84 -84 -85 -85 -86 -86 -87 -87 -88 -88 -89 -89 8 -8 -90 -90 -91 -91 -92 -92 -93 -93 -94 -94 -95 -95 -96 -96 -97 -97 -98 -98 -99 -99 9 -9 *** Check SHOW CREATE TABLE after ALTER MODIFY *** CREATE TABLE test.alter_column (`x` UInt32, `y` Int64) ENGINE = MergeTree PARTITION BY x ORDER BY x SETTINGS index_granularity = 8192 @@ -149,58 +99,8 @@ CREATE TABLE test.alter_column (`x` UInt32, `y` Int64) ENGINE = MergeTree PARTIT 48 -48 49 -49 4 -4 -50 -50 -51 -51 -52 -52 -53 -53 -54 -54 -55 -55 -56 -56 -57 -57 -58 -58 -59 -59 5 -5 -60 -60 -61 -61 -62 -62 -63 -63 -64 -64 -65 -65 -66 -66 -67 -67 -68 -68 -69 -69 6 -6 -70 -70 -71 -71 -72 -72 -73 -73 -74 -74 -75 -75 -76 -76 -77 -77 -78 -78 -79 -79 7 -7 -80 -80 -81 -81 -82 -82 -83 -83 -84 -84 -85 -85 -86 -86 -87 -87 -88 -88 -89 -89 8 -8 -90 -90 -91 -91 -92 -92 -93 -93 -94 -94 -95 -95 -96 -96 -97 -97 -98 -98 -99 -99 9 -9 diff --git a/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql b/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql index 71c482c8d53..0e4e0a14237 100644 --- a/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql +++ b/dbms/tests/queries/0_stateless/00754_alter_modify_column_partitions.sql @@ -5,7 +5,7 @@ SET send_logs_level = 'none'; DROP TABLE IF EXISTS test.alter_column; CREATE TABLE test.alter_column(x UInt32, y Int32) ENGINE MergeTree PARTITION BY x ORDER BY x; -INSERT INTO test.alter_column (x, y) SELECT number AS x, -number AS y FROM system.numbers LIMIT 100; +INSERT INTO test.alter_column (x, y) SELECT number AS x, -number AS y FROM system.numbers LIMIT 50; SELECT '*** Check SHOW CREATE TABLE ***'; SHOW CREATE TABLE test.alter_column; From 2206ba464fd0402ba905d9e59f827513030b96d1 Mon Sep 17 00:00:00 2001 From: zhang2014 Date: Mon, 13 May 2019 15:54:38 +0800 Subject: [PATCH 127/194] fix data race in rename query --- dbms/src/Storages/StorageMergeTree.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 4075e1dc527..e0cdf0ae311 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -698,10 +698,10 @@ BackgroundProcessingPoolTaskResult StorageMergeTree::backgroundTask() /// Clear old parts. It is unnecessary to do it more than once a second. if (auto lock = time_after_previous_cleanup.compareAndRestartDeferred(1)) { - clearOldPartsFromFilesystem(); { /// TODO: Implement tryLockStructureForShare. auto lock_structure = lockStructureForShare(false, ""); + clearOldPartsFromFilesystem(); clearOldTemporaryDirectories(); } clearOldMutations(); From b96ec83c2ae11621802b582d9f90638036ddda36 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 13 May 2019 11:51:24 +0300 Subject: [PATCH 128/194] Remove past Meetup link --- website/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.html b/website/index.html index d0a95c73120..6bb7594c163 100644 --- a/website/index.html +++ b/website/index.html @@ -94,7 +94,7 @@
- Upcoming ClickHouse Meetups: Limassol on May 7 and Beijing on June 8 + Upcoming ClickHouse Meetup: Beijing on June 8
From a8e8a37c044841c5ce446b1c6f686d54a9851bff Mon Sep 17 00:00:00 2001 From: alesapin Date: Mon, 13 May 2019 13:06:51 +0300 Subject: [PATCH 129/194] Update pvs-studio version to beta --- docker/test/pvs/Dockerfile | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docker/test/pvs/Dockerfile b/docker/test/pvs/Dockerfile index 5467b6e79a0..1b7e63f7d65 100644 --- a/docker/test/pvs/Dockerfile +++ b/docker/test/pvs/Dockerfile @@ -7,15 +7,21 @@ RUN apt-get --allow-unauthenticated update -y \ sudo \ wget \ software-properties-common \ - gpg-agent + gpg-agent \ + strace -RUN wget -q -O - http://files.viva64.com/etc/pubkey.txt | sudo apt-key add - -RUN sudo wget -O /etc/apt/sources.list.d/viva64.list http://files.viva64.com/etc/viva64.list +#RUN wget -q -O - http://files.viva64.com/etc/pubkey.txt | sudo apt-key add - +#RUN sudo wget -O /etc/apt/sources.list.d/viva64.list http://files.viva64.com/etc/viva64.list +# +#RUN apt-get --allow-unauthenticated update -y \ +# && env DEBIAN_FRONTEND=noninteractive \ +# apt-get --allow-unauthenticated install --yes --no-install-recommends \ +# pvs-studio -RUN apt-get --allow-unauthenticated update -y \ - && env DEBIAN_FRONTEND=noninteractive \ - apt-get --allow-unauthenticated install --yes --no-install-recommends \ - pvs-studio +ENV PKG_VERSION="pvs-studio-7.02.32142.1233-amd64.deb" + +RUN wget -q http://files.viva64.com/beta/$PKG_VERSION +RUN sudo dpkg -i $PKG_VERSION CMD cd /repo_folder && pvs-studio-analyzer credentials $LICENCE_NAME $LICENCE_KEY -o ./licence.lic \ && cmake . && ninja re2_st && \ From 67cf1bc48c5a4ac147a6abd2159d0e4f8ed6d814 Mon Sep 17 00:00:00 2001 From: Ivan Lezhankin Date: Mon, 13 May 2019 13:41:03 +0300 Subject: [PATCH 130/194] Link rdkafka with bundled SASL also enable SASL SCRAM support in the code. --- contrib/librdkafka-cmake/CMakeLists.txt | 3 ++- contrib/librdkafka-cmake/config.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/librdkafka-cmake/CMakeLists.txt b/contrib/librdkafka-cmake/CMakeLists.txt index 6dc86bf3219..2807f42df93 100644 --- a/contrib/librdkafka-cmake/CMakeLists.txt +++ b/contrib/librdkafka-cmake/CMakeLists.txt @@ -33,6 +33,7 @@ set(SRCS ${RDKAFKA_SOURCE_DIR}/rdkafka_roundrobin_assignor.c ${RDKAFKA_SOURCE_DIR}/rdkafka_sasl.c ${RDKAFKA_SOURCE_DIR}/rdkafka_sasl_plain.c + ${RDKAFKA_SOURCE_DIR}/rdkafka_sasl_scram.c ${RDKAFKA_SOURCE_DIR}/rdkafka_subscription.c ${RDKAFKA_SOURCE_DIR}/rdkafka_timer.c ${RDKAFKA_SOURCE_DIR}/rdkafka_topic.c @@ -58,7 +59,7 @@ add_library(rdkafka ${SRCS}) target_include_directories(rdkafka SYSTEM PUBLIC include) target_include_directories(rdkafka SYSTEM PUBLIC ${RDKAFKA_SOURCE_DIR}) # Because weird logic with "include_next" is used. target_include_directories(rdkafka SYSTEM PRIVATE ${ZSTD_INCLUDE_DIR}/common) # Because wrong path to "zstd_errors.h" is used. -target_link_libraries(rdkafka PUBLIC ${ZLIB_LIBRARIES} ${ZSTD_LIBRARY} ${LZ4_LIBRARY}) +target_link_libraries(rdkafka PUBLIC ${ZLIB_LIBRARIES} ${ZSTD_LIBRARY} ${LZ4_LIBRARY} libgsasl) if(OPENSSL_SSL_LIBRARY AND OPENSSL_CRYPTO_LIBRARY) target_link_libraries(rdkafka PUBLIC ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) endif() diff --git a/contrib/librdkafka-cmake/config.h b/contrib/librdkafka-cmake/config.h index ae4e370a628..403a79ea42e 100644 --- a/contrib/librdkafka-cmake/config.h +++ b/contrib/librdkafka-cmake/config.h @@ -12,7 +12,7 @@ #define ENABLE_SHAREDPTR_DEBUG 0 #define ENABLE_LZ4_EXT 1 #define ENABLE_SSL 1 -//#define ENABLE_SASL 1 +#define ENABLE_SASL 1 #define MKL_APP_NAME "librdkafka" #define MKL_APP_DESC_ONELINE "The Apache Kafka C/C++ library" // distro @@ -62,7 +62,7 @@ // libssl #define WITH_SSL 1 // WITH_SASL_SCRAM -//#define WITH_SASL_SCRAM 1 +#define WITH_SASL_SCRAM 1 // crc32chw #if !defined(__PPC__) #define WITH_CRC32C_HW 1 From 06dd372a089a3547c9b62789aea2609fc1a3a600 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 13 May 2019 13:54:39 +0300 Subject: [PATCH 131/194] Add San Francisco meetup link --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7d2b4b052ff..8e7653d60cb 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ ClickHouse is an open-source column-oriented database management system that all ## Upcoming Events * ClickHouse at [Percona Live 2019](https://www.percona.com/live/19/other-open-source-databases-track) in Austin on May 28-30. +* [ClickHouse Community Meetup in San Francisco](https://www.meetup.com/San-Francisco-Bay-Area-ClickHouse-Meetup/events/261110652/) on June 4. * [ClickHouse Community Meetup in Beijing](https://www.huodongxing.com/event/2483759276200) on June 8. * [ClickHouse Community Meetup in Shenzhen](https://www.huodongxing.com/event/3483759917300) on October 20. * [ClickHouse Community Meetup in Shanghai](https://www.huodongxing.com/event/4483760336000) on October 27. From 9aa4e8d168f9f9ea46efd9fc51d44b5181eba320 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 13 May 2019 13:56:33 +0300 Subject: [PATCH 132/194] Add San Francisco meetup link --- website/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/index.html b/website/index.html index 6bb7594c163..1b2ed897c03 100644 --- a/website/index.html +++ b/website/index.html @@ -94,7 +94,7 @@
- Upcoming ClickHouse Meetup: Beijing on June 8 + Upcoming ClickHouse Meetups: San Francisco on June 4 and Beijing on June 8
From bf05218c9ca7eda8927c73cf9d1e5e2c65238a4e Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Mon, 13 May 2019 14:02:17 +0300 Subject: [PATCH 133/194] Update quick start on website front page ...as skipping parts that were marked as optional indeed fails the rest of it. --- website/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/index.html b/website/index.html index 1b2ed897c03..ec604187bd5 100644 --- a/website/index.html +++ b/website/index.html @@ -403,8 +403,8 @@
-sudo apt-get install dirmngr    # optional
-sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4    # optional
+sudo apt-get install dirmngr
+sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
 
 echo "deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" | sudo tee /etc/apt/sources.list.d/clickhouse.list
 sudo apt-get update

From 79010b7c3c219ca7505cf1ff0a6f44bf24b56778 Mon Sep 17 00:00:00 2001
From: Alexander Kozhikhov 
Date: Mon, 13 May 2019 16:49:53 +0300
Subject: [PATCH 134/194] some review fixes

---
 dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h | 4 ++++
 dbms/src/Columns/ColumnAggregateFunction.cpp            | 6 +++---
 dbms/src/Columns/ColumnAggregateFunction.h              | 2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
index 7fe1d9b8cab..3dc41bca5df 100644
--- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
+++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
@@ -80,6 +80,10 @@ public:
                  const ColumnNumbers &arguments,
                  const std::vector &weights, Float64 bias, const Context & context) const override
     {
+        if (weights.size() + 1 != arguments.size()) {
+            throw Exception("In predict function number of arguments differs from the size of weights vector", ErrorCodes::LOGICAL_ERROR);
+        }
+
         size_t rows_num = block.rows();
         std::vector results(rows_num, bias);
 
diff --git a/dbms/src/Columns/ColumnAggregateFunction.cpp b/dbms/src/Columns/ColumnAggregateFunction.cpp
index 451b4377130..a3edcb3b0f6 100644
--- a/dbms/src/Columns/ColumnAggregateFunction.cpp
+++ b/dbms/src/Columns/ColumnAggregateFunction.cpp
@@ -37,7 +37,7 @@ void ColumnAggregateFunction::addArena(ArenaPtr arena_)
 
 /// This function is used in convertToValues() and predictValues()
 /// and is written here to avoid repetitions
-bool ColumnAggregateFunction::convertion(MutableColumnPtr *res_) const
+bool ColumnAggregateFunction::tryFinalizeAggregateFunction(MutableColumnPtr *res_) const
 {
     if (const AggregateFunctionState *function_state = typeid_cast(func.get()))
     {
@@ -92,7 +92,7 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const
         */
 
     MutableColumnPtr res;
-    if (convertion(&res))
+    if (tryFinalizeAggregateFunction(&res))
     {
         return res;
     }
@@ -106,7 +106,7 @@ MutableColumnPtr ColumnAggregateFunction::convertToValues() const
 MutableColumnPtr ColumnAggregateFunction::predictValues(Block & block, const ColumnNumbers & arguments, const Context & context) const
 {
     MutableColumnPtr res;
-    convertion(&res);
+    tryFinalizeAggregateFunction(&res);
 
     auto ML_function = func.get();
     if (ML_function)
diff --git a/dbms/src/Columns/ColumnAggregateFunction.h b/dbms/src/Columns/ColumnAggregateFunction.h
index 7ad526bb495..de2bb587fcf 100644
--- a/dbms/src/Columns/ColumnAggregateFunction.h
+++ b/dbms/src/Columns/ColumnAggregateFunction.h
@@ -118,7 +118,7 @@ public:
     std::string getName() const override { return "AggregateFunction(" + func->getName() + ")"; }
     const char * getFamilyName() const override { return "AggregateFunction"; }
 
-    bool convertion(MutableColumnPtr* res_) const;
+    bool tryFinalizeAggregateFunction(MutableColumnPtr* res_) const;
     MutableColumnPtr predictValues(Block & block, const ColumnNumbers & arguments, const Context & context) const;
 
     size_t size() const override

From 5aec6dd011672723ae09a7fa092a5fc21266beb6 Mon Sep 17 00:00:00 2001
From: alesapin 
Date: Mon, 13 May 2019 17:09:11 +0300
Subject: [PATCH 135/194] Fix banch of flapping perf tests. Improve average
 speed calculation

---
 dbms/programs/performance-test/TestStats.cpp       | 6 +++---
 dbms/programs/performance-test/TestStats.h         | 4 ++--
 dbms/tests/performance/array_element.xml           | 4 ++--
 dbms/tests/performance/array_join.xml              | 4 ++--
 dbms/tests/performance/complex_array_creation.xml  | 4 ++--
 dbms/tests/performance/conditional.xml             | 4 ++--
 dbms/tests/performance/consistent_hashes.xml       | 2 +-
 dbms/tests/performance/date_time.xml               | 4 ++--
 dbms/tests/performance/format_date_time.xml        | 4 ++--
 dbms/tests/performance/functions_coding.xml        | 4 ++--
 dbms/tests/performance/if_array_num.xml            | 4 ++--
 dbms/tests/performance/if_array_string.xml         | 4 ++--
 dbms/tests/performance/if_string_const.xml         | 4 ++--
 dbms/tests/performance/simple_join_query.xml       | 2 +-
 dbms/tests/performance/system_numbers.xml          | 4 ++--
 dbms/tests/performance/uniq.xml                    | 2 +-
 dbms/tests/performance/visit_param_extract_raw.xml | 4 ++--
 17 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/dbms/programs/performance-test/TestStats.cpp b/dbms/programs/performance-test/TestStats.cpp
index 100c7a84391..4a3ec281d90 100644
--- a/dbms/programs/performance-test/TestStats.cpp
+++ b/dbms/programs/performance-test/TestStats.cpp
@@ -1,4 +1,5 @@
 #include "TestStats.h"
+#include 
 namespace DB
 {
 
@@ -92,11 +93,10 @@ void TestStats::update_average_speed(
     avg_speed_value /= number_of_info_batches;
 
     if (avg_speed_first == 0)
-    {
         avg_speed_first = avg_speed_value;
-    }
 
-    if (std::abs(avg_speed_value - avg_speed_first) >= precision)
+    auto [min, max] = std::minmax(avg_speed_value, avg_speed_first);
+    if (1 - min / max >= precision)
     {
         avg_speed_first = avg_speed_value;
         avg_speed_watch.restart();
diff --git a/dbms/programs/performance-test/TestStats.h b/dbms/programs/performance-test/TestStats.h
index 84880b7b189..5d70edc437c 100644
--- a/dbms/programs/performance-test/TestStats.h
+++ b/dbms/programs/performance-test/TestStats.h
@@ -40,11 +40,11 @@ struct TestStats
 
     double avg_rows_speed_value = 0;
     double avg_rows_speed_first = 0;
-    static inline double avg_rows_speed_precision = 0.001;
+    static inline double avg_rows_speed_precision = 0.005;
 
     double avg_bytes_speed_value = 0;
     double avg_bytes_speed_first = 0;
-    static inline double avg_bytes_speed_precision = 0.001;
+    static inline double avg_bytes_speed_precision = 0.005;
 
     size_t number_of_rows_speed_info_batches = 0;
     size_t number_of_bytes_speed_info_batches = 0;
diff --git a/dbms/tests/performance/array_element.xml b/dbms/tests/performance/array_element.xml
index e16ca5ff938..3cd3451e14e 100644
--- a/dbms/tests/performance/array_element.xml
+++ b/dbms/tests/performance/array_element.xml
@@ -4,8 +4,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/array_join.xml b/dbms/tests/performance/array_join.xml
index c59e7f5da20..fb3fa234c84 100644
--- a/dbms/tests/performance/array_join.xml
+++ b/dbms/tests/performance/array_join.xml
@@ -4,8 +4,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/complex_array_creation.xml b/dbms/tests/performance/complex_array_creation.xml
index d4435efd665..dbf674c1c45 100644
--- a/dbms/tests/performance/complex_array_creation.xml
+++ b/dbms/tests/performance/complex_array_creation.xml
@@ -4,8 +4,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/conditional.xml b/dbms/tests/performance/conditional.xml
index 72ae891945c..abe4014b9e6 100644
--- a/dbms/tests/performance/conditional.xml
+++ b/dbms/tests/performance/conditional.xml
@@ -5,8 +5,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/consistent_hashes.xml b/dbms/tests/performance/consistent_hashes.xml
index 33930add3b7..216a166ba34 100644
--- a/dbms/tests/performance/consistent_hashes.xml
+++ b/dbms/tests/performance/consistent_hashes.xml
@@ -4,7 +4,7 @@
 
     
         
-            1000
+            1000
             5000
         
     
diff --git a/dbms/tests/performance/date_time.xml b/dbms/tests/performance/date_time.xml
index a31217792dc..6688c9215c6 100644
--- a/dbms/tests/performance/date_time.xml
+++ b/dbms/tests/performance/date_time.xml
@@ -9,8 +9,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/format_date_time.xml b/dbms/tests/performance/format_date_time.xml
index d99dafa4be2..b634cdc902a 100644
--- a/dbms/tests/performance/format_date_time.xml
+++ b/dbms/tests/performance/format_date_time.xml
@@ -8,8 +8,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/functions_coding.xml b/dbms/tests/performance/functions_coding.xml
index 80d2b9e8f97..2c19336caa2 100644
--- a/dbms/tests/performance/functions_coding.xml
+++ b/dbms/tests/performance/functions_coding.xml
@@ -4,8 +4,8 @@
 
     
         
-            10000
-            1000
+            5000
+            20000
         
     
 
diff --git a/dbms/tests/performance/if_array_num.xml b/dbms/tests/performance/if_array_num.xml
index 1c9fc1d3453..a7a261f8511 100644
--- a/dbms/tests/performance/if_array_num.xml
+++ b/dbms/tests/performance/if_array_num.xml
@@ -4,8 +4,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/if_array_string.xml b/dbms/tests/performance/if_array_string.xml
index 4b8d839f6fe..c84409fcd86 100644
--- a/dbms/tests/performance/if_array_string.xml
+++ b/dbms/tests/performance/if_array_string.xml
@@ -4,8 +4,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/if_string_const.xml b/dbms/tests/performance/if_string_const.xml
index aba635c8e83..9056db9a58e 100644
--- a/dbms/tests/performance/if_string_const.xml
+++ b/dbms/tests/performance/if_string_const.xml
@@ -4,8 +4,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/simple_join_query.xml b/dbms/tests/performance/simple_join_query.xml
index 3830690fea3..aef37bb0320 100644
--- a/dbms/tests/performance/simple_join_query.xml
+++ b/dbms/tests/performance/simple_join_query.xml
@@ -8,7 +8,7 @@
             30000
         
         
-            5000
+            5000
             60000
         
     
diff --git a/dbms/tests/performance/system_numbers.xml b/dbms/tests/performance/system_numbers.xml
index 74206390ed8..b4a065a565b 100644
--- a/dbms/tests/performance/system_numbers.xml
+++ b/dbms/tests/performance/system_numbers.xml
@@ -5,8 +5,8 @@
     
         
             
-            10000
-            1000
+            1000
+            10000
         
     
 
diff --git a/dbms/tests/performance/uniq.xml b/dbms/tests/performance/uniq.xml
index 9cb031b42b8..250826f914f 100644
--- a/dbms/tests/performance/uniq.xml
+++ b/dbms/tests/performance/uniq.xml
@@ -13,7 +13,7 @@
         
         
             5000
-            15000
+            20000
         
     
 
diff --git a/dbms/tests/performance/visit_param_extract_raw.xml b/dbms/tests/performance/visit_param_extract_raw.xml
index acd0bfe41a6..6372f82387e 100644
--- a/dbms/tests/performance/visit_param_extract_raw.xml
+++ b/dbms/tests/performance/visit_param_extract_raw.xml
@@ -4,8 +4,8 @@
 
     
         
-            10000
-            1000
+            1000
+            10000
         
     
 

From 003a0fbadfa93100e99255d0c2293559925db902 Mon Sep 17 00:00:00 2001
From: Alexander Kozhikhov 
Date: Mon, 13 May 2019 17:43:47 +0300
Subject: [PATCH 136/194] conflict fix

---
 dbms/src/Functions/registerFunctionsMiscellaneous.cpp          | 3 ---
 .../{00935_ml_test.reference => 00944_ml_test.reference}       | 0
 .../0_stateless/{00935_ml_test.sql => 00944_ml_test.sql}       | 0
 .../{00936_ml_test.reference => 00945_ml_test.reference}       | 0
 .../0_stateless/{00936_ml_test.sql => 00945_ml_test.sql}       | 0
 .../{00937_ml_test.reference => 00946_ml_test.reference}       | 0
 .../0_stateless/{00937_ml_test.sql => 00946_ml_test.sql}       | 0
 .../{00939_ml_test.reference => 00947_ml_test.reference}       | 0
 .../0_stateless/{00939_ml_test.sql => 00947_ml_test.sql}       | 0
 9 files changed, 3 deletions(-)
 rename dbms/tests/queries/0_stateless/{00935_ml_test.reference => 00944_ml_test.reference} (100%)
 rename dbms/tests/queries/0_stateless/{00935_ml_test.sql => 00944_ml_test.sql} (100%)
 rename dbms/tests/queries/0_stateless/{00936_ml_test.reference => 00945_ml_test.reference} (100%)
 rename dbms/tests/queries/0_stateless/{00936_ml_test.sql => 00945_ml_test.sql} (100%)
 rename dbms/tests/queries/0_stateless/{00937_ml_test.reference => 00946_ml_test.reference} (100%)
 rename dbms/tests/queries/0_stateless/{00937_ml_test.sql => 00946_ml_test.sql} (100%)
 rename dbms/tests/queries/0_stateless/{00939_ml_test.reference => 00947_ml_test.reference} (100%)
 rename dbms/tests/queries/0_stateless/{00939_ml_test.sql => 00947_ml_test.sql} (100%)

diff --git a/dbms/src/Functions/registerFunctionsMiscellaneous.cpp b/dbms/src/Functions/registerFunctionsMiscellaneous.cpp
index ccd0a013c73..03df3a887ca 100644
--- a/dbms/src/Functions/registerFunctionsMiscellaneous.cpp
+++ b/dbms/src/Functions/registerFunctionsMiscellaneous.cpp
@@ -88,11 +88,8 @@ void registerFunctionsMiscellaneous(FunctionFactory & factory)
     registerFunctionsIn(factory);
     registerFunctionJoinGet(factory);
     registerFunctionFilesystem(factory);
-<<<<<<< HEAD
     registerFunctionEvalMLMethod(factory);
-=======
     registerFunctionBasename(factory);
->>>>>>> 9498ba96793679c51a118807a992c722686a2af2
 }
 
 }
diff --git a/dbms/tests/queries/0_stateless/00935_ml_test.reference b/dbms/tests/queries/0_stateless/00944_ml_test.reference
similarity index 100%
rename from dbms/tests/queries/0_stateless/00935_ml_test.reference
rename to dbms/tests/queries/0_stateless/00944_ml_test.reference
diff --git a/dbms/tests/queries/0_stateless/00935_ml_test.sql b/dbms/tests/queries/0_stateless/00944_ml_test.sql
similarity index 100%
rename from dbms/tests/queries/0_stateless/00935_ml_test.sql
rename to dbms/tests/queries/0_stateless/00944_ml_test.sql
diff --git a/dbms/tests/queries/0_stateless/00936_ml_test.reference b/dbms/tests/queries/0_stateless/00945_ml_test.reference
similarity index 100%
rename from dbms/tests/queries/0_stateless/00936_ml_test.reference
rename to dbms/tests/queries/0_stateless/00945_ml_test.reference
diff --git a/dbms/tests/queries/0_stateless/00936_ml_test.sql b/dbms/tests/queries/0_stateless/00945_ml_test.sql
similarity index 100%
rename from dbms/tests/queries/0_stateless/00936_ml_test.sql
rename to dbms/tests/queries/0_stateless/00945_ml_test.sql
diff --git a/dbms/tests/queries/0_stateless/00937_ml_test.reference b/dbms/tests/queries/0_stateless/00946_ml_test.reference
similarity index 100%
rename from dbms/tests/queries/0_stateless/00937_ml_test.reference
rename to dbms/tests/queries/0_stateless/00946_ml_test.reference
diff --git a/dbms/tests/queries/0_stateless/00937_ml_test.sql b/dbms/tests/queries/0_stateless/00946_ml_test.sql
similarity index 100%
rename from dbms/tests/queries/0_stateless/00937_ml_test.sql
rename to dbms/tests/queries/0_stateless/00946_ml_test.sql
diff --git a/dbms/tests/queries/0_stateless/00939_ml_test.reference b/dbms/tests/queries/0_stateless/00947_ml_test.reference
similarity index 100%
rename from dbms/tests/queries/0_stateless/00939_ml_test.reference
rename to dbms/tests/queries/0_stateless/00947_ml_test.reference
diff --git a/dbms/tests/queries/0_stateless/00939_ml_test.sql b/dbms/tests/queries/0_stateless/00947_ml_test.sql
similarity index 100%
rename from dbms/tests/queries/0_stateless/00939_ml_test.sql
rename to dbms/tests/queries/0_stateless/00947_ml_test.sql

From 332a8a97ab77c008b9c6528e57e5f2aca16fe6cf Mon Sep 17 00:00:00 2001
From: Alexander Kozhikhov 
Date: Mon, 13 May 2019 20:08:58 +0300
Subject: [PATCH 137/194] style

---
 dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
index 3dc41bca5df..9ae9b504270 100644
--- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
+++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
@@ -80,7 +80,8 @@ public:
                  const ColumnNumbers &arguments,
                  const std::vector &weights, Float64 bias, const Context & context) const override
     {
-        if (weights.size() + 1 != arguments.size()) {
+        if (weights.size() + 1 != arguments.size())
+        {
             throw Exception("In predict function number of arguments differs from the size of weights vector", ErrorCodes::LOGICAL_ERROR);
         }
 

From 20e7de7ccea00ca9c601571783ed1218389b0ff6 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Mon, 13 May 2019 21:58:15 +0300
Subject: [PATCH 138/194] fix perf regression: do not add right join key to
 result if possible

---
 dbms/src/Interpreters/AnalyzedJoin.cpp       | 14 ++++++
 dbms/src/Interpreters/AnalyzedJoin.h         |  2 +
 dbms/src/Interpreters/ColumnNamesContext.cpp | 16 +++---
 dbms/src/Interpreters/ColumnNamesContext.h   | 16 +++++-
 dbms/src/Interpreters/ExpressionAnalyzer.cpp |  8 +--
 dbms/tests/performance/joins_in_memory.xml   | 52 ++++++++++++++++++++
 6 files changed, 97 insertions(+), 11 deletions(-)
 create mode 100644 dbms/tests/performance/joins_in_memory.xml

diff --git a/dbms/src/Interpreters/AnalyzedJoin.cpp b/dbms/src/Interpreters/AnalyzedJoin.cpp
index 333e82690dc..9fbe709ac94 100644
--- a/dbms/src/Interpreters/AnalyzedJoin.cpp
+++ b/dbms/src/Interpreters/AnalyzedJoin.cpp
@@ -25,6 +25,7 @@ void AnalyzedJoin::addUsingKey(const ASTPtr & ast)
 
 void AnalyzedJoin::addOnKeys(ASTPtr & left_table_ast, ASTPtr & right_table_ast)
 {
+    with_using = false;
     key_names_left.push_back(left_table_ast->getColumnName());
     key_names_right.push_back(right_table_ast->getAliasOrColumnName());
 
@@ -32,6 +33,19 @@ void AnalyzedJoin::addOnKeys(ASTPtr & left_table_ast, ASTPtr & right_table_ast)
     key_asts_right.push_back(right_table_ast);
 }
 
+/// @return how many times right key appears in ON section.
+size_t AnalyzedJoin::rightKeyInclusion(const String & name) const
+{
+    if (with_using)
+        return 0;
+
+    size_t count = 0;
+    for (const auto & key_name : key_names_right)
+        if (name == key_name)
+            ++count;
+    return count;
+}
+
 ExpressionActionsPtr AnalyzedJoin::createJoinedBlockActions(
     const JoinedColumnsList & columns_added_by_join,
     const ASTSelectQuery * select_query_with_join,
diff --git a/dbms/src/Interpreters/AnalyzedJoin.h b/dbms/src/Interpreters/AnalyzedJoin.h
index 18329e85fae..cae5500cf4a 100644
--- a/dbms/src/Interpreters/AnalyzedJoin.h
+++ b/dbms/src/Interpreters/AnalyzedJoin.h
@@ -55,6 +55,7 @@ struct AnalyzedJoin
     Names key_names_right; /// Duplicating names are qualified.
     ASTs key_asts_left;
     ASTs key_asts_right;
+    bool with_using = true;
 
     /// All columns which can be read from joined table. Duplicating names are qualified.
     JoinedColumnsList columns_from_joined_table;
@@ -74,6 +75,7 @@ struct AnalyzedJoin
 
     void calculateColumnsFromJoinedTable(const NamesAndTypesList & columns, const Names & original_names);
     void calculateAvailableJoinedColumns(bool make_nullable);
+    size_t rightKeyInclusion(const String & name) const;
 };
 
 struct ASTTableExpression;
diff --git a/dbms/src/Interpreters/ColumnNamesContext.cpp b/dbms/src/Interpreters/ColumnNamesContext.cpp
index abeb7c74a36..4d23c6f0e8b 100644
--- a/dbms/src/Interpreters/ColumnNamesContext.cpp
+++ b/dbms/src/Interpreters/ColumnNamesContext.cpp
@@ -35,11 +35,7 @@ void ColumnNamesContext::addColumnIdentifier(const ASTIdentifier & node)
 
     /// There should be no complex cases after query normalization. Names to aliases: one-to-many.
     String alias = node.tryGetAlias();
-    if (!alias.empty())
-        required_names[node.name].insert(alias);
-
-    if (!required_names.count(node.name))
-        required_names[node.name] = {};
+    required_names[node.name].addInclusion(alias);
 }
 
 bool ColumnNamesContext::addArrayJoinAliasIfAny(const IAST & ast)
@@ -57,6 +53,14 @@ void ColumnNamesContext::addArrayJoinIdentifier(const ASTIdentifier & node)
     array_join_columns.insert(node.name);
 }
 
+size_t ColumnNamesContext::nameInclusion(const String & name) const
+{
+    auto it = required_names.find(name);
+    if (it != required_names.end())
+        return it->second.appears;
+    return 0;
+}
+
 NameSet ColumnNamesContext::requiredColumns() const
 {
     NameSet required;
@@ -81,7 +85,7 @@ std::ostream & operator << (std::ostream & os, const ColumnNamesContext & cols)
     for (const auto & pr : cols.required_names)
     {
         os << "'" << pr.first << "'";
-        for (auto & alias : pr.second)
+        for (auto & alias : pr.second.aliases)
             os << "/'" << alias << "'";
     }
     os << " source_tables: ";
diff --git a/dbms/src/Interpreters/ColumnNamesContext.h b/dbms/src/Interpreters/ColumnNamesContext.h
index 90bc0643561..72f5f8f8684 100644
--- a/dbms/src/Interpreters/ColumnNamesContext.h
+++ b/dbms/src/Interpreters/ColumnNamesContext.h
@@ -51,7 +51,20 @@ struct ColumnNamesContext
         }
     };
 
-    std::unordered_map> required_names; /// names with aliases
+    struct NameInfo
+    {
+        std::set aliases;
+        size_t appears = 0;
+
+        void addInclusion(const String & alias)
+        {
+            if (!alias.empty())
+                aliases.insert(alias);
+            ++appears;
+        }
+    };
+
+    std::unordered_map required_names;
     NameSet table_aliases;
     NameSet private_aliases;
     NameSet complex_aliases;
@@ -68,6 +81,7 @@ struct ColumnNamesContext
     void addArrayJoinIdentifier(const ASTIdentifier & node);
 
     NameSet requiredColumns() const;
+    size_t nameInclusion(const String & name) const;
 };
 
 std::ostream & operator << (std::ostream & os, const ColumnNamesContext & cols);
diff --git a/dbms/src/Interpreters/ExpressionAnalyzer.cpp b/dbms/src/Interpreters/ExpressionAnalyzer.cpp
index 5607733d553..d980cc8c369 100644
--- a/dbms/src/Interpreters/ExpressionAnalyzer.cpp
+++ b/dbms/src/Interpreters/ExpressionAnalyzer.cpp
@@ -988,9 +988,7 @@ void ExpressionAnalyzer::collectUsedColumns()
         for (const auto & name : source_columns)
             avaliable_columns.insert(name.name);
 
-        /** You also need to ignore the identifiers of the columns that are obtained by JOIN.
-        * (Do not assume that they are required for reading from the "left" table).
-        */
+        /// Add columns obtained by JOIN (if needed).
         columns_added_by_join.clear();
         for (const auto & joined_column : analyzed_join.available_joined_columns)
         {
@@ -1000,7 +998,9 @@ void ExpressionAnalyzer::collectUsedColumns()
 
             if (required.count(name))
             {
-                columns_added_by_join.push_back(joined_column);
+                /// Optimisation: do not add columns needed only in JOIN ON section.
+                if (columns_context.nameInclusion(name) > analyzed_join.rightKeyInclusion(name))
+                    columns_added_by_join.push_back(joined_column);
                 required.erase(name);
             }
         }
diff --git a/dbms/tests/performance/joins_in_memory.xml b/dbms/tests/performance/joins_in_memory.xml
new file mode 100644
index 00000000000..3949ec70a4f
--- /dev/null
+++ b/dbms/tests/performance/joins_in_memory.xml
@@ -0,0 +1,52 @@
+
+    Joins In Memory
+    loop
+
+    
+        
+            10
+        
+    
+
+    
+        
+    
+
+    CREATE TABLE ints (i64 Int64, i32 Int32, i16 Int16, i8 Int8) ENGINE = Memory
+
+    INSERT INTO ints SELECT number AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
+    INSERT INTO ints SELECT 10000 + number % 1000 AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
+    INSERT INTO ints SELECT 20000 + number % 100  AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
+    INSERT INTO ints SELECT 30000 + number % 10   AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
+    INSERT INTO ints SELECT 40000 + number % 1    AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
+
+    SELECT COUNT() FROM ints l ANY LEFT JOIN ints r USING i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l ANY LEFT JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l ANY LEFT JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l ANY LEFT JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
+
+    SELECT COUNT() FROM ints l INNER JOIN ints r USING i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l INNER JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l INNER JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l INNER JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
+
+     SELECT COUNT() FROM ints l LEFT  JOIN ints r USING i64 WHERE i32 = 200042
+     SELECT COUNT() FROM ints l LEFT  JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
+     SELECT COUNT() FROM ints l LEFT  JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
+     SELECT COUNT() FROM ints l LEFT  JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
+
+    SELECT COUNT() FROM ints l RIGHT JOIN ints r USING i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l RIGHT JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l RIGHT JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l RIGHT JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
+
+     SELECT COUNT() FROM ints l FULL  JOIN ints r USING i64 WHERE i32 = 200042
+     SELECT COUNT() FROM ints l FULL  JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
+     SELECT COUNT() FROM ints l FULL  JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
+     SELECT COUNT() FROM ints l FULL  JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
+
+     SELECT COUNT() FROM ints l CROSS JOIN (SELECT number as i64 FROM numbers(4)) WHERE i32 = 42
+     SELECT COUNT() FROM ints l CROSS JOIN (SELECT number as i64 FROM numbers(4)) WHERE i32 = 42
+
+    DROP TABLE IF EXISTS ints
+

From ba202c2b06d35d4a1154fca4bcbdaa27e5aa4b00 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Tue, 14 May 2019 12:47:21 +0300
Subject: [PATCH 139/194] fix whitespaces

---
 dbms/tests/performance/joins_in_memory.xml | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/dbms/tests/performance/joins_in_memory.xml b/dbms/tests/performance/joins_in_memory.xml
index 3949ec70a4f..0d831db0e25 100644
--- a/dbms/tests/performance/joins_in_memory.xml
+++ b/dbms/tests/performance/joins_in_memory.xml
@@ -16,9 +16,9 @@
 
     INSERT INTO ints SELECT number AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
     INSERT INTO ints SELECT 10000 + number % 1000 AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
-    INSERT INTO ints SELECT 20000 + number % 100  AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
-    INSERT INTO ints SELECT 30000 + number % 10   AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
-    INSERT INTO ints SELECT 40000 + number % 1    AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
+    INSERT INTO ints SELECT 20000 + number % 100 AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
+    INSERT INTO ints SELECT 30000 + number % 10 AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
+    INSERT INTO ints SELECT 40000 + number % 1 AS i64, i64 AS i32, i64 AS i16, i64 AS i8 FROM numbers(10000)
 
     SELECT COUNT() FROM ints l ANY LEFT JOIN ints r USING i64 WHERE i32 = 200042
     SELECT COUNT() FROM ints l ANY LEFT JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
@@ -30,23 +30,23 @@
     SELECT COUNT() FROM ints l INNER JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
     SELECT COUNT() FROM ints l INNER JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
 
-     SELECT COUNT() FROM ints l LEFT  JOIN ints r USING i64 WHERE i32 = 200042
-     SELECT COUNT() FROM ints l LEFT  JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
-     SELECT COUNT() FROM ints l LEFT  JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
-     SELECT COUNT() FROM ints l LEFT  JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
+    SELECT COUNT() FROM ints l LEFT JOIN ints r USING i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l LEFT JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l LEFT JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l LEFT JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
 
     SELECT COUNT() FROM ints l RIGHT JOIN ints r USING i64 WHERE i32 = 200042
     SELECT COUNT() FROM ints l RIGHT JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
     SELECT COUNT() FROM ints l RIGHT JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
     SELECT COUNT() FROM ints l RIGHT JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
 
-     SELECT COUNT() FROM ints l FULL  JOIN ints r USING i64 WHERE i32 = 200042
-     SELECT COUNT() FROM ints l FULL  JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
-     SELECT COUNT() FROM ints l FULL  JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
-     SELECT COUNT() FROM ints l FULL  JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
+    SELECT COUNT() FROM ints l FULL JOIN ints r USING i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l FULL JOIN ints r USING i64,i32,i16,i8 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l FULL JOIN ints r ON l.i64 = r.i64 WHERE i32 = 200042
+    SELECT COUNT() FROM ints l FULL JOIN ints r USING i64 WHERE i32 IN(42, 100042, 200042, 300042, 400042)
 
-     SELECT COUNT() FROM ints l CROSS JOIN (SELECT number as i64 FROM numbers(4)) WHERE i32 = 42
-     SELECT COUNT() FROM ints l CROSS JOIN (SELECT number as i64 FROM numbers(4)) WHERE i32 = 42
+    SELECT COUNT() FROM ints l CROSS JOIN (SELECT number as i64 FROM numbers(4)) WHERE i32 = 42
+    SELECT COUNT() FROM ints l CROSS JOIN (SELECT number as i64 FROM numbers(4)) WHERE i32 = 42
 
     DROP TABLE IF EXISTS ints
 

From cc3de4115fb52ba181f19a262d750a7e8888f48b Mon Sep 17 00:00:00 2001
From: proller 
Date: Tue, 14 May 2019 12:58:33 +0300
Subject: [PATCH 140/194] Build fixes (#5261)

---
 dbms/programs/CMakeLists.txt                       | 3 +++
 dbms/src/Common/StringSearcher.h                   | 1 +
 dbms/src/Functions/Regexps.h                       | 1 +
 dbms/src/Storages/MergeTree/MergeTreeRangeReader.h | 1 +
 release                                            | 2 +-
 utils/check-style/check-include                    | 2 ++
 6 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/dbms/programs/CMakeLists.txt b/dbms/programs/CMakeLists.txt
index af65df6e8fe..6626d90e5f5 100644
--- a/dbms/programs/CMakeLists.txt
+++ b/dbms/programs/CMakeLists.txt
@@ -209,6 +209,9 @@ else ()
         install (FILES ${CMAKE_CURRENT_BINARY_DIR}/clickhouse-obfuscator DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
         list(APPEND CLICKHOUSE_BUNDLE clickhouse-obfuscator)
     endif ()
+    if(ENABLE_CLICKHOUSE_ODBC_BRIDGE)
+        list(APPEND CLICKHOUSE_BUNDLE clickhouse-odbc-bridge)
+    endif()
 
     # install always because depian package want this files:
     add_custom_target (clickhouse-clang ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-clang DEPENDS clickhouse)
diff --git a/dbms/src/Common/StringSearcher.h b/dbms/src/Common/StringSearcher.h
index 6d897e4326d..9e1f2413439 100644
--- a/dbms/src/Common/StringSearcher.h
+++ b/dbms/src/Common/StringSearcher.h
@@ -1,6 +1,7 @@
 #pragma once
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/dbms/src/Functions/Regexps.h b/dbms/src/Functions/Regexps.h
index 48d285e394a..164f8718cf0 100644
--- a/dbms/src/Functions/Regexps.h
+++ b/dbms/src/Functions/Regexps.h
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 
diff --git a/dbms/src/Storages/MergeTree/MergeTreeRangeReader.h b/dbms/src/Storages/MergeTree/MergeTreeRangeReader.h
index bd3ae49f529..c80fff31419 100644
--- a/dbms/src/Storages/MergeTree/MergeTreeRangeReader.h
+++ b/dbms/src/Storages/MergeTree/MergeTreeRangeReader.h
@@ -12,6 +12,7 @@ class ColumnVector;
 using ColumnUInt8 = ColumnVector;
 
 class MergeTreeReader;
+class MergeTreeIndexGranularity;
 
 /// MergeTreeReader iterator which allows sequential reading for arbitrary number of rows between pairs of marks in the same part.
 /// Stores reading state, which can be inside granule. Can skip rows in current granule and start reading from next mark.
diff --git a/release b/release
index 509e28d9323..8be67e99640 100755
--- a/release
+++ b/release
@@ -111,7 +111,7 @@ if [ -z "$USE_PBUILDER" ] ; then
     DEB_CC=${DEB_CC:=`which gcc-7 gcc-8 gcc | head -n1`}
     DEB_CXX=${DEB_CXX:=`which g++-7 g++-8 g++ | head -n1`}
     # Build (only binary packages).
-    debuild -e PATH -e SSH_AUTH_SOCK \
+    debuild --preserve-env -e PATH \
     -e DEB_CC=$DEB_CC -e DEB_CXX=$DEB_CXX -e CMAKE_FLAGS="$CMAKE_FLAGS" \
     -b ${DEBUILD_NOSIGN_OPTIONS} ${DEBUILD_NODEPS_OPTIONS}
 else
diff --git a/utils/check-style/check-include b/utils/check-style/check-include
index 28aacf95670..1b1bf3d56e0 100755
--- a/utils/check-style/check-include
+++ b/utils/check-style/check-include
@@ -58,6 +58,8 @@ inc="-I. \
 -I./contrib/cppkafka/include \
 -I./contrib/librdkafka-cmake/include \
 -I./contrib/lz4/lib \
+-I./contrib/hyperscan/src \
+-I./contrib/simdjson/include \
 -I./dbms/src \
 -I${BUILD_DIR}/dbms/src"
 

From 6200d20dc2b5e8fcdf5f83bbaf60d0ed92c44f57 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Tue, 14 May 2019 17:39:03 +0300
Subject: [PATCH 141/194] RowRefList refactoring

---
 dbms/src/Interpreters/Join.cpp    | 16 +++++-----------
 dbms/src/Interpreters/RowRefs.h   | 32 ++++++++++++++++++++++++++++++-
 dbms/src/Storages/StorageJoin.cpp |  5 ++---
 3 files changed, 38 insertions(+), 15 deletions(-)

diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp
index 0a56a208bf0..230ff8e55dd 100644
--- a/dbms/src/Interpreters/Join.cpp
+++ b/dbms/src/Interpreters/Join.cpp
@@ -401,13 +401,7 @@ namespace
                  * We will insert each time the element into the second place.
                  * That is, the former second element, if it was, will be the third, and so on.
                  */
-                auto elem = pool.alloc();
-                auto & mapped = emplace_result.getMapped();
-
-                elem->next = mapped.next;
-                mapped.next = elem;
-                elem->block = stored_block;
-                elem->row_num = i;
+                emplace_result.getMapped().insert({stored_block, i}, pool);
             }
         }
     };
@@ -659,9 +653,9 @@ void addFoundRow(const typename Map::mapped_type & mapped, AddedColumns & added,
 
     if constexpr (STRICTNESS == ASTTableJoin::Strictness::All)
     {
-        for (auto current = &static_cast(mapped); current != nullptr; current = current->next)
+        for (auto it = mapped.begin(); it.ok(); ++it)
         {
-            added.appendFromBlock(*current->block, current->row_num);
+            added.appendFromBlock(*it->block, it->row_num);
             ++current_offset;
         }
     }
@@ -1153,10 +1147,10 @@ struct AdderNonJoined
 {
     static void add(const Mapped & mapped, size_t & rows_added, MutableColumns & columns_right)
     {
-        for (auto current = &static_cast(mapped); current != nullptr; current = current->next)
+        for (auto it = mapped.begin(); it.ok(); ++it)
         {
             for (size_t j = 0; j < columns_right.size(); ++j)
-                columns_right[j]->insertFrom(*current->block->getByPosition(j).column.get(), current->row_num);
+                columns_right[j]->insertFrom(*it->block->getByPosition(j).column.get(), it->row_num);
 
             ++rows_added;
         }
diff --git a/dbms/src/Interpreters/RowRefs.h b/dbms/src/Interpreters/RowRefs.h
index 76efb33543d..7c79a11ffa7 100644
--- a/dbms/src/Interpreters/RowRefs.h
+++ b/dbms/src/Interpreters/RowRefs.h
@@ -1,5 +1,6 @@
 #pragma once
 
+#include 
 #include 
 #include 
 
@@ -27,10 +28,39 @@ struct RowRef
 /// Single linked list of references to rows. Used for ALL JOINs (non-unique JOINs)
 struct RowRefList : RowRef
 {
-    RowRefList * next = nullptr;
+    class ForwardIterator
+    {
+    public:
+        ForwardIterator(const RowRefList * begin)
+            : current(begin)
+        {}
+
+        const RowRef * operator -> () const { return current; }
+        void operator ++ () { current = current->next; }
+        bool ok() const { return current; }
+
+    private:
+        const RowRefList * current;
+    };
 
     RowRefList() {}
     RowRefList(const Block * block_, size_t row_num_) : RowRef(block_, row_num_) {}
+
+    ForwardIterator begin() const { return ForwardIterator(this); }
+
+    /// insert element after current one
+    void insert(RowRef && row_ref, Arena & pool)
+    {
+        auto elem = pool.alloc();
+        elem->block = row_ref.block;
+        elem->row_num = row_ref.row_num;
+
+        elem->next = next;
+        next = elem;
+    }
+
+private:
+    RowRefList * next = nullptr;
 };
 
 /**
diff --git a/dbms/src/Storages/StorageJoin.cpp b/dbms/src/Storages/StorageJoin.cpp
index e7debe45107..1c9cca0dc21 100644
--- a/dbms/src/Storages/StorageJoin.cpp
+++ b/dbms/src/Storages/StorageJoin.cpp
@@ -338,14 +338,13 @@ private:
                 throw Exception("ASOF join storage is not implemented yet", ErrorCodes::NOT_IMPLEMENTED);
             }
             else
-                for (auto current = &static_cast(it->getSecond()); current != nullptr;
-                     current = current->next)
+                for (auto ref_it = it->getSecond().begin(); ref_it.ok(); ++ref_it)
                 {
                     for (size_t j = 0; j < columns.size(); ++j)
                         if (j == key_pos)
                             columns[j]->insertData(rawData(it->getFirst()), rawSize(it->getFirst()));
                         else
-                            columns[j]->insertFrom(*current->block->getByPosition(column_indices[j]).column.get(), current->row_num);
+                            columns[j]->insertFrom(*ref_it->block->getByPosition(column_indices[j]).column.get(), ref_it->row_num);
                     ++rows_added;
                 }
 

From b1667911766b9c24a0231c8a3f68cad869f60d03 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Tue, 14 May 2019 17:40:43 +0300
Subject: [PATCH 142/194] batched version of RowRefList

---
 dbms/src/Interpreters/Join.cpp  |  5 +-
 dbms/src/Interpreters/RowRefs.h | 84 ++++++++++++++++++++++++++++-----
 2 files changed, 73 insertions(+), 16 deletions(-)

diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp
index 230ff8e55dd..84bfcf475bc 100644
--- a/dbms/src/Interpreters/Join.cpp
+++ b/dbms/src/Interpreters/Join.cpp
@@ -397,10 +397,7 @@ namespace
                 new (&emplace_result.getMapped()) typename Map::mapped_type(stored_block, i);
             else
             {
-                /** The first element of the list is stored in the value of the hash table, the rest in the pool.
-                 * We will insert each time the element into the second place.
-                 * That is, the former second element, if it was, will be the third, and so on.
-                 */
+                /// The first element of the list is stored in the value of the hash table, the rest in the pool.
                 emplace_result.getMapped().insert({stored_block, i}, pool);
             }
         }
diff --git a/dbms/src/Interpreters/RowRefs.h b/dbms/src/Interpreters/RowRefs.h
index 7c79a11ffa7..ffcaf370b00 100644
--- a/dbms/src/Interpreters/RowRefs.h
+++ b/dbms/src/Interpreters/RowRefs.h
@@ -28,19 +28,79 @@ struct RowRef
 /// Single linked list of references to rows. Used for ALL JOINs (non-unique JOINs)
 struct RowRefList : RowRef
 {
+    /// Portion of RowRefs, 16 * (MAX_SIZE + 1) bytes sized.
+    struct Batch
+    {
+        static constexpr size_t MAX_SIZE = 7; /// Adequate values are 3, 7, 15, 31.
+
+        size_t size = 0;
+        Batch * next;
+        RowRef row_refs[MAX_SIZE];
+
+        Batch(Batch * parent)
+            : next(parent)
+        {}
+
+        bool full() const { return size == MAX_SIZE; }
+
+        Batch * insert(RowRef && row_ref, Arena & pool)
+        {
+            if (full())
+            {
+                auto batch = pool.alloc();
+                *batch = Batch(this);
+                batch->insert(std::move(row_ref), pool);
+                return batch;
+            }
+
+            row_refs[size++] = std::move(row_ref);
+            return this;
+        }
+    };
+
     class ForwardIterator
     {
     public:
         ForwardIterator(const RowRefList * begin)
-            : current(begin)
+            : root(begin)
+            , first(true)
+            , batch(root->next)
+            , position(0)
         {}
 
-        const RowRef * operator -> () const { return current; }
-        void operator ++ () { current = current->next; }
-        bool ok() const { return current; }
+        const RowRef * operator -> () const
+        {
+            if (first)
+                return root;
+            return &batch->row_refs[position];
+        }
+
+        void operator ++ ()
+        {
+            if (first)
+            {
+                first = false;
+                return;
+            }
+
+            if (batch)
+            {
+                ++position;
+                if (position >= batch->size)
+                {
+                    batch = batch->next;
+                    position = 0;
+                }
+            }
+        }
+
+        bool ok() const { return first || (batch && position < batch->size); }
 
     private:
-        const RowRefList * current;
+        const RowRefList * root;
+        bool first;
+        Batch * batch;
+        size_t position;
     };
 
     RowRefList() {}
@@ -51,16 +111,16 @@ struct RowRefList : RowRef
     /// insert element after current one
     void insert(RowRef && row_ref, Arena & pool)
     {
-        auto elem = pool.alloc();
-        elem->block = row_ref.block;
-        elem->row_num = row_ref.row_num;
-
-        elem->next = next;
-        next = elem;
+        if (!next)
+        {
+            next = pool.alloc();
+            *next = Batch(nullptr);
+        }
+        next = next->insert(std::move(row_ref), pool);
     }
 
 private:
-    RowRefList * next = nullptr;
+    Batch * next = nullptr;
 };
 
 /**

From 4674ac209158647f3bc0a9456ae9462e7206f2c5 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Tue, 14 May 2019 18:46:01 +0300
Subject: [PATCH 143/194] Fix postfix increment operator of Settings::iterator

---
 dbms/src/Core/SettingsCommon.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dbms/src/Core/SettingsCommon.h b/dbms/src/Core/SettingsCommon.h
index db4500bb72a..b30b5b50c68 100644
--- a/dbms/src/Core/SettingsCommon.h
+++ b/dbms/src/Core/SettingsCommon.h
@@ -428,7 +428,7 @@ public:
         const const_reference & operator *() const { return ref; }
         const const_reference * operator ->() const { return &ref; }
         const_iterator & operator ++() { ++ref.member; return *this; }
-        const_iterator & operator ++(int) { const_iterator tmp = *this; ++*this; return tmp; }
+        const_iterator operator ++(int) { const_iterator tmp = *this; ++*this; return tmp; }
         bool operator ==(const const_iterator & rhs) const { return ref.member == rhs.ref.member && ref.collection == rhs.ref.collection; }
         bool operator !=(const const_iterator & rhs) const { return !(*this == rhs); }
     protected:
@@ -445,7 +445,7 @@ public:
         reference & operator *() const { return this->ref; }
         reference * operator ->() const { return &this->ref; }
         iterator & operator ++() { const_iterator::operator ++(); return *this; }
-        iterator & operator ++(int) { iterator tmp = *this; ++*this; return tmp; }
+        iterator operator ++(int) { iterator tmp = *this; ++*this; return tmp; }
     };
 
     /// Returns the number of settings.

From 4a5832b18ad00af7bdb62bb0577d726887bf17e7 Mon Sep 17 00:00:00 2001
From: Ivan <5627721+abyss7@users.noreply.github.com>
Date: Tue, 14 May 2019 18:52:03 +0300
Subject: [PATCH 144/194] Check the time limit every (flush_interval /
 poll_timeout) number of rows from Kafka (#5249)

---
 dbms/src/Core/Settings.h                            |  1 +
 dbms/src/DataStreams/IBlockInputStream.h            |  8 ++++++--
 dbms/src/Formats/BinaryRowInputStream.cpp           |  8 +++++---
 .../Formats/BlockInputStreamFromRowInputStream.cpp  | 12 ++++++++++--
 .../Formats/BlockInputStreamFromRowInputStream.h    |  6 ++++--
 dbms/src/Formats/CSVRowInputStream.cpp              |  3 ++-
 dbms/src/Formats/CapnProtoRowInputStream.cpp        |  8 +++++++-
 dbms/src/Formats/FormatFactory.cpp                  |  4 ++--
 dbms/src/Formats/FormatFactory.h                    |  3 ++-
 dbms/src/Formats/JSONEachRowRowInputStream.cpp      |  3 ++-
 dbms/src/Formats/NativeFormat.cpp                   |  3 ++-
 dbms/src/Formats/ParquetBlockInputStream.cpp        |  3 ++-
 dbms/src/Formats/ProtobufRowInputStream.cpp         |  3 ++-
 dbms/src/Formats/TSKVRowInputStream.cpp             |  3 ++-
 dbms/src/Formats/TabSeparatedRowInputStream.cpp     |  9 ++++++---
 dbms/src/Formats/ValuesRowInputStream.cpp           |  3 ++-
 dbms/src/Formats/tests/block_row_transforms.cpp     |  2 +-
 dbms/src/Formats/tests/tab_separated_streams.cpp    |  2 +-
 dbms/src/IO/DelimitedReadBuffer.h                   |  2 +-
 dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp   |  9 ++++++++-
 .../Storages/Kafka/ReadBufferFromKafkaConsumer.cpp  |  7 +------
 .../Storages/Kafka/ReadBufferFromKafkaConsumer.h    | 13 ++++++++++---
 dbms/src/Storages/Kafka/StorageKafka.cpp            |  3 ++-
 utils/kafka/produce.py                              | 13 ++++++++++++-
 24 files changed, 93 insertions(+), 38 deletions(-)

diff --git a/dbms/src/Core/Settings.h b/dbms/src/Core/Settings.h
index 535bf11cdc4..effc6589a76 100644
--- a/dbms/src/Core/Settings.h
+++ b/dbms/src/Core/Settings.h
@@ -206,6 +206,7 @@ struct Settings : public SettingsCollection
     M(SettingUInt64, insert_distributed_timeout, 0, "Timeout for insert query into distributed. Setting is used only with insert_distributed_sync enabled. Zero value means no timeout.") \
     M(SettingInt64, distributed_ddl_task_timeout, 180, "Timeout for DDL query responses from all hosts in cluster. Negative value means infinite.") \
     M(SettingMilliseconds, stream_flush_interval_ms, 7500, "Timeout for flushing data from streaming storages.") \
+    M(SettingMilliseconds, stream_poll_timeout_ms, 500, "Timeout for polling data from streaming storages.") \
     M(SettingString, format_schema, "", "Schema identifier (used by schema-based formats)") \
     M(SettingBool, insert_allow_materialized_columns, 0, "If setting is enabled, Allow materialized columns in INSERT.") \
     M(SettingSeconds, http_connection_timeout, DEFAULT_HTTP_READ_BUFFER_CONNECTION_TIMEOUT, "HTTP connection timeout.") \
diff --git a/dbms/src/DataStreams/IBlockInputStream.h b/dbms/src/DataStreams/IBlockInputStream.h
index 958891cc5f3..cd5c48867c0 100644
--- a/dbms/src/DataStreams/IBlockInputStream.h
+++ b/dbms/src/DataStreams/IBlockInputStream.h
@@ -269,6 +269,11 @@ protected:
         children.push_back(child);
     }
 
+    /** Check limits.
+      * But only those that can be checked within each separate stream.
+      */
+    bool checkTimeLimit();
+
 private:
     bool enabled_extremes = false;
 
@@ -296,10 +301,9 @@ private:
 
     void updateExtremes(Block & block);
 
-    /** Check limits and quotas.
+    /** Check quotas.
       * But only those that can be checked within each separate stream.
       */
-    bool checkTimeLimit();
     void checkQuota(Block & block);
 
     size_t checkDepthImpl(size_t max_depth, size_t level) const;
diff --git a/dbms/src/Formats/BinaryRowInputStream.cpp b/dbms/src/Formats/BinaryRowInputStream.cpp
index 2225ab1b3b6..c710b17ee9e 100644
--- a/dbms/src/Formats/BinaryRowInputStream.cpp
+++ b/dbms/src/Formats/BinaryRowInputStream.cpp
@@ -64,23 +64,25 @@ void registerInputFormatRowBinary(FormatFactory & factory)
         const Block & sample,
         const Context &,
         UInt64 max_block_size,
+        UInt64 rows_portion_size,
         const FormatSettings & settings)
     {
         return std::make_shared(
             std::make_shared(buf, sample, false, false),
-            sample, max_block_size, settings);
+            sample, max_block_size, rows_portion_size, settings);
     });
 
     factory.registerInputFormat("RowBinaryWithNamesAndTypes", [](
         ReadBuffer & buf,
         const Block & sample,
         const Context &,
-        size_t max_block_size,
+        UInt64 max_block_size,
+        UInt64 rows_portion_size,
         const FormatSettings & settings)
     {
         return std::make_shared(
             std::make_shared(buf, sample, true, true),
-            sample, max_block_size, settings);
+            sample, max_block_size, rows_portion_size, settings);
     });
 }
 
diff --git a/dbms/src/Formats/BlockInputStreamFromRowInputStream.cpp b/dbms/src/Formats/BlockInputStreamFromRowInputStream.cpp
index fdc5e07b5ba..5507ad6b2f2 100644
--- a/dbms/src/Formats/BlockInputStreamFromRowInputStream.cpp
+++ b/dbms/src/Formats/BlockInputStreamFromRowInputStream.cpp
@@ -27,8 +27,9 @@ BlockInputStreamFromRowInputStream::BlockInputStreamFromRowInputStream(
     const RowInputStreamPtr & row_input_,
     const Block & sample_,
     UInt64 max_block_size_,
+    UInt64 rows_portion_size_,
     const FormatSettings & settings)
-    : row_input(row_input_), sample(sample_), max_block_size(max_block_size_),
+    : row_input(row_input_), sample(sample_), max_block_size(max_block_size_), rows_portion_size(rows_portion_size_),
     allow_errors_num(settings.input_allow_errors_num), allow_errors_ratio(settings.input_allow_errors_ratio)
 {
 }
@@ -57,8 +58,15 @@ Block BlockInputStreamFromRowInputStream::readImpl()
 
     try
     {
-        for (size_t rows = 0; rows < max_block_size; ++rows)
+        for (size_t rows = 0, batch = 0; rows < max_block_size; ++rows, ++batch)
         {
+            if (rows_portion_size && batch == rows_portion_size)
+            {
+                batch = 0;
+                if (!checkTimeLimit())
+                    break;
+            }
+
             try
             {
                 ++total_rows;
diff --git a/dbms/src/Formats/BlockInputStreamFromRowInputStream.h b/dbms/src/Formats/BlockInputStreamFromRowInputStream.h
index 701e674a0fc..2f91aa2ecb2 100644
--- a/dbms/src/Formats/BlockInputStreamFromRowInputStream.h
+++ b/dbms/src/Formats/BlockInputStreamFromRowInputStream.h
@@ -17,11 +17,13 @@ namespace DB
 class BlockInputStreamFromRowInputStream : public IBlockInputStream
 {
 public:
-    /** sample_ - block with zero rows, that structure describes how to interpret values */
+    /// |sample| is a block with zero rows, that structure describes how to interpret values
+    /// |rows_portion_size| is a number of rows to read before break and check limits
     BlockInputStreamFromRowInputStream(
         const RowInputStreamPtr & row_input_,
         const Block & sample_,
         UInt64 max_block_size_,
+        UInt64 rows_portion_size_,
         const FormatSettings & settings);
 
     void readPrefix() override { row_input->readPrefix(); }
@@ -42,6 +44,7 @@ private:
     RowInputStreamPtr row_input;
     Block sample;
     UInt64 max_block_size;
+    UInt64 rows_portion_size;
     BlockMissingValues block_missing_values;
 
     UInt64 allow_errors_num;
@@ -50,5 +53,4 @@ private:
     size_t total_rows = 0;
     size_t num_errors = 0;
 };
-
 }
diff --git a/dbms/src/Formats/CSVRowInputStream.cpp b/dbms/src/Formats/CSVRowInputStream.cpp
index 9b3fd6c2524..bb348faa96d 100644
--- a/dbms/src/Formats/CSVRowInputStream.cpp
+++ b/dbms/src/Formats/CSVRowInputStream.cpp
@@ -478,11 +478,12 @@ void registerInputFormatCSV(FormatFactory & factory)
             const Block & sample,
             const Context &,
             UInt64 max_block_size,
+            UInt64 rows_portion_size,
             const FormatSettings & settings)
         {
             return std::make_shared(
                 std::make_shared(buf, sample, with_names, settings),
-                sample, max_block_size, settings);
+                sample, max_block_size, rows_portion_size, settings);
         });
     }
 }
diff --git a/dbms/src/Formats/CapnProtoRowInputStream.cpp b/dbms/src/Formats/CapnProtoRowInputStream.cpp
index bec78e03802..414a25cf39c 100644
--- a/dbms/src/Formats/CapnProtoRowInputStream.cpp
+++ b/dbms/src/Formats/CapnProtoRowInputStream.cpp
@@ -302,12 +302,18 @@ void registerInputFormatCapnProto(FormatFactory & factory)
 {
     factory.registerInputFormat(
         "CapnProto",
-        [](ReadBuffer & buf, const Block & sample, const Context & context, UInt64 max_block_size, const FormatSettings & settings)
+        [](ReadBuffer & buf,
+           const Block & sample,
+           const Context & context,
+           UInt64 max_block_size,
+           UInt64 rows_portion_size,
+           const FormatSettings & settings)
         {
             return std::make_shared(
                 std::make_shared(buf, sample, FormatSchemaInfo(context, "CapnProto")),
                 sample,
                 max_block_size,
+                rows_portion_size,
                 settings);
         });
 }
diff --git a/dbms/src/Formats/FormatFactory.cpp b/dbms/src/Formats/FormatFactory.cpp
index faf3fd7157c..08f0355064b 100644
--- a/dbms/src/Formats/FormatFactory.cpp
+++ b/dbms/src/Formats/FormatFactory.cpp
@@ -27,7 +27,7 @@ const FormatFactory::Creators & FormatFactory::getCreators(const String & name)
 }
 
 
-BlockInputStreamPtr FormatFactory::getInput(const String & name, ReadBuffer & buf, const Block & sample, const Context & context, UInt64 max_block_size) const
+BlockInputStreamPtr FormatFactory::getInput(const String & name, ReadBuffer & buf, const Block & sample, const Context & context, UInt64 max_block_size, UInt64 rows_portion_size) const
 {
     const auto & input_getter = getCreators(name).first;
     if (!input_getter)
@@ -47,7 +47,7 @@ BlockInputStreamPtr FormatFactory::getInput(const String & name, ReadBuffer & bu
     format_settings.input_allow_errors_num = settings.input_format_allow_errors_num;
     format_settings.input_allow_errors_ratio = settings.input_format_allow_errors_ratio;
 
-    return input_getter(buf, sample, context, max_block_size, format_settings);
+    return input_getter(buf, sample, context, max_block_size, rows_portion_size, format_settings);
 }
 
 
diff --git a/dbms/src/Formats/FormatFactory.h b/dbms/src/Formats/FormatFactory.h
index fed069bbf8a..66ab1e6fa63 100644
--- a/dbms/src/Formats/FormatFactory.h
+++ b/dbms/src/Formats/FormatFactory.h
@@ -35,6 +35,7 @@ private:
         const Block & sample,
         const Context & context,
         UInt64 max_block_size,
+        UInt64 rows_portion_size,
         const FormatSettings & settings)>;
 
     using OutputCreator = std::function(
             std::make_shared(buf, sample, settings),
-            sample, max_block_size, settings);
+            sample, max_block_size, rows_portion_size, settings);
     });
 }
 
diff --git a/dbms/src/Formats/NativeFormat.cpp b/dbms/src/Formats/NativeFormat.cpp
index aeab1b5eab0..88e727fdd3f 100644
--- a/dbms/src/Formats/NativeFormat.cpp
+++ b/dbms/src/Formats/NativeFormat.cpp
@@ -12,7 +12,8 @@ void registerInputFormatNative(FormatFactory & factory)
         ReadBuffer & buf,
         const Block & sample,
         const Context &,
-        size_t,
+        UInt64 /* max_block_size */,
+        UInt64 /* min_read_rows */,
         const FormatSettings &)
     {
         return std::make_shared(buf, sample, 0);
diff --git a/dbms/src/Formats/ParquetBlockInputStream.cpp b/dbms/src/Formats/ParquetBlockInputStream.cpp
index 05976bffa54..a573969b65f 100644
--- a/dbms/src/Formats/ParquetBlockInputStream.cpp
+++ b/dbms/src/Formats/ParquetBlockInputStream.cpp
@@ -475,7 +475,8 @@ void registerInputFormatParquet(FormatFactory & factory)
         [](ReadBuffer & buf,
            const Block & sample,
            const Context & context,
-           size_t /*max_block_size */,
+           UInt64 /* max_block_size */,
+           UInt64 /* rows_portion_size */,
            const FormatSettings & /* settings */) { return std::make_shared(buf, sample, context); });
 }
 
diff --git a/dbms/src/Formats/ProtobufRowInputStream.cpp b/dbms/src/Formats/ProtobufRowInputStream.cpp
index 86f2b15fc1c..44d830f56ea 100644
--- a/dbms/src/Formats/ProtobufRowInputStream.cpp
+++ b/dbms/src/Formats/ProtobufRowInputStream.cpp
@@ -72,11 +72,12 @@ void registerInputFormatProtobuf(FormatFactory & factory)
         const Block & sample,
         const Context & context,
         UInt64 max_block_size,
+        UInt64 rows_portion_size,
         const FormatSettings & settings)
     {
         return std::make_shared(
             std::make_shared(buf, sample, FormatSchemaInfo(context, "Protobuf")),
-            sample, max_block_size, settings);
+            sample, max_block_size, rows_portion_size, settings);
     });
 }
 
diff --git a/dbms/src/Formats/TSKVRowInputStream.cpp b/dbms/src/Formats/TSKVRowInputStream.cpp
index cb49c6d0543..ac89d5ec1c5 100644
--- a/dbms/src/Formats/TSKVRowInputStream.cpp
+++ b/dbms/src/Formats/TSKVRowInputStream.cpp
@@ -198,11 +198,12 @@ void registerInputFormatTSKV(FormatFactory & factory)
         const Block & sample,
         const Context &,
         UInt64 max_block_size,
+        UInt64 rows_portion_size,
         const FormatSettings & settings)
     {
         return std::make_shared(
             std::make_shared(buf, sample, settings),
-            sample, max_block_size, settings);
+            sample, max_block_size, rows_portion_size, settings);
     });
 }
 
diff --git a/dbms/src/Formats/TabSeparatedRowInputStream.cpp b/dbms/src/Formats/TabSeparatedRowInputStream.cpp
index c922ab8453e..884bc49454f 100644
--- a/dbms/src/Formats/TabSeparatedRowInputStream.cpp
+++ b/dbms/src/Formats/TabSeparatedRowInputStream.cpp
@@ -456,11 +456,12 @@ void registerInputFormatTabSeparated(FormatFactory & factory)
             const Block & sample,
             const Context &,
             UInt64 max_block_size,
+            UInt64 rows_portion_size,
             const FormatSettings & settings)
         {
             return std::make_shared(
                 std::make_shared(buf, sample, false, false, settings),
-                sample, max_block_size, settings);
+                sample, max_block_size, rows_portion_size, settings);
         });
     }
 
@@ -471,11 +472,12 @@ void registerInputFormatTabSeparated(FormatFactory & factory)
             const Block & sample,
             const Context &,
             UInt64 max_block_size,
+            UInt64 rows_portion_size,
             const FormatSettings & settings)
         {
             return std::make_shared(
                 std::make_shared(buf, sample, true, false, settings),
-                sample, max_block_size, settings);
+                sample, max_block_size, rows_portion_size, settings);
         });
     }
 
@@ -486,11 +488,12 @@ void registerInputFormatTabSeparated(FormatFactory & factory)
             const Block & sample,
             const Context &,
             UInt64 max_block_size,
+            UInt64 rows_portion_size,
             const FormatSettings & settings)
         {
             return std::make_shared(
                 std::make_shared(buf, sample, true, true, settings),
-                sample, max_block_size, settings);
+                sample, max_block_size, rows_portion_size, settings);
         });
     }
 }
diff --git a/dbms/src/Formats/ValuesRowInputStream.cpp b/dbms/src/Formats/ValuesRowInputStream.cpp
index b32c8594429..b2d972d678b 100644
--- a/dbms/src/Formats/ValuesRowInputStream.cpp
+++ b/dbms/src/Formats/ValuesRowInputStream.cpp
@@ -155,11 +155,12 @@ void registerInputFormatValues(FormatFactory & factory)
         const Block & sample,
         const Context & context,
         UInt64 max_block_size,
+        UInt64 rows_portion_size,
         const FormatSettings & settings)
     {
         return std::make_shared(
             std::make_shared(buf, sample, context, settings),
-            sample, max_block_size, settings);
+            sample, max_block_size, rows_portion_size, settings);
     });
 }
 
diff --git a/dbms/src/Formats/tests/block_row_transforms.cpp b/dbms/src/Formats/tests/block_row_transforms.cpp
index 71569af514e..c880ff7fc39 100644
--- a/dbms/src/Formats/tests/block_row_transforms.cpp
+++ b/dbms/src/Formats/tests/block_row_transforms.cpp
@@ -45,7 +45,7 @@ try
     FormatSettings format_settings;
 
     RowInputStreamPtr row_input = std::make_shared(in_buf, sample, false, false, format_settings);
-    BlockInputStreamFromRowInputStream block_input(row_input, sample, DEFAULT_INSERT_BLOCK_SIZE, format_settings);
+    BlockInputStreamFromRowInputStream block_input(row_input, sample, DEFAULT_INSERT_BLOCK_SIZE, 0, format_settings);
     RowOutputStreamPtr row_output = std::make_shared(out_buf, sample, false, false, format_settings);
     BlockOutputStreamFromRowOutputStream block_output(row_output, sample);
 
diff --git a/dbms/src/Formats/tests/tab_separated_streams.cpp b/dbms/src/Formats/tests/tab_separated_streams.cpp
index 77fa40350d7..50b9350d4c5 100644
--- a/dbms/src/Formats/tests/tab_separated_streams.cpp
+++ b/dbms/src/Formats/tests/tab_separated_streams.cpp
@@ -42,7 +42,7 @@ try
     RowInputStreamPtr row_input = std::make_shared(in_buf, sample, false, false, format_settings);
     RowOutputStreamPtr row_output = std::make_shared(out_buf, sample, false, false, format_settings);
 
-    BlockInputStreamFromRowInputStream block_input(row_input, sample, DEFAULT_INSERT_BLOCK_SIZE, format_settings);
+    BlockInputStreamFromRowInputStream block_input(row_input, sample, DEFAULT_INSERT_BLOCK_SIZE, 0, format_settings);
     BlockOutputStreamFromRowOutputStream block_output(row_output, sample);
 
     copyData(block_input, block_output);
diff --git a/dbms/src/IO/DelimitedReadBuffer.h b/dbms/src/IO/DelimitedReadBuffer.h
index 332fb4b3f77..01f0ac8ffec 100644
--- a/dbms/src/IO/DelimitedReadBuffer.h
+++ b/dbms/src/IO/DelimitedReadBuffer.h
@@ -10,7 +10,7 @@ namespace DB
 class DelimitedReadBuffer : public ReadBuffer
 {
 public:
-    DelimitedReadBuffer(ReadBuffer * buffer_, char delimiter_) : ReadBuffer(nullptr, 0), buffer(buffer_), delimiter(delimiter_)
+    DelimitedReadBuffer(std::unique_ptr buffer_, char delimiter_) : ReadBuffer(nullptr, 0), buffer(std::move(buffer_)), delimiter(delimiter_)
     {
         // TODO: check that `buffer_` is not nullptr.
     }
diff --git a/dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp b/dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp
index 2cabb9c431f..56b1db85a3f 100644
--- a/dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp
+++ b/dbms/src/Storages/Kafka/KafkaBlockInputStream.cpp
@@ -39,7 +39,14 @@ void KafkaBlockInputStream::readPrefixImpl()
 
     buffer->subBufferAs()->subscribe(storage.topics);
 
-    addChild(FormatFactory::instance().getInput(storage.format_name, *buffer, storage.getSampleBlock(), context, max_block_size));
+    const auto & limits = getLimits();
+    const size_t poll_timeout = buffer->subBufferAs()->pollTimeout();
+    size_t rows_portion_size = poll_timeout ? std::min(max_block_size, limits.max_execution_time.totalMilliseconds() / poll_timeout) : max_block_size;
+    rows_portion_size = std::max(rows_portion_size, 1ul);
+
+    auto child = FormatFactory::instance().getInput(storage.format_name, *buffer, storage.getSampleBlock(), context, max_block_size, rows_portion_size);
+    child->setLimits(limits);
+    addChild(child);
 
     broken = true;
 }
diff --git a/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp b/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp
index fa5eb453e92..dda42c299d9 100644
--- a/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp
+++ b/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp
@@ -3,11 +3,6 @@
 namespace DB
 {
 
-namespace
-{
-    const auto READ_POLL_MS = 500; /// How long to wait for a batch of messages.
-}
-
 void ReadBufferFromKafkaConsumer::commit()
 {
     if (messages.empty() || current == messages.begin())
@@ -46,7 +41,7 @@ bool ReadBufferFromKafkaConsumer::nextImpl()
     if (current == messages.end())
     {
         commit();
-        messages = consumer->poll_batch(batch_size, std::chrono::milliseconds(READ_POLL_MS));
+        messages = consumer->poll_batch(batch_size, std::chrono::milliseconds(poll_timeout));
         current = messages.begin();
 
         LOG_TRACE(log, "Polled batch of " << messages.size() << " messages");
diff --git a/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h b/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h
index f7b49d955de..3b95685c583 100644
--- a/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h
+++ b/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h
@@ -12,12 +12,16 @@ namespace DB
 using BufferPtr = std::shared_ptr;
 using ConsumerPtr = std::shared_ptr;
 
-
 class ReadBufferFromKafkaConsumer : public ReadBuffer
 {
 public:
-    ReadBufferFromKafkaConsumer(ConsumerPtr consumer_, Poco::Logger * log_, size_t max_batch_size)
-        : ReadBuffer(nullptr, 0), consumer(consumer_), log(log_), batch_size(max_batch_size), current(messages.begin())
+    ReadBufferFromKafkaConsumer(ConsumerPtr consumer_, Poco::Logger * log_, size_t max_batch_size, size_t poll_timeout_)
+        : ReadBuffer(nullptr, 0)
+        , consumer(consumer_)
+        , log(log_)
+        , batch_size(max_batch_size)
+        , poll_timeout(poll_timeout_)
+        , current(messages.begin())
     {
     }
 
@@ -25,12 +29,15 @@ public:
     void subscribe(const Names & topics); // Subscribe internal consumer to topics.
     void unsubscribe(); // Unsubscribe internal consumer in case of failure.
 
+    auto pollTimeout() { return poll_timeout; }
+
 private:
     using Messages = std::vector;
 
     ConsumerPtr consumer;
     Poco::Logger * log;
     const size_t batch_size = 1;
+    const size_t poll_timeout = 0;
 
     Messages messages;
     Messages::const_iterator current;
diff --git a/dbms/src/Storages/Kafka/StorageKafka.cpp b/dbms/src/Storages/Kafka/StorageKafka.cpp
index 1e1ee6bb695..a28c835df7a 100644
--- a/dbms/src/Storages/Kafka/StorageKafka.cpp
+++ b/dbms/src/Storages/Kafka/StorageKafka.cpp
@@ -210,8 +210,9 @@ BufferPtr StorageKafka::createBuffer()
     size_t batch_size = max_block_size;
     if (!batch_size)
         batch_size = settings.max_block_size.value;
+    size_t poll_timeout = settings.stream_poll_timeout_ms.totalMilliseconds();
 
-    return std::make_shared(new ReadBufferFromKafkaConsumer(consumer, log, batch_size), row_delimiter);
+    return std::make_shared(std::make_unique(consumer, log, batch_size, poll_timeout), row_delimiter);
 }
 
 BufferPtr StorageKafka::claimBuffer()
diff --git a/utils/kafka/produce.py b/utils/kafka/produce.py
index f98b2cbbcdb..218471e4840 100755
--- a/utils/kafka/produce.py
+++ b/utils/kafka/produce.py
@@ -9,6 +9,7 @@ from concurrent.futures import ThreadPoolExecutor
 import enum
 import multiprocessing
 import sys
+import time
 
 
 class Sync(enum.Enum):
@@ -45,6 +46,12 @@ def main():
     parser.add_argument('--repeat', type=int, default=1,
         help='send same (multiplied) message many times')
 
+    mode_group = parser.add_mutually_exclusive_group()
+    mode_group.add_argument('--jobs', type=int, default=multiprocessing.cpu_count(),
+        help='number of concurrent jobs')
+    mode_group.add_argument('--delay', type=int, metavar='SECONDS', default=0,
+        help='delay before sending next message')
+
     args = parser.parse_args()
     config = {
         'bootstrap_servers': f'{args.server}:{args.port}',
@@ -56,10 +63,14 @@ def main():
     message = sys.stdin.buffer.read() * args.multiply
 
     def send(num):
+        if args.delay > 0:
+            time.sleep(args.delay)
         client.send(topic=args.topic, value=message)
         print(f'iteration {num}: sent a message multiplied {args.multiply} times')
 
-    pool = ThreadPoolExecutor(max_workers=multiprocessing.cpu_count())
+    if args.delay > 0:
+        args.jobs = 1
+    pool = ThreadPoolExecutor(max_workers=args.jobs)
     for num in range(args.repeat):
         pool.submit(send, num)
     pool.shutdown()

From 4a5e2dfd3cff126d09c654d6c731b97298ba9f34 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Tue, 14 May 2019 21:26:19 +0300
Subject: [PATCH 145/194] cache ExpressionBlockInputStream header

---
 dbms/src/DataStreams/ExpressionBlockInputStream.cpp | 10 +++++++---
 dbms/src/DataStreams/ExpressionBlockInputStream.h   |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/dbms/src/DataStreams/ExpressionBlockInputStream.cpp b/dbms/src/DataStreams/ExpressionBlockInputStream.cpp
index 1aed849a42a..456730dae4b 100644
--- a/dbms/src/DataStreams/ExpressionBlockInputStream.cpp
+++ b/dbms/src/DataStreams/ExpressionBlockInputStream.cpp
@@ -23,9 +23,13 @@ Block ExpressionBlockInputStream::getTotals()
 
 Block ExpressionBlockInputStream::getHeader() const
 {
-    Block res = children.back()->getHeader();
-    expression->execute(res, true);
-    return res;
+    if (!cached_header.columns())
+    {
+        cached_header = children.back()->getHeader();
+        expression->execute(cached_header, true);
+    }
+
+    return cached_header.cloneEmpty();
 }
 
 Block ExpressionBlockInputStream::readImpl()
diff --git a/dbms/src/DataStreams/ExpressionBlockInputStream.h b/dbms/src/DataStreams/ExpressionBlockInputStream.h
index 9a3452ce1f3..e09daa9057d 100644
--- a/dbms/src/DataStreams/ExpressionBlockInputStream.h
+++ b/dbms/src/DataStreams/ExpressionBlockInputStream.h
@@ -30,6 +30,7 @@ protected:
 
 private:
     ExpressionActionsPtr expression;
+    mutable Block cached_header;
 };
 
 }

From 7cb8d46338164abced8d0be43754f75665bacc8c Mon Sep 17 00:00:00 2001
From: proller 
Date: Tue, 14 May 2019 22:52:29 +0300
Subject: [PATCH 146/194] Fix build (move code from
 AggregateFunctionMLMethod.h) (#5266)

---
 .../AggregateFunctionMLMethod.cpp             | 513 ++++++++++++++---
 .../AggregateFunctionMLMethod.h               | 536 +++++-------------
 2 files changed, 587 insertions(+), 462 deletions(-)

diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp
index cbfd4c69723..11daf5ca819 100644
--- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp
+++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp
@@ -1,92 +1,110 @@
-#include 
-#include 
-#include 
-#include 
+#include "AggregateFunctionMLMethod.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "AggregateFunctionFactory.h"
+#include "FactoryHelpers.h"
+#include "Helpers.h"
 
 
 namespace DB
 {
-
 namespace
 {
-
-using FuncLinearRegression = AggregateFunctionMLMethod;
-using FuncLogisticRegression = AggregateFunctionMLMethod;
-template 
-AggregateFunctionPtr createAggregateFunctionMLMethod(
-        const std::string & name, const DataTypes & argument_types, const Array & parameters)
-{
-    if (parameters.size() > 4)
-        throw Exception("Aggregate function " + name + " requires at most four parameters: learning_rate, l2_regularization_coef, mini-batch size and weights_updater method", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
-
-    if (argument_types.size() < 2)
-        throw Exception("Aggregate function " + name + " requires at least two arguments: target and model's parameters", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
-
-    for (size_t i = 0; i < argument_types.size(); ++i)
+    using FuncLinearRegression = AggregateFunctionMLMethod;
+    using FuncLogisticRegression = AggregateFunctionMLMethod;
+    template 
+    AggregateFunctionPtr
+    createAggregateFunctionMLMethod(const std::string & name, const DataTypes & argument_types, const Array & parameters)
     {
-        if (!isNumber(argument_types[i]))
-            throw Exception("Argument " + std::to_string(i) + " of type " + argument_types[i]->getName() + " must be numeric for aggregate function " + name, ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
-    }
+        if (parameters.size() > 4)
+            throw Exception(
+                "Aggregate function " + name
+                    + " requires at most four parameters: learning_rate, l2_regularization_coef, mini-batch size and weights_updater "
+                      "method",
+                ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
 
-    /// Such default parameters were picked because they did good on some tests,
-    /// though it still requires to fit parameters to achieve better result
-    auto learning_rate = Float64(0.01);
-    auto l2_reg_coef = Float64(0.01);
-    UInt32 batch_size = 1;
+        if (argument_types.size() < 2)
+            throw Exception(
+                "Aggregate function " + name + " requires at least two arguments: target and model's parameters",
+                ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
 
-    std::shared_ptr weights_updater = std::make_shared();
-    std::shared_ptr gradient_computer;
-
-    if (!parameters.empty())
-    {
-        learning_rate = applyVisitor(FieldVisitorConvertToNumber(), parameters[0]);
-    }
-    if (parameters.size() > 1)
-    {
-        l2_reg_coef = applyVisitor(FieldVisitorConvertToNumber(), parameters[1]);
-    }
-    if (parameters.size() > 2)
-    {
-        batch_size = applyVisitor(FieldVisitorConvertToNumber(), parameters[2]);
-
-    }
-    if (parameters.size() > 3)
-    {
-        if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'SGD\'")
+        for (size_t i = 0; i < argument_types.size(); ++i)
         {
-            weights_updater = std::make_shared();
+            if (!isNumber(argument_types[i]))
+                throw Exception(
+                    "Argument " + std::to_string(i) + " of type " + argument_types[i]->getName()
+                        + " must be numeric for aggregate function " + name,
+                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
         }
-        else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Momentum\'")
+
+        /// Such default parameters were picked because they did good on some tests,
+        /// though it still requires to fit parameters to achieve better result
+        auto learning_rate = Float64(0.01);
+        auto l2_reg_coef = Float64(0.01);
+        UInt32 batch_size = 1;
+
+        std::shared_ptr weights_updater = std::make_shared();
+        std::shared_ptr gradient_computer;
+
+        if (!parameters.empty())
         {
-            weights_updater = std::make_shared();
+            learning_rate = applyVisitor(FieldVisitorConvertToNumber(), parameters[0]);
         }
-        else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Nesterov\'")
+        if (parameters.size() > 1)
         {
-            weights_updater = std::make_shared();
+            l2_reg_coef = applyVisitor(FieldVisitorConvertToNumber(), parameters[1]);
+        }
+        if (parameters.size() > 2)
+        {
+            batch_size = applyVisitor(FieldVisitorConvertToNumber(), parameters[2]);
+        }
+        if (parameters.size() > 3)
+        {
+            if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'SGD\'")
+            {
+                weights_updater = std::make_shared();
+            }
+            else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Momentum\'")
+            {
+                weights_updater = std::make_shared();
+            }
+            else if (applyVisitor(FieldVisitorToString(), parameters[3]) == "\'Nesterov\'")
+            {
+                weights_updater = std::make_shared();
+            }
+            else
+            {
+                throw Exception("Invalid parameter for weights updater", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
+            }
+        }
+
+        if (std::is_same::value)
+        {
+            gradient_computer = std::make_shared();
+        }
+        else if (std::is_same::value)
+        {
+            gradient_computer = std::make_shared();
         }
         else
         {
-            throw Exception("Invalid parameter for weights updater", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
+            throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
         }
-    }
 
-    if (std::is_same::value)
-    {
-        gradient_computer = std::make_shared();
+        return std::make_shared(
+            argument_types.size() - 1,
+            gradient_computer,
+            weights_updater,
+            learning_rate,
+            l2_reg_coef,
+            batch_size,
+            argument_types,
+            parameters);
     }
-    else if (std::is_same::value)
-    {
-        gradient_computer = std::make_shared();
-    }
-    else
-    {
-        throw Exception("Such gradient computer is not implemented yet", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
-    }
-
-    return std::make_shared(argument_types.size() - 1,
-                                    gradient_computer, weights_updater,
-                                    learning_rate, l2_reg_coef, batch_size, argument_types, parameters);
-}
 
 }
 
@@ -96,4 +114,361 @@ void registerAggregateFunctionMLMethod(AggregateFunctionFactory & factory)
     factory.registerFunction("LogisticRegression", createAggregateFunctionMLMethod);
 }
 
+LinearModelData::LinearModelData(
+    Float64 learning_rate,
+    Float64 l2_reg_coef,
+    UInt32 param_num,
+    UInt32 batch_capacity,
+    std::shared_ptr gradient_computer,
+    std::shared_ptr weights_updater)
+    : learning_rate(learning_rate)
+    , l2_reg_coef(l2_reg_coef)
+    , batch_capacity(batch_capacity)
+    , batch_size(0)
+    , gradient_computer(std::move(gradient_computer))
+    , weights_updater(std::move(weights_updater))
+{
+    weights.resize(param_num, Float64{0.0});
+    gradient_batch.resize(param_num + 1, Float64{0.0});
+}
+
+void LinearModelData::update_state()
+{
+    if (batch_size == 0)
+        return;
+
+    weights_updater->update(batch_size, weights, bias, gradient_batch);
+    batch_size = 0;
+    ++iter_num;
+    gradient_batch.assign(gradient_batch.size(), Float64{0.0});
+}
+
+void LinearModelData::predict(
+    ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const Context & context) const
+{
+    gradient_computer->predict(container, block, arguments, weights, bias, context);
+}
+
+void LinearModelData::read(ReadBuffer & buf)
+{
+    readBinary(bias, buf);
+    readBinary(weights, buf);
+    readBinary(iter_num, buf);
+    readBinary(gradient_batch, buf);
+    readBinary(batch_size, buf);
+    weights_updater->read(buf);
+}
+
+void LinearModelData::write(WriteBuffer & buf) const
+{
+    writeBinary(bias, buf);
+    writeBinary(weights, buf);
+    writeBinary(iter_num, buf);
+    writeBinary(gradient_batch, buf);
+    writeBinary(batch_size, buf);
+    weights_updater->write(buf);
+}
+
+void LinearModelData::merge(const DB::LinearModelData & rhs)
+{
+    if (iter_num == 0 && rhs.iter_num == 0)
+        return;
+
+    update_state();
+    /// can't update rhs state because it's constant
+
+    Float64 frac = (static_cast(iter_num) * iter_num) / (iter_num * iter_num + rhs.iter_num * rhs.iter_num);
+
+    for (size_t i = 0; i < weights.size(); ++i)
+    {
+        weights[i] = weights[i] * frac + rhs.weights[i] * (1 - frac);
+    }
+    bias = bias * frac + rhs.bias * (1 - frac);
+
+    iter_num += rhs.iter_num;
+    weights_updater->merge(*rhs.weights_updater, frac, 1 - frac);
+}
+
+void LinearModelData::add(const IColumn ** columns, size_t row_num)
+{
+    /// first column stores target; features start from (columns + 1)
+    const auto target = (*columns[0])[row_num].get();
+    /// Here we have columns + 1 as first column corresponds to target value, and others - to features
+    weights_updater->add_to_batch(
+        gradient_batch, *gradient_computer, weights, bias, learning_rate, l2_reg_coef, target, columns + 1, row_num);
+
+    ++batch_size;
+    if (batch_size == batch_capacity)
+    {
+        update_state();
+    }
+}
+
+
+void Nesterov::read(ReadBuffer & buf)
+{
+    readBinary(accumulated_gradient, buf);
+}
+
+void Nesterov::write(WriteBuffer & buf) const
+{
+    writeBinary(accumulated_gradient, buf);
+}
+
+void Nesterov::merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac)
+{
+    auto & nesterov_rhs = static_cast(rhs);
+    for (size_t i = 0; i < accumulated_gradient.size(); ++i)
+    {
+        accumulated_gradient[i] = accumulated_gradient[i] * frac + nesterov_rhs.accumulated_gradient[i] * rhs_frac;
+    }
+}
+
+void Nesterov::update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient)
+{
+    if (accumulated_gradient.empty())
+    {
+        accumulated_gradient.resize(batch_gradient.size(), Float64{0.0});
+    }
+
+    for (size_t i = 0; i < batch_gradient.size(); ++i)
+    {
+        accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i] / batch_size;
+    }
+    for (size_t i = 0; i < weights.size(); ++i)
+    {
+        weights[i] += accumulated_gradient[i];
+    }
+    bias += accumulated_gradient[weights.size()];
+}
+
+void Nesterov::add_to_batch(
+    std::vector & batch_gradient,
+    IGradientComputer & gradient_computer,
+    const std::vector & weights,
+    Float64 bias,
+    Float64 learning_rate,
+    Float64 l2_reg_coef,
+    Float64 target,
+    const IColumn ** columns,
+    size_t row_num)
+{
+    if (accumulated_gradient.empty())
+    {
+        accumulated_gradient.resize(batch_gradient.size(), Float64{0.0});
+    }
+
+    std::vector shifted_weights(weights.size());
+    for (size_t i = 0; i != shifted_weights.size(); ++i)
+    {
+        shifted_weights[i] = weights[i] + accumulated_gradient[i] * alpha_;
+    }
+    auto shifted_bias = bias + accumulated_gradient[weights.size()] * alpha_;
+
+    gradient_computer.compute(batch_gradient, shifted_weights, shifted_bias, learning_rate, l2_reg_coef, target, columns, row_num);
+}
+
+void Momentum::read(ReadBuffer & buf)
+{
+    readBinary(accumulated_gradient, buf);
+}
+
+void Momentum::write(WriteBuffer & buf) const
+{
+    writeBinary(accumulated_gradient, buf);
+}
+
+void Momentum::merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac)
+{
+    auto & momentum_rhs = static_cast(rhs);
+    for (size_t i = 0; i < accumulated_gradient.size(); ++i)
+    {
+        accumulated_gradient[i] = accumulated_gradient[i] * frac + momentum_rhs.accumulated_gradient[i] * rhs_frac;
+    }
+}
+
+void Momentum::update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient)
+{
+    /// batch_size is already checked to be greater than 0
+    if (accumulated_gradient.empty())
+    {
+        accumulated_gradient.resize(batch_gradient.size(), Float64{0.0});
+    }
+
+    for (size_t i = 0; i < batch_gradient.size(); ++i)
+    {
+        accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i] / batch_size;
+    }
+    for (size_t i = 0; i < weights.size(); ++i)
+    {
+        weights[i] += accumulated_gradient[i];
+    }
+    bias += accumulated_gradient[weights.size()];
+}
+
+void StochasticGradientDescent::update(
+    UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient)
+{
+    /// batch_size is already checked to be greater than  0
+    for (size_t i = 0; i < weights.size(); ++i)
+    {
+        weights[i] += batch_gradient[i] / batch_size;
+    }
+    bias += batch_gradient[weights.size()] / batch_size;
+}
+
+void IWeightsUpdater::add_to_batch(
+    std::vector & batch_gradient,
+    IGradientComputer & gradient_computer,
+    const std::vector & weights,
+    Float64 bias,
+    Float64 learning_rate,
+    Float64 l2_reg_coef,
+    Float64 target,
+    const IColumn ** columns,
+    size_t row_num)
+{
+    gradient_computer.compute(batch_gradient, weights, bias, learning_rate, l2_reg_coef, target, columns, row_num);
+}
+
+void LogisticRegression::predict(
+    ColumnVector::Container & container,
+    Block & block,
+    const ColumnNumbers & arguments,
+    const std::vector & weights,
+    Float64 bias,
+    const Context & context) const
+{
+    size_t rows_num = block.rows();
+    std::vector results(rows_num, bias);
+
+    for (size_t i = 1; i < arguments.size(); ++i)
+    {
+        const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]);
+        if (!isNumber(cur_col.type))
+        {
+            throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS);
+        }
+
+        /// If column type is already Float64 then castColumn simply returns it
+        auto features_col_ptr = castColumn(cur_col, std::make_shared(), context);
+        auto features_column = typeid_cast(features_col_ptr.get());
+
+        if (!features_column)
+        {
+            throw Exception("Unexpectedly cannot dynamically cast features column " + std::to_string(i), ErrorCodes::LOGICAL_ERROR);
+        }
+
+        for (size_t row_num = 0; row_num != rows_num; ++row_num)
+        {
+            results[row_num] += weights[i - 1] * features_column->getElement(row_num);
+        }
+    }
+
+    container.reserve(rows_num);
+    for (size_t row_num = 0; row_num != rows_num; ++row_num)
+    {
+        container.emplace_back(1 / (1 + exp(-results[row_num])));
+    }
+}
+
+void LogisticRegression::compute(
+    std::vector & batch_gradient,
+    const std::vector & weights,
+    Float64 bias,
+    Float64 learning_rate,
+    Float64 l2_reg_coef,
+    Float64 target,
+    const IColumn ** columns,
+    size_t row_num)
+{
+    Float64 derivative = bias;
+    for (size_t i = 0; i < weights.size(); ++i)
+    {
+        auto value = (*columns[i])[row_num].get();
+        derivative += weights[i] * value;
+    }
+    derivative *= target;
+    derivative = exp(derivative);
+
+    batch_gradient[weights.size()] += learning_rate * target / (derivative + 1);
+    for (size_t i = 0; i < weights.size(); ++i)
+    {
+        auto value = (*columns[i])[row_num].get();
+        batch_gradient[i] += learning_rate * target * value / (derivative + 1) - 2 * l2_reg_coef * weights[i];
+    }
+}
+
+void LinearRegression::predict(
+    ColumnVector::Container & container,
+    Block & block,
+    const ColumnNumbers & arguments,
+    const std::vector & weights,
+    Float64 bias,
+    const Context & context) const
+{
+    if (weights.size() + 1 != arguments.size())
+    {
+        throw Exception("In predict function number of arguments differs from the size of weights vector", ErrorCodes::LOGICAL_ERROR);
+    }
+
+    size_t rows_num = block.rows();
+    std::vector results(rows_num, bias);
+
+    for (size_t i = 1; i < arguments.size(); ++i)
+    {
+        const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]);
+        if (!isNumber(cur_col.type))
+        {
+            throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS);
+        }
+
+        /// If column type is already Float64 then castColumn simply returns it
+        auto features_col_ptr = castColumn(cur_col, std::make_shared(), context);
+        auto features_column = typeid_cast(features_col_ptr.get());
+
+        if (!features_column)
+        {
+            throw Exception("Unexpectedly cannot dynamically cast features column " + std::to_string(i), ErrorCodes::LOGICAL_ERROR);
+        }
+
+        for (size_t row_num = 0; row_num != rows_num; ++row_num)
+        {
+            results[row_num] += weights[i - 1] * features_column->getElement(row_num);
+        }
+    }
+
+    container.reserve(rows_num);
+    for (size_t row_num = 0; row_num != rows_num; ++row_num)
+    {
+        container.emplace_back(results[row_num]);
+    }
+}
+
+void LinearRegression::compute(
+    std::vector & batch_gradient,
+    const std::vector & weights,
+    Float64 bias,
+    Float64 learning_rate,
+    Float64 l2_reg_coef,
+    Float64 target,
+    const IColumn ** columns,
+    size_t row_num)
+{
+    Float64 derivative = (target - bias);
+    for (size_t i = 0; i < weights.size(); ++i)
+    {
+        auto value = (*columns[i])[row_num].get();
+        derivative -= weights[i] * value;
+    }
+    derivative *= (2 * learning_rate);
+
+    batch_gradient[weights.size()] += derivative;
+    for (size_t i = 0; i < weights.size(); ++i)
+    {
+        auto value = (*columns[i])[row_num].get();
+        batch_gradient[i] += derivative * value - 2 * l2_reg_coef * weights[i];
+    }
+}
+
 }
diff --git a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
index 9ae9b504270..8160eb2ef7d 100644
--- a/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
+++ b/dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
@@ -1,27 +1,13 @@
 #pragma once
 
-#include 
-
-#include 
-#include 
-
-#include 
-#include 
-
-#include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
+#include 
+#include "IAggregateFunction.h"
 
 namespace DB
 {
-
 namespace ErrorCodes
 {
     extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
@@ -34,156 +20,79 @@ GradientComputer class computes gradient according to its loss function
 class IGradientComputer
 {
 public:
-    IGradientComputer()
-    {}
+    IGradientComputer() {}
 
     virtual ~IGradientComputer() = default;
 
     /// Adds computed gradient in new point (weights, bias) to batch_gradient
-    virtual void compute(std::vector & batch_gradient, const std::vector &weights, Float64 bias,
-                         Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) = 0;
+    virtual void compute(
+        std::vector & batch_gradient,
+        const std::vector & weights,
+        Float64 bias,
+        Float64 learning_rate,
+        Float64 l2_reg_coef,
+        Float64 target,
+        const IColumn ** columns,
+        size_t row_num)
+        = 0;
 
-    virtual void predict(ColumnVector::Container &container,
-                         Block &block, const ColumnNumbers &arguments,
-                         const std::vector &weights,
-                         Float64 bias, const Context & context) const = 0;
+    virtual void predict(
+        ColumnVector::Container & container,
+        Block & block,
+        const ColumnNumbers & arguments,
+        const std::vector & weights,
+        Float64 bias,
+        const Context & context) const = 0;
 };
 
 
 class LinearRegression : public IGradientComputer
 {
 public:
-    LinearRegression()
-    {}
+    LinearRegression() {}
 
-    void compute(std::vector & batch_gradient, const std::vector &weights, Float64 bias,
-                 Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) override
-    {
-        Float64 derivative = (target - bias);
-        for (size_t i = 0; i < weights.size(); ++i)
-        {
-            auto value = (*columns[i])[row_num].get();
-            derivative -= weights[i] * value;
-        }
-        derivative *= (2 * learning_rate);
+    void compute(
+        std::vector & batch_gradient,
+        const std::vector & weights,
+        Float64 bias,
+        Float64 learning_rate,
+        Float64 l2_reg_coef,
+        Float64 target,
+        const IColumn ** columns,
+        size_t row_num) override;
 
-        batch_gradient[weights.size()] += derivative;
-        for (size_t i = 0; i < weights.size(); ++i)
-        {
-            auto value = (*columns[i])[row_num].get();
-            batch_gradient[i] += derivative * value - 2 * l2_reg_coef * weights[i];
-        }
-    }
-
-    void predict(ColumnVector::Container &container,
-                 Block &block,
-                 const ColumnNumbers &arguments,
-                 const std::vector &weights, Float64 bias, const Context & context) const override
-    {
-        if (weights.size() + 1 != arguments.size())
-        {
-            throw Exception("In predict function number of arguments differs from the size of weights vector", ErrorCodes::LOGICAL_ERROR);
-        }
-
-        size_t rows_num = block.rows();
-        std::vector results(rows_num, bias);
-
-        for (size_t i = 1; i < arguments.size(); ++i)
-        {
-            const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]);
-            if (!isNumber(cur_col.type))
-            {
-                throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS);
-            }
-
-            /// If column type is already Float64 then castColumn simply returns it
-            auto features_col_ptr = castColumn(cur_col, std::make_shared(), context);
-            auto features_column = typeid_cast(features_col_ptr.get());
-
-            if (!features_column)
-            {
-                throw Exception("Unexpectedly cannot dynamically cast features column " + std::to_string(i), ErrorCodes::LOGICAL_ERROR);
-            }
-
-            for (size_t row_num = 0; row_num != rows_num; ++row_num)
-            {
-                results[row_num] += weights[i - 1] * features_column->getElement(row_num);
-            }
-        }
-
-        container.reserve(rows_num);
-        for (size_t row_num = 0; row_num != rows_num; ++row_num)
-        {
-            container.emplace_back(results[row_num]);
-        }
-    }
+    void predict(
+        ColumnVector::Container & container,
+        Block & block,
+        const ColumnNumbers & arguments,
+        const std::vector & weights,
+        Float64 bias,
+        const Context & context) const override;
 };
 
 
 class LogisticRegression : public IGradientComputer
 {
 public:
-    LogisticRegression()
-    {}
+    LogisticRegression() {}
 
-    void compute(std::vector & batch_gradient, const std::vector & weights, Float64 bias,
-                 Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num) override
-    {
-        Float64 derivative = bias;
-        for (size_t i = 0; i < weights.size(); ++i)
-        {
-            auto value = (*columns[i])[row_num].get();
-            derivative += weights[i] * value;
-        }
-        derivative *= target;
-        derivative = exp(derivative);
+    void compute(
+        std::vector & batch_gradient,
+        const std::vector & weights,
+        Float64 bias,
+        Float64 learning_rate,
+        Float64 l2_reg_coef,
+        Float64 target,
+        const IColumn ** columns,
+        size_t row_num) override;
 
-        batch_gradient[weights.size()] += learning_rate * target / (derivative + 1);
-        for (size_t i = 0; i < weights.size(); ++i)
-        {
-            auto value = (*columns[i])[row_num].get();
-            batch_gradient[i] += learning_rate * target * value / (derivative + 1)
-                                    - 2 * l2_reg_coef * weights[i];
-        }
-    }
-
-    void predict(ColumnVector::Container & container,
-                         Block & block,
-                         const ColumnNumbers & arguments,
-                         const std::vector & weights, Float64 bias, const Context & context) const override
-    {
-        size_t rows_num = block.rows();
-        std::vector results(rows_num, bias);
-
-        for (size_t i = 1; i < arguments.size(); ++i)
-        {
-            const ColumnWithTypeAndName & cur_col = block.getByPosition(arguments[i]);
-            if (!isNumber(cur_col.type))
-            {
-                throw Exception("Prediction arguments must have numeric type", ErrorCodes::BAD_ARGUMENTS);
-            }
-
-            /// If column type is already Float64 then castColumn simply returns it
-            auto features_col_ptr = castColumn(cur_col, std::make_shared(), context);
-            auto features_column = typeid_cast(features_col_ptr.get());
-
-            if (!features_column)
-            {
-                throw Exception("Unexpectedly cannot dynamically cast features column " + std::to_string(i), ErrorCodes::LOGICAL_ERROR);
-            }
-
-            for (size_t row_num = 0; row_num != rows_num; ++row_num)
-            {
-                results[row_num] += weights[i - 1] * features_column->getElement(row_num);
-            }
-        }
-
-        container.reserve(rows_num);
-        for (size_t row_num = 0; row_num != rows_num; ++row_num)
-        {
-            container.emplace_back(1 / (1 + exp(-results[row_num])));
-        }
-    }
+    void predict(
+        ColumnVector::Container & container,
+        Block & block,
+        const ColumnNumbers & arguments,
+        const std::vector & weights,
+        Float64 bias,
+        const Context & context) const override;
 };
 
 
@@ -197,98 +106,52 @@ public:
     virtual ~IWeightsUpdater() = default;
 
     /// Calls GradientComputer to update current mini-batch
-    virtual void add_to_batch(std::vector & batch_gradient, IGradientComputer & gradient_computer,
-                              const std::vector & weights, Float64 bias,
-                              Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn **columns, size_t row_num)
-    {
-        gradient_computer.compute(batch_gradient, weights, bias, learning_rate, l2_reg_coef, target, columns, row_num);
-    }
+    virtual void add_to_batch(
+        std::vector & batch_gradient,
+        IGradientComputer & gradient_computer,
+        const std::vector & weights,
+        Float64 bias,
+        Float64 learning_rate,
+        Float64 l2_reg_coef,
+        Float64 target,
+        const IColumn ** columns,
+        size_t row_num);
 
     /// Updates current weights according to the gradient from the last mini-batch
-    virtual void update(UInt32 batch_size,
-                        std::vector & weights, Float64 & bias,
-                        const std::vector & gradient) = 0;
+    virtual void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & gradient) = 0;
 
     /// Used during the merge of two states
-    virtual void merge(const IWeightsUpdater &, Float64, Float64)
-    {}
+    virtual void merge(const IWeightsUpdater &, Float64, Float64) {}
 
     /// Used for serialization when necessary
-    virtual void write(WriteBuffer &) const
-    {}
+    virtual void write(WriteBuffer &) const {}
 
     /// Used for serialization when necessary
-    virtual void read(ReadBuffer &)
-    {}
+    virtual void read(ReadBuffer &) {}
 };
 
 
 class StochasticGradientDescent : public IWeightsUpdater
 {
 public:
-    void update(UInt32 batch_size,
-                std::vector & weights, Float64 & bias,
-                const std::vector & batch_gradient) override
-    {
-        /// batch_size is already checked to be greater than  0
-        for (size_t i = 0; i < weights.size(); ++i)
-        {
-            weights[i] += batch_gradient[i] / batch_size;
-        }
-        bias += batch_gradient[weights.size()] / batch_size;
-    }
+    void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override;
 };
 
 
 class Momentum : public IWeightsUpdater
 {
 public:
-    Momentum()
-    {}
+    Momentum() {}
 
-    Momentum(Float64 alpha) : alpha_(alpha)
-    {}
+    Momentum(Float64 alpha) : alpha_(alpha) {}
 
-    void update(UInt32 batch_size,
-                std::vector & weights, Float64 & bias,
-                const std::vector & batch_gradient) override
-    {
-        /// batch_size is already checked to be greater than 0
-        if (accumulated_gradient.empty())
-        {
-            accumulated_gradient.resize(batch_gradient.size(), Float64{0.0});
-        }
+    void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override;
 
-        for (size_t i = 0; i < batch_gradient.size(); ++i)
-        {
-            accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i] / batch_size;
-        }
-        for (size_t i = 0; i < weights.size(); ++i)
-        {
-            weights[i] += accumulated_gradient[i];
-        }
-        bias += accumulated_gradient[weights.size()];
-    }
+    virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override;
 
-    virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override
-    {
-        auto &momentum_rhs = static_cast(rhs);
-        for (size_t i = 0; i < accumulated_gradient.size(); ++i)
-        {
-            accumulated_gradient[i] = accumulated_gradient[i] * frac +
-                                      momentum_rhs.accumulated_gradient[i] * rhs_frac;
-        }
-    }
+    void write(WriteBuffer & buf) const override;
 
-    void write(WriteBuffer &buf) const override
-    {
-        writeBinary(accumulated_gradient, buf);
-    }
-
-    void read(ReadBuffer &buf) override
-    {
-        readBinary(accumulated_gradient, buf);
-    }
+    void read(ReadBuffer & buf) override;
 
 private:
     Float64 alpha_{0.1};
@@ -299,70 +162,28 @@ private:
 class Nesterov : public IWeightsUpdater
 {
 public:
-    Nesterov()
-    {}
+    Nesterov() {}
 
-    Nesterov(Float64 alpha) : alpha_(alpha)
-    {}
+    Nesterov(Float64 alpha) : alpha_(alpha) {}
 
-    void add_to_batch(std::vector & batch_gradient, IGradientComputer & gradient_computer,
-                      const std::vector & weights, Float64 bias,
-                      Float64 learning_rate, Float64 l2_reg_coef, Float64 target, const IColumn ** columns, size_t row_num) override
-    {
-        if (accumulated_gradient.empty())
-        {
-            accumulated_gradient.resize(batch_gradient.size(), Float64{0.0});
-        }
+    void add_to_batch(
+        std::vector & batch_gradient,
+        IGradientComputer & gradient_computer,
+        const std::vector & weights,
+        Float64 bias,
+        Float64 learning_rate,
+        Float64 l2_reg_coef,
+        Float64 target,
+        const IColumn ** columns,
+        size_t row_num) override;
 
-        std::vector shifted_weights(weights.size());
-        for (size_t i = 0; i != shifted_weights.size(); ++i)
-        {
-            shifted_weights[i] = weights[i] + accumulated_gradient[i] * alpha_;
-        }
-        auto shifted_bias = bias + accumulated_gradient[weights.size()] * alpha_;
+    void update(UInt32 batch_size, std::vector & weights, Float64 & bias, const std::vector & batch_gradient) override;
 
-        gradient_computer.compute(batch_gradient, shifted_weights, shifted_bias, learning_rate, l2_reg_coef, target, columns, row_num);
-    }
+    virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override;
 
-    void update(UInt32 batch_size,
-                std::vector & weights, Float64 & bias,
-                const std::vector & batch_gradient) override
-    {
-        if (accumulated_gradient.empty())
-        {
-            accumulated_gradient.resize(batch_gradient.size(), Float64{0.0});
-        }
+    void write(WriteBuffer & buf) const override;
 
-        for (size_t i = 0; i < batch_gradient.size(); ++i)
-        {
-            accumulated_gradient[i] = accumulated_gradient[i] * alpha_ + batch_gradient[i] / batch_size;
-        }
-        for (size_t i = 0; i < weights.size(); ++i)
-        {
-            weights[i] += accumulated_gradient[i];
-        }
-        bias += accumulated_gradient[weights.size()];
-    }
-
-    virtual void merge(const IWeightsUpdater & rhs, Float64 frac, Float64 rhs_frac) override
-    {
-        auto & nesterov_rhs = static_cast(rhs);
-        for (size_t i = 0; i < accumulated_gradient.size(); ++i)
-        {
-            accumulated_gradient[i] =
-                    accumulated_gradient[i] * frac + nesterov_rhs.accumulated_gradient[i] * rhs_frac;
-        }
-    }
-
-    void write(WriteBuffer &buf) const override
-    {
-        writeBinary(accumulated_gradient, buf);
-    }
-
-    void read(ReadBuffer &buf) override
-    {
-        readBinary(accumulated_gradient, buf);
-    }
+    void read(ReadBuffer & buf) override;
 
 private:
     Float64 alpha_{0.1};
@@ -376,85 +197,26 @@ private:
 class LinearModelData
 {
 public:
-    LinearModelData()
-    {}
+    LinearModelData() {}
 
-    LinearModelData(Float64 learning_rate,
-                    Float64 l2_reg_coef,
-                    UInt32 param_num,
-                    UInt32 batch_capacity,
-                    std::shared_ptr gradient_computer,
-                    std::shared_ptr weights_updater)
-    : learning_rate(learning_rate),
-      l2_reg_coef(l2_reg_coef),
-      batch_capacity(batch_capacity),
-      batch_size(0),
-      gradient_computer(std::move(gradient_computer)),
-      weights_updater(std::move(weights_updater))
-    {
-        weights.resize(param_num, Float64{0.0});
-        gradient_batch.resize(param_num + 1, Float64{0.0});
-    }
+    LinearModelData(
+        Float64 learning_rate,
+        Float64 l2_reg_coef,
+        UInt32 param_num,
+        UInt32 batch_capacity,
+        std::shared_ptr gradient_computer,
+        std::shared_ptr weights_updater);
 
-    void add(const IColumn **columns, size_t row_num)
-    {
-        /// first column stores target; features start from (columns + 1)
-        const auto target = (*columns[0])[row_num].get();
-        /// Here we have columns + 1 as first column corresponds to target value, and others - to features
-        weights_updater->add_to_batch(gradient_batch, *gradient_computer,
-                                      weights, bias, learning_rate, l2_reg_coef, target, columns + 1, row_num);
+    void add(const IColumn ** columns, size_t row_num);
 
-        ++batch_size;
-        if (batch_size == batch_capacity)
-        {
-            update_state();
-        }
-    }
+    void merge(const LinearModelData & rhs);
 
-    void merge(const LinearModelData &rhs)
-    {
-        if (iter_num == 0 && rhs.iter_num == 0)
-            return;
+    void write(WriteBuffer & buf) const;
 
-        update_state();
-        /// can't update rhs state because it's constant
+    void read(ReadBuffer & buf);
 
-        Float64 frac = (static_cast(iter_num) * iter_num) / (iter_num * iter_num + rhs.iter_num * rhs.iter_num);
-
-        for (size_t i = 0; i < weights.size(); ++i)
-        {
-            weights[i] = weights[i] * frac + rhs.weights[i] * (1 - frac);
-        }
-        bias = bias * frac + rhs.bias * (1 - frac);
-
-        iter_num += rhs.iter_num;
-        weights_updater->merge(*rhs.weights_updater, frac, 1 - frac);
-    }
-
-    void write(WriteBuffer &buf) const
-    {
-        writeBinary(bias, buf);
-        writeBinary(weights, buf);
-        writeBinary(iter_num, buf);
-        writeBinary(gradient_batch, buf);
-        writeBinary(batch_size, buf);
-        weights_updater->write(buf);
-    }
-
-    void read(ReadBuffer &buf)
-    {
-        readBinary(bias, buf);
-        readBinary(weights, buf);
-        readBinary(iter_num, buf);
-        readBinary(gradient_batch, buf);
-        readBinary(batch_size, buf);
-        weights_updater->read(buf);
-    }
-
-    void predict(ColumnVector::Container &container, Block &block, const ColumnNumbers &arguments, const Context & context) const
-    {
-        gradient_computer->predict(container, block, arguments, weights, bias, context);
-    }
+    void
+    predict(ColumnVector::Container & container, Block & block, const ColumnNumbers & arguments, const Context & context) const;
 
 private:
     std::vector weights;
@@ -474,16 +236,7 @@ private:
     /**
      * The function is called when we want to flush current batch and update our weights
      */
-    void update_state()
-    {
-        if (batch_size == 0)
-            return;
-
-        weights_updater->update(batch_size, weights, bias, gradient_batch);
-        batch_size = 0;
-        ++iter_num;
-        gradient_batch.assign(gradient_batch.size(), Float64{0.0});
-    }
+    void update_state();
 };
 
 
@@ -491,35 +244,33 @@ template <
     /// Implemented Machine Learning method
     typename Data,
     /// Name of the method
-    typename Name
->
+    typename Name>
 class AggregateFunctionMLMethod final : public IAggregateFunctionDataHelper>
 {
 public:
     String getName() const override { return Name::name; }
 
-    explicit AggregateFunctionMLMethod(UInt32 param_num,
-                                       std::shared_ptr gradient_computer,
-                                       std::shared_ptr weights_updater,
-                                       Float64 learning_rate,
-                                       Float64 l2_reg_coef,
-                                       UInt32 batch_size,
-                                       const DataTypes & arguments_types,
-                                       const Array & params)
-        : IAggregateFunctionDataHelper>(arguments_types, params),
-        param_num(param_num),
-        learning_rate(learning_rate),
-        l2_reg_coef(l2_reg_coef),
-        batch_size(batch_size),
-        gradient_computer(std::move(gradient_computer)),
-        weights_updater(std::move(weights_updater))
-        {}
-
-    DataTypePtr getReturnType() const override
+    explicit AggregateFunctionMLMethod(
+        UInt32 param_num,
+        std::shared_ptr gradient_computer,
+        std::shared_ptr weights_updater,
+        Float64 learning_rate,
+        Float64 l2_reg_coef,
+        UInt32 batch_size,
+        const DataTypes & arguments_types,
+        const Array & params)
+        : IAggregateFunctionDataHelper>(arguments_types, params)
+        , param_num(param_num)
+        , learning_rate(learning_rate)
+        , l2_reg_coef(l2_reg_coef)
+        , batch_size(batch_size)
+        , gradient_computer(std::move(gradient_computer))
+        , weights_updater(std::move(weights_updater))
     {
-        return std::make_shared>();
     }
 
+    DataTypePtr getReturnType() const override { return std::make_shared>(); }
+
     void create(AggregateDataPtr place) const override
     {
         new (place) Data(learning_rate, l2_reg_coef, param_num, batch_size, gradient_computer, weights_updater);
@@ -530,29 +281,22 @@ public:
         this->data(place).add(columns, row_num);
     }
 
-    void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override
-    {
-        this->data(place).merge(this->data(rhs));
-    }
+    void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override { this->data(place).merge(this->data(rhs)); }
 
-    void serialize(ConstAggregateDataPtr place, WriteBuffer & buf) const override
-    {
-        this->data(place).write(buf);
-    }
+    void serialize(ConstAggregateDataPtr place, WriteBuffer & buf) const override { this->data(place).write(buf); }
 
-    void deserialize(AggregateDataPtr place, ReadBuffer & buf, Arena *) const override
-    {
-        this->data(place).read(buf);
-    }
+    void deserialize(AggregateDataPtr place, ReadBuffer & buf, Arena *) const override { this->data(place).read(buf); }
 
-    void predictValues(ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments, const Context & context) const override
+    void predictValues(
+        ConstAggregateDataPtr place, IColumn & to, Block & block, const ColumnNumbers & arguments, const Context & context) const override
     {
         if (arguments.size() != param_num + 1)
-            throw Exception("Predict got incorrect number of arguments. Got: " +
-                            std::to_string(arguments.size()) + ". Required: " + std::to_string(param_num + 1),
-                            ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
+            throw Exception(
+                "Predict got incorrect number of arguments. Got: " + std::to_string(arguments.size())
+                    + ". Required: " + std::to_string(param_num + 1),
+                ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
 
-        auto &column = dynamic_cast &>(to);
+        auto & column = dynamic_cast &>(to);
 
         this->data(place).predict(column.getData(), block, arguments, context);
     }
@@ -575,6 +319,12 @@ private:
     std::shared_ptr weights_updater;
 };
 
-struct NameLinearRegression { static constexpr auto name = "LinearRegression"; };
-struct NameLogisticRegression { static constexpr auto name = "LogisticRegression"; };
+struct NameLinearRegression
+{
+    static constexpr auto name = "LinearRegression";
+};
+struct NameLogisticRegression
+{
+    static constexpr auto name = "LogisticRegression";
+};
 }

From 8814e0cda578806d2f159f2d0cbcdae11a2d6744 Mon Sep 17 00:00:00 2001
From: proller 
Date: Tue, 14 May 2019 22:55:10 +0300
Subject: [PATCH 147/194] server: informative listen error messages (#5268)

---
 dbms/programs/server/Server.cpp | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/dbms/programs/server/Server.cpp b/dbms/programs/server/Server.cpp
index fea06e9506d..e446a88abc5 100644
--- a/dbms/programs/server/Server.cpp
+++ b/dbms/programs/server/Server.cpp
@@ -79,6 +79,7 @@ namespace ErrorCodes
     extern const int SYSTEM_ERROR;
     extern const int FAILED_TO_GETPWUID;
     extern const int MISMATCHING_USERS_FOR_PROCESS_AND_DATA;
+    extern const int NETWORK_ERROR;
 }
 
 
@@ -587,12 +588,12 @@ int Server::main(const std::vector & /*args*/)
             return socket_address;
         };
 
-        auto socket_bind_listen = [&](auto & socket, const std::string & host, UInt16 port, bool secure = 0)
+        auto socket_bind_listen = [&](auto & socket, const std::string & host, UInt16 port, [[maybe_unused]] bool secure = 0)
         {
                auto address = make_socket_address(host, port);
-#if !defined(POCO_CLICKHOUSE_PATCH) || POCO_VERSION <= 0x02000000 // TODO: fill correct version
+#if !defined(POCO_CLICKHOUSE_PATCH) || POCO_VERSION < 0x01090100
                if (secure)
-                   /// Bug in old poco, listen() after bind() with reusePort param will fail because have no implementation in SecureServerSocketImpl
+                   /// Bug in old (<1.9.1) poco, listen() after bind() with reusePort param will fail because have no implementation in SecureServerSocketImpl
                    /// https://github.com/pocoproject/poco/pull/2257
                    socket.bind(address, /* reuseAddress = */ true);
                else
@@ -611,13 +612,15 @@ int Server::main(const std::vector & /*args*/)
         for (const auto & listen_host : listen_hosts)
         {
             /// For testing purposes, user may omit tcp_port or http_port or https_port in configuration file.
+            uint16_t listen_port = 0;
             try
             {
                 /// HTTP
                 if (config().has("http_port"))
                 {
                     Poco::Net::ServerSocket socket;
-                    auto address = socket_bind_listen(socket, listen_host, config().getInt("http_port"));
+                    listen_port = config().getInt("http_port");
+                    auto address = socket_bind_listen(socket, listen_host, listen_port);
                     socket.setReceiveTimeout(settings.http_receive_timeout);
                     socket.setSendTimeout(settings.http_send_timeout);
                     servers.emplace_back(std::make_unique(
@@ -634,7 +637,8 @@ int Server::main(const std::vector & /*args*/)
                 {
 #if USE_POCO_NETSSL
                     Poco::Net::SecureServerSocket socket;
-                    auto address = socket_bind_listen(socket, listen_host, config().getInt("https_port"), /* secure = */ true);
+                    listen_port = config().getInt("https_port");
+                    auto address = socket_bind_listen(socket, listen_host, listen_port, /* secure = */ true);
                     socket.setReceiveTimeout(settings.http_receive_timeout);
                     socket.setSendTimeout(settings.http_send_timeout);
                     servers.emplace_back(std::make_unique(
@@ -654,7 +658,8 @@ int Server::main(const std::vector & /*args*/)
                 if (config().has("tcp_port"))
                 {
                     Poco::Net::ServerSocket socket;
-                    auto address = socket_bind_listen(socket, listen_host, config().getInt("tcp_port"));
+                    listen_port = config().getInt("tcp_port");
+                    auto address = socket_bind_listen(socket, listen_host, listen_port);
                     socket.setReceiveTimeout(settings.receive_timeout);
                     socket.setSendTimeout(settings.send_timeout);
                     servers.emplace_back(std::make_unique(
@@ -671,7 +676,8 @@ int Server::main(const std::vector & /*args*/)
                 {
 #if USE_POCO_NETSSL
                     Poco::Net::SecureServerSocket socket;
-                    auto address = socket_bind_listen(socket, listen_host, config().getInt("tcp_port_secure"), /* secure = */ true);
+                    listen_port = config().getInt("tcp_port_secure");
+                    auto address = socket_bind_listen(socket, listen_host, listen_port, /* secure = */ true);
                     socket.setReceiveTimeout(settings.receive_timeout);
                     socket.setSendTimeout(settings.send_timeout);
                     servers.emplace_back(std::make_unique(
@@ -694,7 +700,8 @@ int Server::main(const std::vector & /*args*/)
                 if (config().has("interserver_http_port"))
                 {
                     Poco::Net::ServerSocket socket;
-                    auto address = socket_bind_listen(socket, listen_host, config().getInt("interserver_http_port"));
+                    listen_port = config().getInt("interserver_http_port");
+                    auto address = socket_bind_listen(socket, listen_host, listen_port);
                     socket.setReceiveTimeout(settings.http_receive_timeout);
                     socket.setSendTimeout(settings.http_send_timeout);
                     servers.emplace_back(std::make_unique(
@@ -710,7 +717,8 @@ int Server::main(const std::vector & /*args*/)
                 {
 #if USE_POCO_NETSSL
                     Poco::Net::SecureServerSocket socket;
-                    auto address = socket_bind_listen(socket, listen_host, config().getInt("interserver_https_port"), /* secure = */ true);
+                    listen_port = config().getInt("interserver_https_port");
+                    auto address = socket_bind_listen(socket, listen_host, listen_port, /* secure = */ true);
                     socket.setReceiveTimeout(settings.http_receive_timeout);
                     socket.setSendTimeout(settings.http_send_timeout);
                     servers.emplace_back(std::make_unique(
@@ -726,16 +734,17 @@ int Server::main(const std::vector & /*args*/)
 #endif
                 }
             }
-            catch (const Poco::Net::NetException & e)
+            catch (const Poco::Exception & e)
             {
+                std::string message = "Listen [" + listen_host + "]:" + std::to_string(listen_port) + " failed: " + std::to_string(e.code()) + ": " + e.what() + ": " + e.message();
                 if (listen_try)
-                    LOG_ERROR(log, "Listen [" << listen_host << "]: " << e.code() << ": " << e.what() << ": " << e.message()
+                    LOG_ERROR(log, message
                         << "  If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to "
                         "specify not disabled IPv4 or IPv6 address to listen in  element of configuration "
                         "file. Example for disabled IPv6: 0.0.0.0 ."
                         " Example for disabled IPv4: ::");
                 else
-                    throw;
+                    throw Exception{message, ErrorCodes::NETWORK_ERROR};
             }
         }
 

From 150c8466d7da814a6fcedd3bed21416635dc1a20 Mon Sep 17 00:00:00 2001
From: Ivan Blinkov 
Date: Wed, 15 May 2019 12:04:24 +0300
Subject: [PATCH 148/194] fix few typos

---
 docs/en/operations/table_engines/url.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/en/operations/table_engines/url.md b/docs/en/operations/table_engines/url.md
index 1cf803c763c..dcae1d5d6d1 100644
--- a/docs/en/operations/table_engines/url.md
+++ b/docs/en/operations/table_engines/url.md
@@ -5,11 +5,11 @@ to the [File](file.md) engine.
 
 ## Using the engine in the ClickHouse server
 
-`The format` must be one that ClickHouse can use in
+The `format` must be one that ClickHouse can use in
 `SELECT` queries and, if necessary, in `INSERTs`. For the full list of supported formats, see
 [Formats](../../interfaces/formats.md#formats).
 
-`The URL` must conform to the structure of a Uniform Resource Locator. The specified URL must point to a server
+The `URL` must conform to the structure of a Uniform Resource Locator. The specified URL must point to a server
 that uses HTTP or HTTPS. This does not require any
 additional headers for getting a response from the server.
 

From 0da7463a6b79a9cdeb6961e6873cb62fb4b1c257 Mon Sep 17 00:00:00 2001
From: proller 
Date: Wed, 15 May 2019 12:16:09 +0300
Subject: [PATCH 149/194] CLICKHOUSE-4519 Support dictionaries in
 clickhouse-copier (#5270)

---
 dbms/programs/copier/CMakeLists.txt        |  2 +-
 dbms/programs/copier/ClusterCopier.cpp     |  2 +
 dbms/src/Common/Config/ConfigProcessor.cpp | 54 +++++++++++-----------
 3 files changed, 30 insertions(+), 28 deletions(-)

diff --git a/dbms/programs/copier/CMakeLists.txt b/dbms/programs/copier/CMakeLists.txt
index 55b2fc7e1cb..0aec381ebd5 100644
--- a/dbms/programs/copier/CMakeLists.txt
+++ b/dbms/programs/copier/CMakeLists.txt
@@ -1,5 +1,5 @@
 set(CLICKHOUSE_COPIER_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ClusterCopier.cpp)
-set(CLICKHOUSE_COPIER_LINK PRIVATE clickhouse_functions clickhouse_table_functions clickhouse_aggregate_functions PUBLIC daemon)
+set(CLICKHOUSE_COPIER_LINK PRIVATE clickhouse_functions clickhouse_table_functions clickhouse_aggregate_functions clickhouse_dictionaries PUBLIC daemon)
 set(CLICKHOUSE_COPIER_INCLUDE SYSTEM PRIVATE ${PCG_RANDOM_INCLUDE_DIR})
 
 clickhouse_program_add(copier)
diff --git a/dbms/programs/copier/ClusterCopier.cpp b/dbms/programs/copier/ClusterCopier.cpp
index 75096df74ed..5d388686d55 100644
--- a/dbms/programs/copier/ClusterCopier.cpp
+++ b/dbms/programs/copier/ClusterCopier.cpp
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -2169,6 +2170,7 @@ void ClusterCopierApp::mainImpl()
     registerAggregateFunctions();
     registerTableFunctions();
     registerStorages();
+    registerDictionaries();
 
     static const std::string default_database = "_local";
     context->addDatabase(default_database, std::make_shared(default_database));
diff --git a/dbms/src/Common/Config/ConfigProcessor.cpp b/dbms/src/Common/Config/ConfigProcessor.cpp
index 73028e79f23..06c1269bd63 100644
--- a/dbms/src/Common/Config/ConfigProcessor.cpp
+++ b/dbms/src/Common/Config/ConfigProcessor.cpp
@@ -571,41 +571,41 @@ ConfigProcessor::LoadedConfig ConfigProcessor::loadConfigWithZooKeeperIncludes(
 
 void ConfigProcessor::savePreprocessedConfig(const LoadedConfig & loaded_config, std::string preprocessed_dir)
 {
-    if (preprocessed_path.empty())
+    try
     {
-        auto new_path = loaded_config.config_path;
-        if (new_path.substr(0, main_config_path.size()) == main_config_path)
-            new_path.replace(0, main_config_path.size(), "");
-        std::replace(new_path.begin(), new_path.end(), '/', '_');
-
-        if (preprocessed_dir.empty())
+        if (preprocessed_path.empty())
         {
-            if (!loaded_config.configuration->has("path"))
+            auto new_path = loaded_config.config_path;
+            if (new_path.substr(0, main_config_path.size()) == main_config_path)
+                new_path.replace(0, main_config_path.size(), "");
+            std::replace(new_path.begin(), new_path.end(), '/', '_');
+
+            if (preprocessed_dir.empty())
             {
-                // Will use current directory
-                auto parent_path = Poco::Path(loaded_config.config_path).makeParent();
-                preprocessed_dir = parent_path.toString();
-                Poco::Path poco_new_path(new_path);
-                poco_new_path.setBaseName(poco_new_path.getBaseName() + PREPROCESSED_SUFFIX);
-                new_path = poco_new_path.toString();
+                if (!loaded_config.configuration->has("path"))
+                {
+                    // Will use current directory
+                    auto parent_path = Poco::Path(loaded_config.config_path).makeParent();
+                    preprocessed_dir = parent_path.toString();
+                    Poco::Path poco_new_path(new_path);
+                    poco_new_path.setBaseName(poco_new_path.getBaseName() + PREPROCESSED_SUFFIX);
+                    new_path = poco_new_path.toString();
+                }
+                else
+                {
+                    preprocessed_dir = loaded_config.configuration->getString("path") + "/preprocessed_configs/";
+                }
             }
             else
             {
-                preprocessed_dir = loaded_config.configuration->getString("path") + "/preprocessed_configs/";
+                preprocessed_dir += "/preprocessed_configs/";
             }
-        }
-        else
-        {
-            preprocessed_dir += "/preprocessed_configs/";
-        }
 
-        preprocessed_path = preprocessed_dir + new_path;
-        auto preprocessed_path_parent = Poco::Path(preprocessed_path).makeParent();
-        if (!preprocessed_path_parent.toString().empty())
-            Poco::File(preprocessed_path_parent).createDirectories();
-    }
-    try
-    {
+            preprocessed_path = preprocessed_dir + new_path;
+            auto preprocessed_path_parent = Poco::Path(preprocessed_path).makeParent();
+            if (!preprocessed_path_parent.toString().empty())
+                Poco::File(preprocessed_path_parent).createDirectories();
+        }
         DOMWriter().writeNode(preprocessed_path, loaded_config.preprocessed_xml);
     }
     catch (Poco::Exception & e)

From 02f01a5104250670cba9e532ead2d0ad53e4ae08 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Wed, 15 May 2019 15:28:44 +0300
Subject: [PATCH 150/194] throw Decimal overflow for Inf and NaN

---
 dbms/src/DataTypes/DataTypesDecimal.h                  |  6 ++++++
 dbms/tests/queries/0_stateless/00700_decimal_casts.sql | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/dbms/src/DataTypes/DataTypesDecimal.h b/dbms/src/DataTypes/DataTypesDecimal.h
index e001c094af1..32d6549a4c8 100644
--- a/dbms/src/DataTypes/DataTypesDecimal.h
+++ b/dbms/src/DataTypes/DataTypesDecimal.h
@@ -1,4 +1,6 @@
 #pragma once
+#include 
+
 #include 
 #include 
 #include 
@@ -318,7 +320,11 @@ convertToDecimal(const typename FromDataType::FieldType & value, UInt32 scale)
     using FromFieldType = typename FromDataType::FieldType;
 
     if constexpr (std::is_floating_point_v)
+    {
+        if (std::isinf(value) || std::isnan(value))
+            throw Exception("Decimal convert overflow. Cannot convert infinity or NaN into decimal", ErrorCodes::DECIMAL_OVERFLOW);
         return value * ToDataType::getScaleMultiplier(scale);
+    }
     else
     {
         if constexpr (std::is_same_v)
diff --git a/dbms/tests/queries/0_stateless/00700_decimal_casts.sql b/dbms/tests/queries/0_stateless/00700_decimal_casts.sql
index 242a244a7fa..db43ea84592 100644
--- a/dbms/tests/queries/0_stateless/00700_decimal_casts.sql
+++ b/dbms/tests/queries/0_stateless/00700_decimal_casts.sql
@@ -240,3 +240,13 @@ SELECT toUInt64('9223372036854775809') AS x, toDecimal64(x, 0); -- { serverError
 SELECT toDecimal32(0, rowNumberInBlock()); -- { serverError 44 }
 SELECT toDecimal64(0, rowNumberInBlock()); -- { serverError 44 }
 SELECT toDecimal128(0, rowNumberInBlock()); -- { serverError 44 }
+
+SELECT toDecimal32(1/0, 0); -- { serverError 407 }
+SELECT toDecimal64(1/0, 1); -- { serverError 407 }
+SELECT toDecimal128(0/0, 2); -- { serverError 407 }
+SELECT CAST(1/0, 'Decimal(9, 0)'); -- { serverError 407 }
+SELECT CAST(1/0, 'Decimal(18, 1)'); -- { serverError 407 }
+SELECT CAST(1/0, 'Decimal(38, 2)'); -- { serverError 407 }
+SELECT CAST(0/0, 'Decimal(9, 3)'); -- { serverError 407 }
+SELECT CAST(0/0, 'Decimal(18, 4)'); -- { serverError 407 }
+SELECT CAST(0/0, 'Decimal(38, 5)'); -- { serverError 407 }

From 720f8667e41f82a90a1b0b381a996d48bf465e52 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Wed, 15 May 2019 16:51:17 +0300
Subject: [PATCH 151/194] fix decimal quoted csv input

---
 dbms/src/DataTypes/DataTypesDecimal.cpp         | 14 ++++++++++++--
 dbms/src/DataTypes/DataTypesDecimal.h           |  5 +++--
 dbms/src/IO/readFloatText.h                     | 16 ++++++++++++++++
 .../00861_decimal_quoted_csv.reference          |  5 +++++
 .../0_stateless/00861_decimal_quoted_csv.sql    | 17 +++++++++++++++++
 5 files changed, 53 insertions(+), 4 deletions(-)
 create mode 100644 dbms/tests/queries/0_stateless/00861_decimal_quoted_csv.reference
 create mode 100644 dbms/tests/queries/0_stateless/00861_decimal_quoted_csv.sql

diff --git a/dbms/src/DataTypes/DataTypesDecimal.cpp b/dbms/src/DataTypes/DataTypesDecimal.cpp
index 8ec5bb6664f..ad33e298d3b 100644
--- a/dbms/src/DataTypes/DataTypesDecimal.cpp
+++ b/dbms/src/DataTypes/DataTypesDecimal.cpp
@@ -52,10 +52,13 @@ void DataTypeDecimal::serializeText(const IColumn & column, size_t row_num, W
 }
 
 template 
-void DataTypeDecimal::readText(T & x, ReadBuffer & istr, UInt32 precision, UInt32 scale)
+void DataTypeDecimal::readText(T & x, ReadBuffer & istr, UInt32 precision, UInt32 scale, bool csv)
 {
     UInt32 unread_scale = scale;
-    readDecimalText(istr, x, precision, unread_scale);
+    if (csv)
+        readCSVDecimalText(istr, x, precision, unread_scale);
+    else
+        readDecimalText(istr, x, precision, unread_scale);
     x *= getScaleMultiplier(unread_scale);
 }
 
@@ -67,6 +70,13 @@ void DataTypeDecimal::deserializeText(IColumn & column, ReadBuffer & istr, co
     static_cast(column).getData().push_back(x);
 }
 
+template 
+void DataTypeDecimal::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings &) const
+{
+    T x;
+    readText(x, istr, true);
+    static_cast(column).getData().push_back(x);
+}
 
 template 
 T DataTypeDecimal::parseFromString(const String & str) const
diff --git a/dbms/src/DataTypes/DataTypesDecimal.h b/dbms/src/DataTypes/DataTypesDecimal.h
index e001c094af1..d127d503461 100644
--- a/dbms/src/DataTypes/DataTypesDecimal.h
+++ b/dbms/src/DataTypes/DataTypesDecimal.h
@@ -91,6 +91,7 @@ public:
 
     void serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettings &) const override;
     void deserializeText(IColumn & column, ReadBuffer & istr, const FormatSettings &) const override;
+    void deserializeTextCSV(IColumn & column, ReadBuffer & istr, const FormatSettings &) const override;
 
     void serializeBinary(const Field & field, WriteBuffer & ostr) const override;
     void serializeBinary(const IColumn & column, size_t row_num, WriteBuffer & ostr) const override;
@@ -175,8 +176,8 @@ public:
 
     T parseFromString(const String & str) const;
 
-    void readText(T & x, ReadBuffer & istr) const { readText(x, istr, precision, scale); }
-    static void readText(T & x, ReadBuffer & istr, UInt32 precision, UInt32 scale);
+    void readText(T & x, ReadBuffer & istr, bool csv = false) const { readText(x, istr, precision, scale, csv); }
+    static void readText(T & x, ReadBuffer & istr, UInt32 precision, UInt32 scale, bool csv = false);
     static T getScaleMultiplier(UInt32 scale);
 
 private:
diff --git a/dbms/src/IO/readFloatText.h b/dbms/src/IO/readFloatText.h
index 01303886b7e..d76d5fd5bd0 100644
--- a/dbms/src/IO/readFloatText.h
+++ b/dbms/src/IO/readFloatText.h
@@ -668,6 +668,22 @@ inline void readDecimalText(ReadBuffer & buf, T & x, unsigned int precision, uns
     scale += exponent;
 }
 
+template 
+inline void readCSVDecimalText(ReadBuffer & buf, T & x, unsigned int precision, unsigned int & scale)
+{
+    if (buf.eof())
+        throwReadAfterEOF();
+
+    char maybe_quote = *buf.position();
+
+    if (maybe_quote == '\'' || maybe_quote == '\"')
+        ++buf.position();
+
+    readDecimalText(buf, x, precision, scale, false);
+
+    if (maybe_quote == '\'' || maybe_quote == '\"')
+        assertChar(maybe_quote, buf);
+}
 
 template  void readFloatTextPrecise(T & x, ReadBuffer & in) { readFloatTextPreciseImpl(x, in); }
 template  bool tryReadFloatTextPrecise(T & x, ReadBuffer & in) { return readFloatTextPreciseImpl(x, in); }
diff --git a/dbms/tests/queries/0_stateless/00861_decimal_quoted_csv.reference b/dbms/tests/queries/0_stateless/00861_decimal_quoted_csv.reference
new file mode 100644
index 00000000000..6a219226835
--- /dev/null
+++ b/dbms/tests/queries/0_stateless/00861_decimal_quoted_csv.reference
@@ -0,0 +1,5 @@
+1	1.00	1.00	1.00
+2	-1.00	-1.00	-1.00
+3	1.00	1.00	1.00
+4	-0.10	-0.10	-0.10
+5	0.01	0.01	0.01
diff --git a/dbms/tests/queries/0_stateless/00861_decimal_quoted_csv.sql b/dbms/tests/queries/0_stateless/00861_decimal_quoted_csv.sql
new file mode 100644
index 00000000000..100fc47d22e
--- /dev/null
+++ b/dbms/tests/queries/0_stateless/00861_decimal_quoted_csv.sql
@@ -0,0 +1,17 @@
+DROP TABLE IF EXISTS test;
+CREATE TABLE test (key UInt64, d32 Decimal32(2), d64 Decimal64(2), d128 Decimal128(2)) ENGINE = Memory;
+
+INSERT INTO test FORMAT CSV "1","1","1","1"
+;
+INSERT INTO test FORMAT CSV "2","-1","-1","-1"
+;
+INSERT INTO test FORMAT CSV "3","1.0","1.0","1.0"
+;
+INSERT INTO test FORMAT CSV "4","-0.1","-0.1","-0.1"
+;
+INSERT INTO test FORMAT CSV "5","0.010","0.010","0.010"
+;
+
+SELECT * FROM test ORDER BY key;
+
+DROP TABLE test;

From 1ea9e3019d8cf341fe45beb19c109daa727c1a09 Mon Sep 17 00:00:00 2001
From: Ivan <5627721+abyss7@users.noreply.github.com>
Date: Wed, 15 May 2019 19:11:50 +0300
Subject: [PATCH 152/194] Freeze the Kafka buffer after first empty response
 (#5283)

* Check inside inferior streams for cancellation while reading.
* Stop reading from Kafka buffer after first empty read.
---
 .../Formats/BlockInputStreamFromRowInputStream.cpp    |  2 +-
 .../Storages/Kafka/ReadBufferFromKafkaConsumer.cpp    | 11 +++++++++++
 dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h |  1 +
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/dbms/src/Formats/BlockInputStreamFromRowInputStream.cpp b/dbms/src/Formats/BlockInputStreamFromRowInputStream.cpp
index 5507ad6b2f2..b67ce9b28cd 100644
--- a/dbms/src/Formats/BlockInputStreamFromRowInputStream.cpp
+++ b/dbms/src/Formats/BlockInputStreamFromRowInputStream.cpp
@@ -63,7 +63,7 @@ Block BlockInputStreamFromRowInputStream::readImpl()
             if (rows_portion_size && batch == rows_portion_size)
             {
                 batch = 0;
-                if (!checkTimeLimit())
+                if (!checkTimeLimit() || isCancelled())
                     break;
             }
 
diff --git a/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp b/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp
index dda42c299d9..b029454210e 100644
--- a/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp
+++ b/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.cpp
@@ -27,6 +27,8 @@ void ReadBufferFromKafkaConsumer::subscribe(const Names & topics)
         consumer->poll(5s);
         consumer->resume();
     }
+
+    stalled = false;
 }
 
 void ReadBufferFromKafkaConsumer::unsubscribe()
@@ -38,6 +40,12 @@ void ReadBufferFromKafkaConsumer::unsubscribe()
 /// Do commit messages implicitly after we processed the previous batch.
 bool ReadBufferFromKafkaConsumer::nextImpl()
 {
+    /// NOTE: ReadBuffer was implemented with a immutable buffer contents in mind.
+    ///       If we failed to poll any message once - don't try again.
+    ///       Otherwise, the |poll_timeout| expectations get flawn.
+    if (stalled)
+        return false;
+
     if (current == messages.end())
     {
         commit();
@@ -48,7 +56,10 @@ bool ReadBufferFromKafkaConsumer::nextImpl()
     }
 
     if (messages.empty() || current == messages.end())
+    {
+        stalled = true;
         return false;
+    }
 
     if (auto err = current->get_error())
     {
diff --git a/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h b/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h
index 3b95685c583..d2892feed76 100644
--- a/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h
+++ b/dbms/src/Storages/Kafka/ReadBufferFromKafkaConsumer.h
@@ -38,6 +38,7 @@ private:
     Poco::Logger * log;
     const size_t batch_size = 1;
     const size_t poll_timeout = 0;
+    bool stalled = false;
 
     Messages messages;
     Messages::const_iterator current;

From 0760a3436f52e0069e2d7b8cef19e2ce0dbbeb9e Mon Sep 17 00:00:00 2001
From: Yangkuan Liu 
Date: Thu, 16 May 2019 00:16:25 +0800
Subject: [PATCH 153/194] add AggregateFunction TSgroup{Rate}Sum (#4542)

---
 .../AggregateFunctionTSGroupSum.cpp           |  31 ++
 .../AggregateFunctionTSGroupSum.h             | 306 ++++++++++++++++++
 .../registerAggregateFunctions.cpp            |   3 +-
 .../00910_aggregation_tsgroupsum.reference    |   2 +
 .../00910_aggregation_tsgroupsum.sql          |  10 +
 .../query_language/agg_functions/reference.md |  54 ++++
 6 files changed, 405 insertions(+), 1 deletion(-)
 create mode 100644 dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.cpp
 create mode 100644 dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.h
 create mode 100644 dbms/tests/queries/0_stateless/00910_aggregation_tsgroupsum.reference
 create mode 100644 dbms/tests/queries/0_stateless/00910_aggregation_tsgroupsum.sql

diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.cpp b/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.cpp
new file mode 100644
index 00000000000..0bb586b5151
--- /dev/null
+++ b/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.cpp
@@ -0,0 +1,31 @@
+#include 
+#include 
+#include 
+#include 
+
+
+namespace DB
+{
+
+    namespace
+    {
+        template
+        AggregateFunctionPtr createAggregateFunctionTSgroupSum(const std::string & name, const DataTypes & arguments, const Array & params)
+        {
+            assertNoParameters(name, params);
+
+            if (arguments.size() < 3)
+                throw Exception("Not enough event arguments for aggregate function " + name, ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
+
+            return std::make_shared>(arguments);
+        }
+
+    }
+
+    void registerAggregateFunctionTSgroupSum(AggregateFunctionFactory & factory)
+    {
+        factory.registerFunction("TSgroupSum", createAggregateFunctionTSgroupSum, AggregateFunctionFactory::CaseInsensitive);
+        factory.registerFunction("TSgroupRateSum", createAggregateFunctionTSgroupSum, AggregateFunctionFactory::CaseInsensitive);
+    }
+
+}
diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.h b/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.h
new file mode 100644
index 00000000000..1eddeaf18d0
--- /dev/null
+++ b/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.h
@@ -0,0 +1,306 @@
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+
+namespace DB
+{
+    namespace ErrorCodes
+    {
+        extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
+        extern const int TOO_MANY_ARGUMENTS_FOR_FUNCTION;
+    }
+    template 
+    struct AggregateFunctionTSgroupSumData
+    {
+        using DataPoint = std::pair;
+        struct Points
+        {
+            using Dps = std::queue;
+            Dps dps;
+            void add(Int64 t, Float64 v)
+            {
+                dps.push(std::make_pair(t, v));
+                if (dps.size() > 2)
+                    dps.pop();
+            }
+            Float64 getval(Int64 t)
+            {
+                Int64 t1, t2;
+                Float64 v1, v2;
+                if (rate)
+                {
+                    if (dps.size() < 2)
+                        return 0;
+                    t1 = dps.back().first;
+                    t2 = dps.front().first;
+                    v1 = dps.back().second;
+                    v2 = dps.front().second;
+                    return (v1-v2)/Float64(t1-t2);
+                }
+                else
+                {
+                    if (dps.size() == 1 && t == dps.front().first)
+                        return dps.front().second;
+                    t1 = dps.back().first;
+                    t2 = dps.front().first;
+                    v1 = dps.back().second;
+                    v2 = dps.front().second;
+                    return v2 + ((v1-v2)*Float64(t-t2))/Float64(t1-t2);
+                }
+            }
+        };
+
+        static constexpr size_t bytes_on_stack = 128;
+        typedef std::map Series;
+        typedef PODArray, bytes_on_stack>> AggSeries;
+        Series ss;
+        AggSeries result;
+
+        void add(UInt64 uid, Int64 t, Float64 v)
+        {//suppose t is coming asc
+            typename Series::iterator it_ss;
+            if (ss.count(uid) == 0)
+            {//time series not exist, insert new one
+                Points tmp;
+                tmp.add(t, v);
+                ss.emplace(uid, tmp);
+                it_ss = ss.find(uid);
+            }
+            else
+           {
+                it_ss = ss.find(uid);
+                it_ss->second.add(t, v);
+            }
+            if (result.size() > 0 && t < result.back().first)
+                throw Exception{"TSgroupSum or TSgroupRateSum must order by timestamp asc!!!", ErrorCodes::LOGICAL_ERROR};
+            if (result.size() > 0 && t == result.back().first)
+            {
+                //do not add new point
+                if (rate)
+                    result.back().second += it_ss->second.getval(t);
+                else
+                    result.back().second += v;
+            }
+            else
+            {
+
+                if (rate)
+                    result.emplace_back(std::make_pair(t, it_ss->second.getval(t)));
+                else
+                    result.emplace_back(std::make_pair(t,v));
+            }
+            size_t i = result.size() - 1;
+            //reverse find out the index of timestamp that more than previous timestamp of t
+            while (result[i].first > it_ss->second.dps.front().first && i >= 0)
+                i--;
+
+            i++;
+            while (i < result.size()-1)
+            {
+                result[i].second += it_ss->second.getval(result[i].first);
+                i++;
+            }
+        }
+
+        void merge(const AggregateFunctionTSgroupSumData & other)
+        {
+            //if ts has overlap, then aggregate two series by interpolation;
+            AggSeries tmp;
+            tmp.reserve(other.result.size() + result.size());
+            size_t i=0, j=0;
+            Int64 t1, t2;
+            Float64 v1, v2;
+            while (i < result.size() && j < other.result.size())
+            {
+                if (result[i].first < other.result[j].first)
+                {
+                    if (j==0)
+                    {
+                        tmp.emplace_back(result[i]);
+                    }
+                    else
+                    {
+                        t1 = other.result[j].first;
+                        t2 = other.result[j-1].first;
+                        v1 = other.result[j].second;
+                        v2 = other.result[j-1].second;
+                        Float64 value = result[i].second + v2 + (v1 - v2) * (Float64(result[i].first - t2)) / Float64(t1 - t2);
+                        tmp.emplace_back(std::make_pair(result[i].first, value));
+                    }
+                    i++;
+                }
+                else if (result[i].first > other.result[j].first)
+                {
+                    if (i==0)
+                    {
+                        tmp.emplace_back(other.result[j]);
+                    }
+                    else
+                    {
+                        t1 = result[i].first;
+                        t2 = result[i-1].first;
+                        v1 = result[i].second;
+                        v2 = result[i-1].second;
+                        Float64 value = other.result[j].second + v2 + (v1-v2)*(Float64(other.result[j].first-t2))/Float64(t1-t2);
+                        tmp.emplace_back(std::make_pair(other.result[j].first, value));
+                    }
+                    j++;
+                }
+                else
+                {
+                    tmp.emplace_back(std::make_pair(result[i].first, result[i].second + other.result[j].second));
+                    i++;
+                    j++;
+                }
+            }
+            while (i < result.size())
+            {
+                tmp.emplace_back(result[i]);
+                i++;
+            }
+            while (j < other.result.size())
+            {
+                tmp.push_back(other.result[j]);
+                j++;
+            }
+            swap(result, tmp);
+        }
+
+        void serialize(WriteBuffer & buf) const
+        {
+            size_t size = result.size();
+            writeVarUInt(size, buf);
+            buf.write(reinterpret_cast(result.data()), sizeof(result[0]));
+        }
+
+        void deserialize(ReadBuffer & buf)
+        {
+            size_t size = 0;
+            readVarUInt(size, buf);
+            result.resize(size);
+            buf.read(reinterpret_cast(result.data()), size * sizeof(result[0]));
+        }
+    };
+    template
+    class AggregateFunctionTSgroupSum final
+            : public IAggregateFunctionDataHelper, AggregateFunctionTSgroupSum>
+    {
+    private:
+
+    public:
+        String getName() const override
+        {
+            return rate?"TSgroupRateSum":"TSgroupSum";
+        }
+
+        AggregateFunctionTSgroupSum(const DataTypes & arguments)
+            : IAggregateFunctionDataHelper, AggregateFunctionTSgroupSum>(arguments, {})
+        {
+            if (!WhichDataType(arguments[0].get()).isUInt64())
+                throw Exception{"Illegal type " + arguments[0].get()->getName() + " of argument 1 of aggregate function "
+                                + getName() + ", must be UInt64",
+                                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+
+            if (!WhichDataType(arguments[1].get()).isInt64())
+                throw Exception{"Illegal type " + arguments[1].get()->getName() + " of argument 2 of aggregate function "
+                                + getName() + ", must be Int64",
+                                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+
+            if (!WhichDataType(arguments[2].get()).isFloat64())
+                throw Exception{"Illegal type " + arguments[2].get()->getName() + " of argument 3 of aggregate function "
+                                + getName() + ", must be Float64",
+                                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+        }
+
+        DataTypePtr getReturnType() const override
+        {
+            auto datatypes = std::vector();
+            datatypes.push_back(std::make_shared());
+            datatypes.push_back(std::make_shared());
+
+            return std::make_shared(std::make_shared(datatypes));
+        }
+
+        void add(AggregateDataPtr place, const IColumn ** columns, const size_t row_num, Arena *) const override
+        {
+            auto uid = static_cast *>(columns[0])->getData()[row_num];
+            auto ts = static_cast *>(columns[1])->getData()[row_num];
+            auto val = static_cast *>(columns[2])->getData()[row_num];
+            if (uid && ts && val)
+            {
+                this->data(place).add(uid, ts, val);
+            }
+        }
+
+        void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override
+        {
+            this->data(place).merge(this->data(rhs));
+        }
+
+        void serialize(ConstAggregateDataPtr place, WriteBuffer & buf) const override
+        {
+            this->data(place).serialize(buf);
+        }
+
+        void deserialize(AggregateDataPtr place, ReadBuffer & buf, Arena *) const override
+        {
+            this->data(place).deserialize(buf);
+        }
+
+        void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
+        {
+            const auto & value = this->data(place).result;
+            size_t size = value.size();
+
+            ColumnArray & arr_to = static_cast(to);
+            ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
+            size_t old_size = offsets_to.back();
+
+            offsets_to.push_back(offsets_to.back() + size);
+
+            if (size)
+            {
+                typename ColumnInt64::Container & ts_to = static_cast(static_cast(arr_to.getData()).getColumn(0)).getData();
+                typename ColumnFloat64::Container & val_to = static_cast(static_cast(arr_to.getData()).getColumn(1)).getData();
+                ts_to.reserve(old_size + size);
+                val_to.reserve(old_size + size);
+                size_t i = 0;
+                while (i < this->data(place).result.size())
+                {
+                    ts_to.push_back(this->data(place).result[i].first);
+                    val_to.push_back(this->data(place).result[i].second);
+                    i++;
+                }
+            }
+        }
+
+        bool allocatesMemoryInArena() const override
+        {
+            return true;
+        }
+
+        const char * getHeaderFilePath() const override
+        {
+            return __FILE__;
+        }
+    };
+}
diff --git a/dbms/src/AggregateFunctions/registerAggregateFunctions.cpp b/dbms/src/AggregateFunctions/registerAggregateFunctions.cpp
index c93b66240c9..3148a4e726b 100644
--- a/dbms/src/AggregateFunctions/registerAggregateFunctions.cpp
+++ b/dbms/src/AggregateFunctions/registerAggregateFunctions.cpp
@@ -41,7 +41,7 @@ void registerAggregateFunctionCombinatorNull(AggregateFunctionCombinatorFactory
 
 void registerAggregateFunctionHistogram(AggregateFunctionFactory & factory);
 void registerAggregateFunctionRetention(AggregateFunctionFactory & factory);
-
+void registerAggregateFunctionTSgroupSum(AggregateFunctionFactory & factory);
 void registerAggregateFunctions()
 {
     {
@@ -70,6 +70,7 @@ void registerAggregateFunctions()
         registerAggregateFunctionsMaxIntersections(factory);
         registerAggregateFunctionHistogram(factory);
         registerAggregateFunctionRetention(factory);
+        registerAggregateFunctionTSgroupSum(factory);
         registerAggregateFunctionMLMethod(factory);
         registerAggregateFunctionEntropy(factory);
         registerAggregateFunctionLeastSqr(factory);
diff --git a/dbms/tests/queries/0_stateless/00910_aggregation_tsgroupsum.reference b/dbms/tests/queries/0_stateless/00910_aggregation_tsgroupsum.reference
new file mode 100644
index 00000000000..dbcad97e743
--- /dev/null
+++ b/dbms/tests/queries/0_stateless/00910_aggregation_tsgroupsum.reference
@@ -0,0 +1,2 @@
+[(2,0.2),(3,0.8999999999999999),(7,2.0999999999999996),(8,2.4),(12,3.5999999999999996),(17,5.1000000000000005),(18,5.4),(24,7.199999999999999),(25,2.5)]
+[(2,0),(3,0.09999999999999999),(7,0.3),(8,0.30000000000000004),(12,0.29999999999999993),(17,0.30000000000000004),(18,0.30000000000000004),(24,0.29999999999999993),(25,0.1)]
diff --git a/dbms/tests/queries/0_stateless/00910_aggregation_tsgroupsum.sql b/dbms/tests/queries/0_stateless/00910_aggregation_tsgroupsum.sql
new file mode 100644
index 00000000000..b73536dede8
--- /dev/null
+++ b/dbms/tests/queries/0_stateless/00910_aggregation_tsgroupsum.sql
@@ -0,0 +1,10 @@
+drop table if exists tsgroupsum_test;
+
+create table tsgroupsum_test (uid UInt64, ts Int64, value Float64) engine=Memory;
+insert into tsgroupsum_test values (1,2,0.2),(1,7,0.7),(1,12,1.2),(1,17,1.7),(1,25,2.5);
+insert into tsgroupsum_test values (2,3,0.6),(2,8,1.6),(2,12,2.4),(2,18,3.6),(2,24,4.8);
+
+select TSgroupSum(uid, ts, value) from (select * from tsgroupsum_test order by ts asc);
+select TSgroupRateSum(uid, ts, value) from (select * from tsgroupsum_test order by ts asc);
+
+drop table tsgroupsum_test;
diff --git a/docs/en/query_language/agg_functions/reference.md b/docs/en/query_language/agg_functions/reference.md
index 033cea705d3..0536db5a4fb 100644
--- a/docs/en/query_language/agg_functions/reference.md
+++ b/docs/en/query_language/agg_functions/reference.md
@@ -301,6 +301,60 @@ GROUP BY timeslot
 └─────────────────────┴──────────────────────────────────────────────┘
 ```
 
+## TSgroupSum(uid, timestamp, value) {#agg_function-tsgroupsum}
+TSgroupSum can aggregate different time series that sample timestamp not alignment.
+It will use linear interpolation between two sample timestamp and then sum time-series together.
+
+`uid` is the time series unique id, UInt64.
+`timestamp` is Int64 type in order to support millisecond or microsecond.
+`value` is the metric.
+
+Before use this function, timestamp should be in ascend order
+
+Example:
+```
+┌─uid─┬─timestamp─┬─value─┐
+│ 1   │     2     │   0.2 │
+│ 1   │     7     │   0.7 │
+│ 1   │    12     │   1.2 │
+│ 1   │    17     │   1.7 │
+│ 1   │    25     │   2.5 │
+│ 2   │     3     │   0.6 │
+│ 2   │     8     │   1.6 │
+│ 2   │    12     │   2.4 │
+│ 2   │    18     │   3.6 │
+│ 2   │    24     │   4.8 │
+└─────┴───────────┴───────┘
+```
+```
+CREATE TABLE time_series(
+    uid       UInt64,
+    timestamp Int64,
+    value     Float64
+) ENGINE = Memory;
+INSERT INTO time_series VALUES
+    (1,2,0.2),(1,7,0.7),(1,12,1.2),(1,17,1.7),(1,25,2.5),
+    (2,3,0.6),(2,8,1.6),(2,12,2.4),(2,18,3.6),(2,24,4.8);
+
+SELECT TSgroupSum(uid, timestamp, value)
+FROM (
+    SELECT * FROM time_series order by timestamp ASC
+);
+```
+And the result will be:
+```
+[(2,0.2),(3,0.9),(7,2.1),(8,2.4),(12,3.6),(17,5.1),(18,5.4),(24,7.2),(25,2.5)]
+```
+
+## TSgroupRateSum(uid, ts, val) {#agg_function-tsgroupratesum}
+Similarly TSgroupRateSum, TSgroupRateSum will Calculate the rate of time-series and then sum rates together.
+Also, timestamp should be in ascend order before use this function.
+
+Use this function, the result above case will be:
+```
+[(2,0),(3,0.1),(7,0.3),(8,0.3),(12,0.3),(17,0.3),(18,0.3),(24,0.3),(25,0.1)]
+```
+
 ## avg(x) {#agg_function-avg}
 
 Calculates the average.

From 0dd29e7c5b553098f862a5b0c11bcb1a77362e3f Mon Sep 17 00:00:00 2001
From: proller 
Date: Wed, 15 May 2019 19:27:44 +0300
Subject: [PATCH 154/194] clang-format of
 AggregateFunctions/AggregateFunctionTSGroupSum.*

---
 .../AggregateFunctionTSGroupSum.cpp           |  41 +-
 .../AggregateFunctionTSGroupSum.h             | 491 +++++++++---------
 2 files changed, 256 insertions(+), 276 deletions(-)

diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.cpp b/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.cpp
index 0bb586b5151..765e12b86e5 100644
--- a/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.cpp
+++ b/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.cpp
@@ -1,31 +1,30 @@
-#include 
-#include 
-#include 
-#include 
+#include "AggregateFunctionTSGroupSum.h"
+#include "AggregateFunctionFactory.h"
+#include "FactoryHelpers.h"
+#include "Helpers.h"
 
 
 namespace DB
 {
-
-    namespace
+namespace
+{
+    template 
+    AggregateFunctionPtr createAggregateFunctionTSgroupSum(const std::string & name, const DataTypes & arguments, const Array & params)
     {
-        template
-        AggregateFunctionPtr createAggregateFunctionTSgroupSum(const std::string & name, const DataTypes & arguments, const Array & params)
-        {
-            assertNoParameters(name, params);
+        assertNoParameters(name, params);
 
-            if (arguments.size() < 3)
-                throw Exception("Not enough event arguments for aggregate function " + name, ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
+        if (arguments.size() < 3)
+            throw Exception("Not enough event arguments for aggregate function " + name, ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
 
-            return std::make_shared>(arguments);
-        }
-
-    }
-
-    void registerAggregateFunctionTSgroupSum(AggregateFunctionFactory & factory)
-    {
-        factory.registerFunction("TSgroupSum", createAggregateFunctionTSgroupSum, AggregateFunctionFactory::CaseInsensitive);
-        factory.registerFunction("TSgroupRateSum", createAggregateFunctionTSgroupSum, AggregateFunctionFactory::CaseInsensitive);
+        return std::make_shared>(arguments);
     }
 
 }
+
+void registerAggregateFunctionTSgroupSum(AggregateFunctionFactory & factory)
+{
+    factory.registerFunction("TSgroupSum", createAggregateFunctionTSgroupSum, AggregateFunctionFactory::CaseInsensitive);
+    factory.registerFunction("TSgroupRateSum", createAggregateFunctionTSgroupSum, AggregateFunctionFactory::CaseInsensitive);
+}
+
+}
diff --git a/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.h b/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.h
index 1eddeaf18d0..f82e00da8ef 100644
--- a/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.h
+++ b/dbms/src/AggregateFunctions/AggregateFunctionTSGroupSum.h
@@ -1,306 +1,287 @@
 #pragma once
 
+#include 
 #include 
-#include 
 #include 
 #include 
-#include 
+#include 
 #include 
-#include 
+#include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
-#include 
-
-#include 
+#include "IAggregateFunction.h"
 
 
 namespace DB
 {
-    namespace ErrorCodes
+namespace ErrorCodes
+{
+    extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
+    extern const int TOO_MANY_ARGUMENTS_FOR_FUNCTION;
+}
+template 
+struct AggregateFunctionTSgroupSumData
+{
+    using DataPoint = std::pair;
+    struct Points
     {
-        extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
-        extern const int TOO_MANY_ARGUMENTS_FOR_FUNCTION;
-    }
-    template 
-    struct AggregateFunctionTSgroupSumData
-    {
-        using DataPoint = std::pair;
-        struct Points
+        using Dps = std::queue;
+        Dps dps;
+        void add(Int64 t, Float64 v)
         {
-            using Dps = std::queue;
-            Dps dps;
-            void add(Int64 t, Float64 v)
-            {
-                dps.push(std::make_pair(t, v));
-                if (dps.size() > 2)
-                    dps.pop();
-            }
-            Float64 getval(Int64 t)
-            {
-                Int64 t1, t2;
-                Float64 v1, v2;
-                if (rate)
-                {
-                    if (dps.size() < 2)
-                        return 0;
-                    t1 = dps.back().first;
-                    t2 = dps.front().first;
-                    v1 = dps.back().second;
-                    v2 = dps.front().second;
-                    return (v1-v2)/Float64(t1-t2);
-                }
-                else
-                {
-                    if (dps.size() == 1 && t == dps.front().first)
-                        return dps.front().second;
-                    t1 = dps.back().first;
-                    t2 = dps.front().first;
-                    v1 = dps.back().second;
-                    v2 = dps.front().second;
-                    return v2 + ((v1-v2)*Float64(t-t2))/Float64(t1-t2);
-                }
-            }
-        };
-
-        static constexpr size_t bytes_on_stack = 128;
-        typedef std::map Series;
-        typedef PODArray, bytes_on_stack>> AggSeries;
-        Series ss;
-        AggSeries result;
-
-        void add(UInt64 uid, Int64 t, Float64 v)
-        {//suppose t is coming asc
-            typename Series::iterator it_ss;
-            if (ss.count(uid) == 0)
-            {//time series not exist, insert new one
-                Points tmp;
-                tmp.add(t, v);
-                ss.emplace(uid, tmp);
-                it_ss = ss.find(uid);
-            }
-            else
-           {
-                it_ss = ss.find(uid);
-                it_ss->second.add(t, v);
-            }
-            if (result.size() > 0 && t < result.back().first)
-                throw Exception{"TSgroupSum or TSgroupRateSum must order by timestamp asc!!!", ErrorCodes::LOGICAL_ERROR};
-            if (result.size() > 0 && t == result.back().first)
-            {
-                //do not add new point
-                if (rate)
-                    result.back().second += it_ss->second.getval(t);
-                else
-                    result.back().second += v;
-            }
-            else
-            {
-
-                if (rate)
-                    result.emplace_back(std::make_pair(t, it_ss->second.getval(t)));
-                else
-                    result.emplace_back(std::make_pair(t,v));
-            }
-            size_t i = result.size() - 1;
-            //reverse find out the index of timestamp that more than previous timestamp of t
-            while (result[i].first > it_ss->second.dps.front().first && i >= 0)
-                i--;
-
-            i++;
-            while (i < result.size()-1)
-            {
-                result[i].second += it_ss->second.getval(result[i].first);
-                i++;
-            }
+            dps.push(std::make_pair(t, v));
+            if (dps.size() > 2)
+                dps.pop();
         }
-
-        void merge(const AggregateFunctionTSgroupSumData & other)
+        Float64 getval(Int64 t)
         {
-            //if ts has overlap, then aggregate two series by interpolation;
-            AggSeries tmp;
-            tmp.reserve(other.result.size() + result.size());
-            size_t i=0, j=0;
             Int64 t1, t2;
             Float64 v1, v2;
-            while (i < result.size() && j < other.result.size())
+            if (rate)
             {
-                if (result[i].first < other.result[j].first)
+                if (dps.size() < 2)
+                    return 0;
+                t1 = dps.back().first;
+                t2 = dps.front().first;
+                v1 = dps.back().second;
+                v2 = dps.front().second;
+                return (v1 - v2) / Float64(t1 - t2);
+            }
+            else
+            {
+                if (dps.size() == 1 && t == dps.front().first)
+                    return dps.front().second;
+                t1 = dps.back().first;
+                t2 = dps.front().first;
+                v1 = dps.back().second;
+                v2 = dps.front().second;
+                return v2 + ((v1 - v2) * Float64(t - t2)) / Float64(t1 - t2);
+            }
+        }
+    };
+
+    static constexpr size_t bytes_on_stack = 128;
+    typedef std::map Series;
+    typedef PODArray, bytes_on_stack>> AggSeries;
+    Series ss;
+    AggSeries result;
+
+    void add(UInt64 uid, Int64 t, Float64 v)
+    { //suppose t is coming asc
+        typename Series::iterator it_ss;
+        if (ss.count(uid) == 0)
+        { //time series not exist, insert new one
+            Points tmp;
+            tmp.add(t, v);
+            ss.emplace(uid, tmp);
+            it_ss = ss.find(uid);
+        }
+        else
+        {
+            it_ss = ss.find(uid);
+            it_ss->second.add(t, v);
+        }
+        if (result.size() > 0 && t < result.back().first)
+            throw Exception{"TSgroupSum or TSgroupRateSum must order by timestamp asc!!!", ErrorCodes::LOGICAL_ERROR};
+        if (result.size() > 0 && t == result.back().first)
+        {
+            //do not add new point
+            if (rate)
+                result.back().second += it_ss->second.getval(t);
+            else
+                result.back().second += v;
+        }
+        else
+        {
+            if (rate)
+                result.emplace_back(std::make_pair(t, it_ss->second.getval(t)));
+            else
+                result.emplace_back(std::make_pair(t, v));
+        }
+        size_t i = result.size() - 1;
+        //reverse find out the index of timestamp that more than previous timestamp of t
+        while (result[i].first > it_ss->second.dps.front().first && i >= 0)
+            i--;
+
+        i++;
+        while (i < result.size() - 1)
+        {
+            result[i].second += it_ss->second.getval(result[i].first);
+            i++;
+        }
+    }
+
+    void merge(const AggregateFunctionTSgroupSumData & other)
+    {
+        //if ts has overlap, then aggregate two series by interpolation;
+        AggSeries tmp;
+        tmp.reserve(other.result.size() + result.size());
+        size_t i = 0, j = 0;
+        Int64 t1, t2;
+        Float64 v1, v2;
+        while (i < result.size() && j < other.result.size())
+        {
+            if (result[i].first < other.result[j].first)
+            {
+                if (j == 0)
                 {
-                    if (j==0)
-                    {
-                        tmp.emplace_back(result[i]);
-                    }
-                    else
-                    {
-                        t1 = other.result[j].first;
-                        t2 = other.result[j-1].first;
-                        v1 = other.result[j].second;
-                        v2 = other.result[j-1].second;
-                        Float64 value = result[i].second + v2 + (v1 - v2) * (Float64(result[i].first - t2)) / Float64(t1 - t2);
-                        tmp.emplace_back(std::make_pair(result[i].first, value));
-                    }
-                    i++;
-                }
-                else if (result[i].first > other.result[j].first)
-                {
-                    if (i==0)
-                    {
-                        tmp.emplace_back(other.result[j]);
-                    }
-                    else
-                    {
-                        t1 = result[i].first;
-                        t2 = result[i-1].first;
-                        v1 = result[i].second;
-                        v2 = result[i-1].second;
-                        Float64 value = other.result[j].second + v2 + (v1-v2)*(Float64(other.result[j].first-t2))/Float64(t1-t2);
-                        tmp.emplace_back(std::make_pair(other.result[j].first, value));
-                    }
-                    j++;
+                    tmp.emplace_back(result[i]);
                 }
                 else
                 {
-                    tmp.emplace_back(std::make_pair(result[i].first, result[i].second + other.result[j].second));
-                    i++;
-                    j++;
+                    t1 = other.result[j].first;
+                    t2 = other.result[j - 1].first;
+                    v1 = other.result[j].second;
+                    v2 = other.result[j - 1].second;
+                    Float64 value = result[i].second + v2 + (v1 - v2) * (Float64(result[i].first - t2)) / Float64(t1 - t2);
+                    tmp.emplace_back(std::make_pair(result[i].first, value));
                 }
-            }
-            while (i < result.size())
-            {
-                tmp.emplace_back(result[i]);
                 i++;
             }
-            while (j < other.result.size())
+            else if (result[i].first > other.result[j].first)
             {
-                tmp.push_back(other.result[j]);
+                if (i == 0)
+                {
+                    tmp.emplace_back(other.result[j]);
+                }
+                else
+                {
+                    t1 = result[i].first;
+                    t2 = result[i - 1].first;
+                    v1 = result[i].second;
+                    v2 = result[i - 1].second;
+                    Float64 value = other.result[j].second + v2 + (v1 - v2) * (Float64(other.result[j].first - t2)) / Float64(t1 - t2);
+                    tmp.emplace_back(std::make_pair(other.result[j].first, value));
+                }
+                j++;
+            }
+            else
+            {
+                tmp.emplace_back(std::make_pair(result[i].first, result[i].second + other.result[j].second));
+                i++;
                 j++;
             }
-            swap(result, tmp);
         }
-
-        void serialize(WriteBuffer & buf) const
+        while (i < result.size())
         {
-            size_t size = result.size();
-            writeVarUInt(size, buf);
-            buf.write(reinterpret_cast(result.data()), sizeof(result[0]));
+            tmp.emplace_back(result[i]);
+            i++;
         }
-
-        void deserialize(ReadBuffer & buf)
+        while (j < other.result.size())
         {
-            size_t size = 0;
-            readVarUInt(size, buf);
-            result.resize(size);
-            buf.read(reinterpret_cast(result.data()), size * sizeof(result[0]));
+            tmp.push_back(other.result[j]);
+            j++;
         }
-    };
-    template
-    class AggregateFunctionTSgroupSum final
-            : public IAggregateFunctionDataHelper, AggregateFunctionTSgroupSum>
+        swap(result, tmp);
+    }
+
+    void serialize(WriteBuffer & buf) const
     {
-    private:
+        size_t size = result.size();
+        writeVarUInt(size, buf);
+        buf.write(reinterpret_cast(result.data()), sizeof(result[0]));
+    }
 
-    public:
-        String getName() const override
+    void deserialize(ReadBuffer & buf)
+    {
+        size_t size = 0;
+        readVarUInt(size, buf);
+        result.resize(size);
+        buf.read(reinterpret_cast(result.data()), size * sizeof(result[0]));
+    }
+};
+template 
+class AggregateFunctionTSgroupSum final
+    : public IAggregateFunctionDataHelper, AggregateFunctionTSgroupSum>
+{
+private:
+public:
+    String getName() const override { return rate ? "TSgroupRateSum" : "TSgroupSum"; }
+
+    AggregateFunctionTSgroupSum(const DataTypes & arguments)
+        : IAggregateFunctionDataHelper, AggregateFunctionTSgroupSum>(arguments, {})
+    {
+        if (!WhichDataType(arguments[0].get()).isUInt64())
+            throw Exception{"Illegal type " + arguments[0].get()->getName() + " of argument 1 of aggregate function " + getName()
+                                + ", must be UInt64",
+                            ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+
+        if (!WhichDataType(arguments[1].get()).isInt64())
+            throw Exception{"Illegal type " + arguments[1].get()->getName() + " of argument 2 of aggregate function " + getName()
+                                + ", must be Int64",
+                            ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+
+        if (!WhichDataType(arguments[2].get()).isFloat64())
+            throw Exception{"Illegal type " + arguments[2].get()->getName() + " of argument 3 of aggregate function " + getName()
+                                + ", must be Float64",
+                            ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+    }
+
+    DataTypePtr getReturnType() const override
+    {
+        auto datatypes = std::vector();
+        datatypes.push_back(std::make_shared());
+        datatypes.push_back(std::make_shared());
+
+        return std::make_shared(std::make_shared(datatypes));
+    }
+
+    void add(AggregateDataPtr place, const IColumn ** columns, const size_t row_num, Arena *) const override
+    {
+        auto uid = static_cast *>(columns[0])->getData()[row_num];
+        auto ts = static_cast *>(columns[1])->getData()[row_num];
+        auto val = static_cast *>(columns[2])->getData()[row_num];
+        if (uid && ts && val)
         {
-            return rate?"TSgroupRateSum":"TSgroupSum";
+            this->data(place).add(uid, ts, val);
         }
+    }
 
-        AggregateFunctionTSgroupSum(const DataTypes & arguments)
-            : IAggregateFunctionDataHelper, AggregateFunctionTSgroupSum>(arguments, {})
+    void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override { this->data(place).merge(this->data(rhs)); }
+
+    void serialize(ConstAggregateDataPtr place, WriteBuffer & buf) const override { this->data(place).serialize(buf); }
+
+    void deserialize(AggregateDataPtr place, ReadBuffer & buf, Arena *) const override { this->data(place).deserialize(buf); }
+
+    void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
+    {
+        const auto & value = this->data(place).result;
+        size_t size = value.size();
+
+        ColumnArray & arr_to = static_cast(to);
+        ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
+        size_t old_size = offsets_to.back();
+
+        offsets_to.push_back(offsets_to.back() + size);
+
+        if (size)
         {
-            if (!WhichDataType(arguments[0].get()).isUInt64())
-                throw Exception{"Illegal type " + arguments[0].get()->getName() + " of argument 1 of aggregate function "
-                                + getName() + ", must be UInt64",
-                                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
-
-            if (!WhichDataType(arguments[1].get()).isInt64())
-                throw Exception{"Illegal type " + arguments[1].get()->getName() + " of argument 2 of aggregate function "
-                                + getName() + ", must be Int64",
-                                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
-
-            if (!WhichDataType(arguments[2].get()).isFloat64())
-                throw Exception{"Illegal type " + arguments[2].get()->getName() + " of argument 3 of aggregate function "
-                                + getName() + ", must be Float64",
-                                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
-        }
-
-        DataTypePtr getReturnType() const override
-        {
-            auto datatypes = std::vector();
-            datatypes.push_back(std::make_shared());
-            datatypes.push_back(std::make_shared());
-
-            return std::make_shared(std::make_shared(datatypes));
-        }
-
-        void add(AggregateDataPtr place, const IColumn ** columns, const size_t row_num, Arena *) const override
-        {
-            auto uid = static_cast *>(columns[0])->getData()[row_num];
-            auto ts = static_cast *>(columns[1])->getData()[row_num];
-            auto val = static_cast *>(columns[2])->getData()[row_num];
-            if (uid && ts && val)
+            typename ColumnInt64::Container & ts_to
+                = static_cast(static_cast(arr_to.getData()).getColumn(0)).getData();
+            typename ColumnFloat64::Container & val_to
+                = static_cast(static_cast(arr_to.getData()).getColumn(1)).getData();
+            ts_to.reserve(old_size + size);
+            val_to.reserve(old_size + size);
+            size_t i = 0;
+            while (i < this->data(place).result.size())
             {
-                this->data(place).add(uid, ts, val);
+                ts_to.push_back(this->data(place).result[i].first);
+                val_to.push_back(this->data(place).result[i].second);
+                i++;
             }
         }
+    }
 
-        void merge(AggregateDataPtr place, ConstAggregateDataPtr rhs, Arena *) const override
-        {
-            this->data(place).merge(this->data(rhs));
-        }
+    bool allocatesMemoryInArena() const override { return true; }
 
-        void serialize(ConstAggregateDataPtr place, WriteBuffer & buf) const override
-        {
-            this->data(place).serialize(buf);
-        }
-
-        void deserialize(AggregateDataPtr place, ReadBuffer & buf, Arena *) const override
-        {
-            this->data(place).deserialize(buf);
-        }
-
-        void insertResultInto(ConstAggregateDataPtr place, IColumn & to) const override
-        {
-            const auto & value = this->data(place).result;
-            size_t size = value.size();
-
-            ColumnArray & arr_to = static_cast(to);
-            ColumnArray::Offsets & offsets_to = arr_to.getOffsets();
-            size_t old_size = offsets_to.back();
-
-            offsets_to.push_back(offsets_to.back() + size);
-
-            if (size)
-            {
-                typename ColumnInt64::Container & ts_to = static_cast(static_cast(arr_to.getData()).getColumn(0)).getData();
-                typename ColumnFloat64::Container & val_to = static_cast(static_cast(arr_to.getData()).getColumn(1)).getData();
-                ts_to.reserve(old_size + size);
-                val_to.reserve(old_size + size);
-                size_t i = 0;
-                while (i < this->data(place).result.size())
-                {
-                    ts_to.push_back(this->data(place).result[i].first);
-                    val_to.push_back(this->data(place).result[i].second);
-                    i++;
-                }
-            }
-        }
-
-        bool allocatesMemoryInArena() const override
-        {
-            return true;
-        }
-
-        const char * getHeaderFilePath() const override
-        {
-            return __FILE__;
-        }
-    };
+    const char * getHeaderFilePath() const override { return __FILE__; }
+};
 }

From d477cc0df4462123fc16be211e703ce3d50a8235 Mon Sep 17 00:00:00 2001
From: alesapin 
Date: Wed, 15 May 2019 19:44:25 +0300
Subject: [PATCH 155/194] Fix incorrect performance tests

---
 dbms/tests/performance/array_join.xml                 | 2 +-
 dbms/tests/performance/consistent_hashes.xml          | 4 ++--
 dbms/tests/performance/cryptographic_hashes.xml       | 2 +-
 dbms/tests/performance/funtions_geo/functions_geo.xml | 4 ++--
 dbms/tests/performance/general_purpose_hashes.xml     | 2 +-
 dbms/tests/performance/simple_join_query.xml          | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/dbms/tests/performance/array_join.xml b/dbms/tests/performance/array_join.xml
index fb3fa234c84..a465b3372e2 100644
--- a/dbms/tests/performance/array_join.xml
+++ b/dbms/tests/performance/array_join.xml
@@ -4,7 +4,7 @@
 
     
         
-            1000
+            5000
             10000
         
     
diff --git a/dbms/tests/performance/consistent_hashes.xml b/dbms/tests/performance/consistent_hashes.xml
index 216a166ba34..4b46b7b0daa 100644
--- a/dbms/tests/performance/consistent_hashes.xml
+++ b/dbms/tests/performance/consistent_hashes.xml
@@ -32,6 +32,6 @@
        
     
 
-    SELECT {hash_func}(number, {buckets}) FROM system.numbers LIMIT 1000000000
-    SELECT sumburConsistentHash(toUInt32(number), {buckets}) FROM system.numbers LIMIT 10000
+    SELECT {hash_func}(number, {buckets}) FROM system.numbers
+    SELECT sumburConsistentHash(toUInt32(number), {buckets}) FROM system.numbers
 
diff --git a/dbms/tests/performance/cryptographic_hashes.xml b/dbms/tests/performance/cryptographic_hashes.xml
index 5dffe4e0cec..8cd4e0ebb60 100644
--- a/dbms/tests/performance/cryptographic_hashes.xml
+++ b/dbms/tests/performance/cryptographic_hashes.xml
@@ -46,5 +46,5 @@
         
     
 
-    SELECT ignore({crypto_hash_func}({string})) FROM system.{table} LIMIT 10000000
+    SELECT ignore({crypto_hash_func}({string})) FROM system.{table}
 
diff --git a/dbms/tests/performance/funtions_geo/functions_geo.xml b/dbms/tests/performance/funtions_geo/functions_geo.xml
index b1ea38be447..92dd88728ca 100644
--- a/dbms/tests/performance/funtions_geo/functions_geo.xml
+++ b/dbms/tests/performance/funtions_geo/functions_geo.xml
@@ -4,8 +4,8 @@
 
     
         
-            300
-            1000
+            1000
+            5000
         
     
 
diff --git a/dbms/tests/performance/general_purpose_hashes.xml b/dbms/tests/performance/general_purpose_hashes.xml
index 3469fcc4969..c8543a2116c 100644
--- a/dbms/tests/performance/general_purpose_hashes.xml
+++ b/dbms/tests/performance/general_purpose_hashes.xml
@@ -51,5 +51,5 @@
         
     
 
-    SELECT ignore({gp_hash_func}({string})) FROM system.{table} LIMIT 10000000
+    SELECT ignore({gp_hash_func}({string})) FROM system.{table}
 
diff --git a/dbms/tests/performance/simple_join_query.xml b/dbms/tests/performance/simple_join_query.xml
index aef37bb0320..a3b7f91c117 100644
--- a/dbms/tests/performance/simple_join_query.xml
+++ b/dbms/tests/performance/simple_join_query.xml
@@ -1,7 +1,7 @@
 
     Simple Join Query
 
-    once
+    loop
 
     
         

From 51ca4cbaa404e9fd2c8b1a2003feacb8f0d4bcf4 Mon Sep 17 00:00:00 2001
From: proller 
Date: Wed, 15 May 2019 20:19:39 +0300
Subject: [PATCH 156/194] Build fixes (#5278)

---
 CMakeLists.txt                                |  2 +-
 cmake/find_boost.cmake                        | 13 +++++----
 cmake/find_libgsasl.cmake                     |  6 +++-
 cmake/find_rdkafka.cmake                      |  2 +-
 cmake/find_re2.cmake                          |  8 ++++++
 cmake/find_simdjson.cmake                     |  4 +--
 cmake/find_zlib.cmake                         | 28 ++++++++++++-------
 cmake/find_zstd.cmake                         | 13 +++++----
 contrib/librdkafka-cmake/CMakeLists.txt       |  2 +-
 contrib/simdjson-cmake/CMakeLists.txt         | 14 ++--------
 dbms/CMakeLists.txt                           | 17 +++++++++--
 dbms/src/Compression/CMakeLists.txt           |  8 ++++--
 dbms/src/Functions/CMakeLists.txt             | 15 +++++-----
 ...StorageSystemBuildOptions.generated.cpp.in |  6 ++--
 debian/pbuilder-hooks/A00ccache               |  3 +-
 docker/packager/binary/build.sh               |  5 ++--
 docker/packager/deb/build.sh                  |  5 ++--
 libs/libcommon/CMakeLists.txt                 | 10 +++++--
 libs/libcommon/cmake/find_cctz.cmake          | 12 ++++----
 utils/compressor/CMakeLists.txt               |  7 +++--
 20 files changed, 113 insertions(+), 67 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43cc5f802e5..168fdf7e28d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -310,6 +310,7 @@ include (cmake/find_rt.cmake)
 include (cmake/find_execinfo.cmake)
 include (cmake/find_readline_edit.cmake)
 include (cmake/find_re2.cmake)
+include (cmake/find_libgsasl.cmake)
 include (cmake/find_rdkafka.cmake)
 include (cmake/find_capnp.cmake)
 include (cmake/find_llvm.cmake)
@@ -317,7 +318,6 @@ include (cmake/find_cpuid.cmake) # Freebsd, bundled
 if (NOT USE_CPUID)
     include (cmake/find_cpuinfo.cmake) # Debian
 endif()
-include (cmake/find_libgsasl.cmake)
 include (cmake/find_libxml2.cmake)
 include (cmake/find_brotli.cmake)
 include (cmake/find_protobuf.cmake)
diff --git a/cmake/find_boost.cmake b/cmake/find_boost.cmake
index b37782556d1..6776d0cea06 100644
--- a/cmake/find_boost.cmake
+++ b/cmake/find_boost.cmake
@@ -1,9 +1,12 @@
 option (USE_INTERNAL_BOOST_LIBRARY "Set to FALSE to use system boost library instead of bundled" ${NOT_UNBUNDLED})
 
 # Test random file existing in all package variants
-if (USE_INTERNAL_BOOST_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/boost/libs/system/src/error_code.cpp")
-   message (WARNING "submodules in contrib/boost is missing. to fix try run: \n git submodule update --init --recursive")
-   set (USE_INTERNAL_BOOST_LIBRARY 0)
+if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/boost/libs/system/src/error_code.cpp")
+    if(USE_INTERNAL_BOOST_LIBRARY)
+        message(WARNING "submodules in contrib/boost is missing. to fix try run: \n git submodule update --init --recursive")
+    endif()
+    set (USE_INTERNAL_BOOST_LIBRARY 0)
+    set (MISSING_INTERNAL_BOOST_LIBRARY 1)
 endif ()
 
 if (NOT USE_INTERNAL_BOOST_LIBRARY)
@@ -21,10 +24,9 @@ if (NOT USE_INTERNAL_BOOST_LIBRARY)
         set (Boost_INCLUDE_DIRS "")
         set (Boost_SYSTEM_LIBRARY "")
     endif ()
-
 endif ()
 
-if (NOT Boost_SYSTEM_LIBRARY)
+if (NOT Boost_SYSTEM_LIBRARY AND NOT MISSING_INTERNAL_BOOST_LIBRARY)
     set (USE_INTERNAL_BOOST_LIBRARY 1)
     set (Boost_SYSTEM_LIBRARY boost_system_internal)
     set (Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options_internal)
@@ -44,7 +46,6 @@ if (NOT Boost_SYSTEM_LIBRARY)
 
     # For packaged version:
     list (APPEND Boost_INCLUDE_DIRS "${ClickHouse_SOURCE_DIR}/contrib/boost")
-
 endif ()
 
 message (STATUS "Using Boost: ${Boost_INCLUDE_DIRS} : ${Boost_PROGRAM_OPTIONS_LIBRARY},${Boost_SYSTEM_LIBRARY},${Boost_FILESYSTEM_LIBRARY},${Boost_REGEX_LIBRARY}")
diff --git a/cmake/find_libgsasl.cmake b/cmake/find_libgsasl.cmake
index ef1bbefe0df..729401292db 100644
--- a/cmake/find_libgsasl.cmake
+++ b/cmake/find_libgsasl.cmake
@@ -22,4 +22,8 @@ elseif (NOT MISSING_INTERNAL_LIBGSASL_LIBRARY AND NOT APPLE AND NOT ARCH_32)
     set (LIBGSASL_LIBRARY libgsasl)
 endif ()
 
-message (STATUS "Using libgsasl: ${LIBGSASL_INCLUDE_DIR} : ${LIBGSASL_LIBRARY}")
+if(LIBGSASL_LIBRARY AND LIBGSASL_INCLUDE_DIR)
+    set (USE_LIBGSASL 1)
+endif()
+
+message (STATUS "Using libgsasl=${USE_LIBGSASL}: ${LIBGSASL_INCLUDE_DIR} : ${LIBGSASL_LIBRARY}")
diff --git a/cmake/find_rdkafka.cmake b/cmake/find_rdkafka.cmake
index 3363c657f91..8469969cf62 100644
--- a/cmake/find_rdkafka.cmake
+++ b/cmake/find_rdkafka.cmake
@@ -10,7 +10,7 @@ endif ()
 
 if (ENABLE_RDKAFKA)
 
-if (OS_LINUX AND NOT ARCH_ARM)
+if (OS_LINUX AND NOT ARCH_ARM AND USE_LIBGSASL)
     option (USE_INTERNAL_RDKAFKA_LIBRARY "Set to FALSE to use system librdkafka instead of the bundled" ${NOT_UNBUNDLED})
 endif ()
 
diff --git a/cmake/find_re2.cmake b/cmake/find_re2.cmake
index c0136a6cc21..05ba80f143f 100644
--- a/cmake/find_re2.cmake
+++ b/cmake/find_re2.cmake
@@ -1,5 +1,13 @@
 option (USE_INTERNAL_RE2_LIBRARY "Set to FALSE to use system re2 library instead of bundled [slower]" ${NOT_UNBUNDLED})
 
+if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/re2/CMakeLists.txt")
+    if(USE_INTERNAL_RE2_LIBRARY)
+        message(WARNING "submodule contrib/re2 is missing. to fix try run: \n git submodule update --init --recursive")
+    endif()
+    set(USE_INTERNAL_RE2_LIBRARY 0)
+    set(MISSING_INTERNAL_RE2_LIBRARY 1)
+endif()
+
 if (NOT USE_INTERNAL_RE2_LIBRARY)
     find_library (RE2_LIBRARY re2)
     find_path (RE2_INCLUDE_DIR NAMES re2/re2.h PATHS ${RE2_INCLUDE_PATHS})
diff --git a/cmake/find_simdjson.cmake b/cmake/find_simdjson.cmake
index 2c6f233a6ad..a556fa5f2b2 100644
--- a/cmake/find_simdjson.cmake
+++ b/cmake/find_simdjson.cmake
@@ -9,6 +9,6 @@ if (NOT HAVE_AVX2)
 endif ()
 
 option (USE_SIMDJSON "Use simdjson" ON)
-
-set (SIMDJSON_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/simdjson/include")
 set (SIMDJSON_LIBRARY "simdjson")
+
+message(STATUS "Using simdjson=${USE_SIMDJSON}: ${SIMDJSON_LIBRARY}")
diff --git a/cmake/find_zlib.cmake b/cmake/find_zlib.cmake
index fb6b8c7971d..42cfce871d7 100644
--- a/cmake/find_zlib.cmake
+++ b/cmake/find_zlib.cmake
@@ -2,20 +2,28 @@ if (NOT OS_FREEBSD AND NOT ARCH_32)
     option (USE_INTERNAL_ZLIB_LIBRARY "Set to FALSE to use system zlib library instead of bundled" ${NOT_UNBUNDLED})
 endif ()
 
+if (NOT MSVC)
+    set (INTERNAL_ZLIB_NAME "zlib-ng" CACHE INTERNAL "")
+else ()
+    set (INTERNAL_ZLIB_NAME "zlib" CACHE INTERNAL "")
+    if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}")
+        message (WARNING "Will use standard zlib, please clone manually:\n git clone https://github.com/madler/zlib.git ${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}")
+    endif ()
+endif ()
+
+if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}/zlib.h")
+    if(USE_INTERNAL_ZLIB_LIBRARY)
+        message(WARNING "submodule contrib/${INTERNAL_ZLIB_NAME} is missing. to fix try run: \n git submodule update --init --recursive")
+    endif()
+    set(USE_INTERNAL_ZLIB_LIBRARY 0)
+    set(MISSING_INTERNAL_ZLIB_LIBRARY 1)
+endif()
+
 if (NOT USE_INTERNAL_ZLIB_LIBRARY)
     find_package (ZLIB)
 endif ()
 
-if (NOT ZLIB_FOUND)
-    if (NOT MSVC)
-        set (INTERNAL_ZLIB_NAME "zlib-ng" CACHE INTERNAL "")
-    else ()
-        set (INTERNAL_ZLIB_NAME "zlib" CACHE INTERNAL "")
-        if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}")
-            message (WARNING "Will use standard zlib, please clone manually:\n git clone https://github.com/madler/zlib.git ${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}")
-        endif ()
-    endif ()
-
+if (NOT ZLIB_FOUND AND NOT MISSING_INTERNAL_ZLIB_LIBRARY)
     set (USE_INTERNAL_ZLIB_LIBRARY 1)
     set (ZLIB_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/${INTERNAL_ZLIB_NAME}" "${ClickHouse_BINARY_DIR}/contrib/${INTERNAL_ZLIB_NAME}" CACHE INTERNAL "") # generated zconf.h
     set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) # for poco
diff --git a/cmake/find_zstd.cmake b/cmake/find_zstd.cmake
index 24bc851ed57..e4f32d4b170 100644
--- a/cmake/find_zstd.cmake
+++ b/cmake/find_zstd.cmake
@@ -1,9 +1,12 @@
 option (USE_INTERNAL_ZSTD_LIBRARY "Set to FALSE to use system zstd library instead of bundled" ${NOT_UNBUNDLED})
 
-if (USE_INTERNAL_ZSTD_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/zstd/lib/zstd.h")
-   message (WARNING "submodule contrib/zstd is missing. to fix try run: \n git submodule update --init --recursive")
-   set (USE_INTERNAL_ZSTD_LIBRARY 0)
-endif ()
+if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/zstd/lib/zstd.h")
+    if(USE_INTERNAL_ZSTD_LIBRARY)
+        message(WARNING "submodule contrib/zstd is missing. to fix try run: \n git submodule update --init --recursive")
+    endif()
+    set(USE_INTERNAL_ZSTD_LIBRARY 0)
+    set(MISSING_INTERNAL_ZSTD_LIBRARY 1)
+endif()
 
 if (NOT USE_INTERNAL_ZSTD_LIBRARY)
     find_library (ZSTD_LIBRARY zstd)
@@ -11,7 +14,7 @@ if (NOT USE_INTERNAL_ZSTD_LIBRARY)
 endif ()
 
 if (ZSTD_LIBRARY AND ZSTD_INCLUDE_DIR)
-else ()
+elseif (NOT MISSING_INTERNAL_ZSTD_LIBRARY)
     set (USE_INTERNAL_ZSTD_LIBRARY 1)
     set (ZSTD_LIBRARY zstd)
     set (ZSTD_INCLUDE_DIR ${ClickHouse_SOURCE_DIR}/contrib/zstd/lib)
diff --git a/contrib/librdkafka-cmake/CMakeLists.txt b/contrib/librdkafka-cmake/CMakeLists.txt
index 2807f42df93..3c9c17b1796 100644
--- a/contrib/librdkafka-cmake/CMakeLists.txt
+++ b/contrib/librdkafka-cmake/CMakeLists.txt
@@ -59,7 +59,7 @@ add_library(rdkafka ${SRCS})
 target_include_directories(rdkafka SYSTEM PUBLIC include)
 target_include_directories(rdkafka SYSTEM PUBLIC ${RDKAFKA_SOURCE_DIR})         # Because weird logic with "include_next" is used.
 target_include_directories(rdkafka SYSTEM PRIVATE ${ZSTD_INCLUDE_DIR}/common)   # Because wrong path to "zstd_errors.h" is used.
-target_link_libraries(rdkafka PUBLIC ${ZLIB_LIBRARIES} ${ZSTD_LIBRARY} ${LZ4_LIBRARY} libgsasl)
+target_link_libraries(rdkafka PUBLIC ${ZLIB_LIBRARIES} ${ZSTD_LIBRARY} ${LZ4_LIBRARY} ${LIBGSASL_LIBRARY})
 if(OPENSSL_SSL_LIBRARY AND OPENSSL_CRYPTO_LIBRARY)
     target_link_libraries(rdkafka PUBLIC ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
 endif()
diff --git a/contrib/simdjson-cmake/CMakeLists.txt b/contrib/simdjson-cmake/CMakeLists.txt
index 3788745bf92..16a5dc1a791 100644
--- a/contrib/simdjson-cmake/CMakeLists.txt
+++ b/contrib/simdjson-cmake/CMakeLists.txt
@@ -1,15 +1,7 @@
 if (NOT HAVE_AVX2)
     message (FATAL_ERROR "No AVX2 support")
 endif ()
-
-if(MAKE_STATIC_LIBRARIES)
-    set(SIMDJSON_LIB_TYPE STATIC)
-    MESSAGE(STATUS "Building static library ${SIMDJSON_LIBRARY}")
-else()
-    set(SIMDJSON_LIB_TYPE SHARED)
-    MESSAGE(STATUS "Building dynamic library ${SIMDJSON_LIBRARY}")
-endif()
-
+set(SIMDJSON_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/simdjson/include")
 set(SIMDJSON_SRC_DIR "${SIMDJSON_INCLUDE_DIR}/../src")
 set(SIMDJSON_SRC
     ${SIMDJSON_SRC_DIR}/jsonioutil.cpp
@@ -21,6 +13,6 @@ set(SIMDJSON_SRC
     ${SIMDJSON_SRC_DIR}/parsedjsoniterator.cpp
 )
 
-add_library(${SIMDJSON_LIBRARY} ${SIMDJSON_LIB_TYPE} ${SIMDJSON_SRC})
-target_include_directories(${SIMDJSON_LIBRARY} PRIVATE "${SIMDJSON_INCLUDE_DIR}")
+add_library(${SIMDJSON_LIBRARY} ${SIMDJSON_SRC})
+target_include_directories(${SIMDJSON_LIBRARY} PUBLIC "${SIMDJSON_INCLUDE_DIR}")
 target_compile_options(${SIMDJSON_LIBRARY} PRIVATE -mavx2 -mbmi -mbmi2 -mpclmul)
diff --git a/dbms/CMakeLists.txt b/dbms/CMakeLists.txt
index 615dc666500..d0ca68543f0 100644
--- a/dbms/CMakeLists.txt
+++ b/dbms/CMakeLists.txt
@@ -189,8 +189,17 @@ target_link_libraries (clickhouse_common_io
     ${Poco_Net_LIBRARY}
     ${Poco_Util_LIBRARY}
     ${Poco_Foundation_LIBRARY}
-    ${RE2_LIBRARY}
-    ${RE2_ST_LIBRARY}
+)
+
+if(RE2_LIBRARY)
+    target_link_libraries(clickhouse_common_io PUBLIC ${RE2_LIBRARY})
+endif()
+if(RE2_ST_LIBRARY)
+    target_link_libraries(clickhouse_common_io PUBLIC ${RE2_ST_LIBRARY})
+endif()
+
+target_link_libraries(clickhouse_common_io
+        PUBLIC
     ${CITYHASH_LIBRARIES}
         PRIVATE
     ${ZLIB_LIBRARIES}
@@ -208,7 +217,9 @@ target_link_libraries (clickhouse_common_io
 )
 
 
-target_include_directories(clickhouse_common_io SYSTEM BEFORE PUBLIC ${RE2_INCLUDE_DIR})
+if(RE2_INCLUDE_DIR)
+    target_include_directories(clickhouse_common_io SYSTEM BEFORE PUBLIC ${RE2_INCLUDE_DIR})
+endif()
 
 if (USE_LFALLOC)
     target_include_directories (clickhouse_common_io SYSTEM BEFORE PUBLIC ${LFALLOC_INCLUDE_DIR})
diff --git a/dbms/src/Compression/CMakeLists.txt b/dbms/src/Compression/CMakeLists.txt
index 2ca2a043978..0032186205a 100644
--- a/dbms/src/Compression/CMakeLists.txt
+++ b/dbms/src/Compression/CMakeLists.txt
@@ -1,14 +1,18 @@
 include(${ClickHouse_SOURCE_DIR}/cmake/dbms_glob_sources.cmake)
 add_headers_and_sources(clickhouse_compression .)
 add_library(clickhouse_compression ${clickhouse_compression_headers} ${clickhouse_compression_sources})
-target_link_libraries(clickhouse_compression PRIVATE clickhouse_parsers clickhouse_common_io ${ZSTD_LIBRARY} ${LZ4_LIBRARY} ${CITYHASH_LIBRARIES})
+target_link_libraries(clickhouse_compression PRIVATE clickhouse_parsers clickhouse_common_io ${LZ4_LIBRARY} ${CITYHASH_LIBRARIES})
+if(ZSTD_LIBRARY)
+    target_link_libraries(clickhouse_compression PRIVATE ${ZSTD_LIBRARY})
+endif()
+
 target_include_directories(clickhouse_compression PUBLIC ${DBMS_INCLUDE_DIR})
 target_include_directories(clickhouse_compression SYSTEM PUBLIC ${PCG_RANDOM_INCLUDE_DIR})
 
 if (NOT USE_INTERNAL_LZ4_LIBRARY)
     target_include_directories(clickhouse_compression SYSTEM BEFORE PRIVATE ${LZ4_INCLUDE_DIR})
 endif ()
-if (NOT USE_INTERNAL_ZSTD_LIBRARY)
+if (NOT USE_INTERNAL_ZSTD_LIBRARY AND ZSTD_INCLUDE_DIR)
     target_include_directories(clickhouse_compression SYSTEM BEFORE PRIVATE ${ZSTD_INCLUDE_DIR})
 endif ()
 
diff --git a/dbms/src/Functions/CMakeLists.txt b/dbms/src/Functions/CMakeLists.txt
index 9fd9a920041..00959a755dd 100644
--- a/dbms/src/Functions/CMakeLists.txt
+++ b/dbms/src/Functions/CMakeLists.txt
@@ -60,17 +60,16 @@ if(USE_BASE64)
     target_include_directories(clickhouse_functions SYSTEM PRIVATE ${BASE64_INCLUDE_DIR})
 endif()
 
-if (USE_XXHASH)
+if(USE_XXHASH)
     target_link_libraries(clickhouse_functions PRIVATE ${XXHASH_LIBRARY})
     target_include_directories(clickhouse_functions SYSTEM PRIVATE ${XXHASH_INCLUDE_DIR})
 endif()
 
-if (USE_HYPERSCAN)
-    target_link_libraries (clickhouse_functions PRIVATE ${HYPERSCAN_LIBRARY})
-    target_include_directories (clickhouse_functions SYSTEM PRIVATE ${HYPERSCAN_INCLUDE_DIR})
-endif ()
+if(USE_HYPERSCAN)
+    target_link_libraries(clickhouse_functions PRIVATE ${HYPERSCAN_LIBRARY})
+    target_include_directories(clickhouse_functions SYSTEM PRIVATE ${HYPERSCAN_INCLUDE_DIR})
+endif()
 
-if (USE_SIMDJSON)
+if(USE_SIMDJSON)
     target_link_libraries(clickhouse_functions PRIVATE ${SIMDJSON_LIBRARY})
-    target_include_directories(clickhouse_functions PRIVATE ${SIMDJSON_INCLUDE_DIR})
-endif ()
+endif()
diff --git a/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in b/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in
index 6d6d5f32e0c..758408114a8 100644
--- a/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in
+++ b/dbms/src/Storages/System/StorageSystemBuildOptions.generated.cpp.in
@@ -37,11 +37,14 @@ const char * auto_config_build[]
     "USE_GLIBC_COMPATIBILITY", "@GLIBC_COMPATIBILITY@",
     "USE_JEMALLOC", "@USE_JEMALLOC@",
     "USE_TCMALLOC", "@USE_TCMALLOC@",
+    "USE_LFALLOC", "@USE_LFALLOC@",
+    "USE_LFALLOC_RANDOM_HINT", "@USE_LFALLOC_RANDOM_HINT@",
     "USE_UNWIND", "@USE_UNWIND@",
     "USE_ICU", "@USE_ICU@",
     "USE_MYSQL", "@USE_MYSQL@",
     "USE_RE2_ST", "@USE_RE2_ST@",
     "USE_VECTORCLASS", "@USE_VECTORCLASS@",
+    "USE_LIBGSASL", "@USE_LIBGSASL@",
     "USE_RDKAFKA", "@USE_RDKAFKA@",
     "USE_CAPNP", "@USE_CAPNP@",
     "USE_POCO_SQLODBC", "@USE_POCO_SQLODBC@",
@@ -57,8 +60,7 @@ const char * auto_config_build[]
     "USE_BROTLI", "@USE_BROTLI@",
     "USE_SSL", "@USE_SSL@",
     "USE_HYPERSCAN", "@USE_HYPERSCAN@",
-    "USE_LFALLOC", "@USE_LFALLOC@",
-    "USE_LFALLOC_RANDOM_HINT", "@USE_LFALLOC_RANDOM_HINT@",
+    "USE_SIMDJSON", "@USE_SIMDJSON@",
 
     nullptr, nullptr
 };
diff --git a/debian/pbuilder-hooks/A00ccache b/debian/pbuilder-hooks/A00ccache
index 53510f9d325..d7ed93651bc 100755
--- a/debian/pbuilder-hooks/A00ccache
+++ b/debian/pbuilder-hooks/A00ccache
@@ -14,4 +14,5 @@ fi
 
 df -h
 ccache --show-stats
-ccache -M ${CCACHE_SIZE:=32G}
+ccache --zero-stats
+ccache --max-size=${CCACHE_SIZE:=32G}
diff --git a/docker/packager/binary/build.sh b/docker/packager/binary/build.sh
index 6fb646e038d..c31fb592782 100755
--- a/docker/packager/binary/build.sh
+++ b/docker/packager/binary/build.sh
@@ -4,10 +4,11 @@ set -x -e
 
 mkdir -p build/build_docker
 cd build/build_docker
-ccache -s ||:
+ccache --show-stats ||:
+ccache --zero-stats ||:
 rm -f CMakeCache.txt
 cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSANITIZE=$SANITIZER $CMAKE_FLAGS
 ninja
-ccache -s ||:
+ccache --show-stats ||:
 mv ./dbms/programs/clickhouse* /output
 mv ./dbms/unit_tests_dbms /output
diff --git a/docker/packager/deb/build.sh b/docker/packager/deb/build.sh
index c9393fc509a..b395ed76d00 100755
--- a/docker/packager/deb/build.sh
+++ b/docker/packager/deb/build.sh
@@ -2,9 +2,10 @@
 
 set -x -e
 
-ccache -s ||:
+ccache --show-stats ||:
+ccache --zero-stats ||:
 build/release --no-pbuilder
 mv /*.deb /output
 mv *.changes /output
 mv *.buildinfo /output
-ccache -s ||:
+ccache --show-stats ||:
diff --git a/libs/libcommon/CMakeLists.txt b/libs/libcommon/CMakeLists.txt
index 6b4d1327cef..7c124b77230 100644
--- a/libs/libcommon/CMakeLists.txt
+++ b/libs/libcommon/CMakeLists.txt
@@ -87,7 +87,10 @@ endif ()
 
 find_package (Threads)
 
-target_include_directories (common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR})
+if(CCTZ_INCLUDE_DIR)
+    target_include_directories(common BEFORE PRIVATE ${CCTZ_INCLUDE_DIR})
+endif()
+
 target_include_directories (common PUBLIC ${COMMON_INCLUDE_DIR})
 
 if (NOT USE_INTERNAL_BOOST_LIBRARY)
@@ -98,12 +101,15 @@ if(NOT USE_INTERNAL_POCO_LIBRARY)
     target_include_directories (common SYSTEM BEFORE PUBLIC ${Poco_Foundation_INCLUDE_DIR})
 endif()
 
+if(CCTZ_LIBRARY)
+    target_link_libraries(common PRIVATE ${CCTZ_LIBRARY})
+endif()
+
 target_link_libraries (common
         PUBLIC
     ${Poco_Foundation_LIBRARY}
     ${CITYHASH_LIBRARIES}
         PRIVATE
-    ${CCTZ_LIBRARY}
     ${Boost_FILESYSTEM_LIBRARY}
         PUBLIC
     ${Boost_SYSTEM_LIBRARY}
diff --git a/libs/libcommon/cmake/find_cctz.cmake b/libs/libcommon/cmake/find_cctz.cmake
index aa793657156..aae8078512d 100644
--- a/libs/libcommon/cmake/find_cctz.cmake
+++ b/libs/libcommon/cmake/find_cctz.cmake
@@ -1,10 +1,12 @@
 option (USE_INTERNAL_CCTZ_LIBRARY "Set to FALSE to use system cctz library instead of bundled" ${NOT_UNBUNDLED})
 
-if (USE_INTERNAL_CCTZ_LIBRARY AND NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cctz/include/cctz/time_zone.h")
-   message (WARNING "submodule contrib/cctz is missing. to fix try run: \n git submodule update --init --recursive")
-   set (MISSING_INTERNAL_CCTZ_LIBRARY 1)
-   set (USE_INTERNAL_CCTZ_LIBRARY 0)
-endif ()
+if(NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cctz/include/cctz/time_zone.h")
+    if(USE_INTERNAL_CCTZ_LIBRARY)
+       message(WARNING "submodule contrib/cctz is missing. to fix try run: \n git submodule update --init --recursive")
+    endif()
+    set(USE_INTERNAL_CCTZ_LIBRARY 0)
+    set(MISSING_INTERNAL_CCTZ_LIBRARY 1)
+endif()
 
 if (NOT USE_INTERNAL_CCTZ_LIBRARY)
     find_library (CCTZ_LIBRARY cctz)
diff --git a/utils/compressor/CMakeLists.txt b/utils/compressor/CMakeLists.txt
index 5af551f8d03..e4f99c4b73a 100644
--- a/utils/compressor/CMakeLists.txt
+++ b/utils/compressor/CMakeLists.txt
@@ -1,7 +1,10 @@
 find_package (Threads)
 
 add_executable (zstd_test zstd_test.cpp)
-target_link_libraries (zstd_test PRIVATE ${ZSTD_LIBRARY} common Threads::Threads)
+if(ZSTD_LIBRARY)
+    target_link_libraries(zstd_test PRIVATE ${ZSTD_LIBRARY})
+endif()
+target_link_libraries (zstd_test PRIVATE common Threads::Threads)
 
 add_executable (mutator mutator.cpp)
 target_link_libraries(mutator PRIVATE clickhouse_common_io)
@@ -9,6 +12,6 @@ target_link_libraries(mutator PRIVATE clickhouse_common_io)
 add_executable (decompress_perf decompress_perf.cpp)
 target_link_libraries(decompress_perf PRIVATE clickhouse_common_io clickhouse_compression ${LZ4_LIBRARY})
 
-if (NOT USE_INTERNAL_ZSTD_LIBRARY)
+if (NOT USE_INTERNAL_ZSTD_LIBRARY AND ZSTD_INCLUDE_DIR)
     target_include_directories (zstd_test BEFORE PRIVATE ${ZSTD_INCLUDE_DIR})
 endif ()

From 5f19c0981dee39b9bdd918198870480a21a53d97 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Wed, 15 May 2019 21:50:35 +0300
Subject: [PATCH 157/194] add toDecimalOrZero and toDecimalOrNull fuctions

---
 dbms/src/DataTypes/DataTypesDecimal.cpp       |   9 ++
 dbms/src/DataTypes/DataTypesDecimal.h         |   1 +
 dbms/src/Functions/FunctionsConversion.cpp    |   8 ++
 dbms/src/Functions/FunctionsConversion.h      | 120 ++++++++++++++----
 dbms/src/IO/readFloatText.h                   |  40 +++++-
 .../00700_to_decimal_or_something.reference   |  27 ++++
 .../00700_to_decimal_or_something.sql         |  43 +++++++
 7 files changed, 217 insertions(+), 31 deletions(-)
 create mode 100644 dbms/tests/queries/0_stateless/00700_to_decimal_or_something.reference
 create mode 100644 dbms/tests/queries/0_stateless/00700_to_decimal_or_something.sql

diff --git a/dbms/src/DataTypes/DataTypesDecimal.cpp b/dbms/src/DataTypes/DataTypesDecimal.cpp
index 8ec5bb6664f..359c4e4442f 100644
--- a/dbms/src/DataTypes/DataTypesDecimal.cpp
+++ b/dbms/src/DataTypes/DataTypesDecimal.cpp
@@ -51,6 +51,15 @@ void DataTypeDecimal::serializeText(const IColumn & column, size_t row_num, W
     writeText(value, scale, ostr);
 }
 
+template 
+bool DataTypeDecimal::tryReadText(T & x, ReadBuffer & istr, UInt32 precision, UInt32 scale)
+{
+    UInt32 unread_scale = scale;
+    bool done = tryReadDecimalText(istr, x, precision, unread_scale);
+    x *= getScaleMultiplier(unread_scale);
+    return done;
+}
+
 template 
 void DataTypeDecimal::readText(T & x, ReadBuffer & istr, UInt32 precision, UInt32 scale)
 {
diff --git a/dbms/src/DataTypes/DataTypesDecimal.h b/dbms/src/DataTypes/DataTypesDecimal.h
index e001c094af1..762d5974e8b 100644
--- a/dbms/src/DataTypes/DataTypesDecimal.h
+++ b/dbms/src/DataTypes/DataTypesDecimal.h
@@ -177,6 +177,7 @@ public:
 
     void readText(T & x, ReadBuffer & istr) const { readText(x, istr, precision, scale); }
     static void readText(T & x, ReadBuffer & istr, UInt32 precision, UInt32 scale);
+    static bool tryReadText(T & x, ReadBuffer & istr, UInt32 precision, UInt32 scale);
     static T getScaleMultiplier(UInt32 scale);
 
 private:
diff --git a/dbms/src/Functions/FunctionsConversion.cpp b/dbms/src/Functions/FunctionsConversion.cpp
index a83a756010c..ccb4d4b9259 100644
--- a/dbms/src/Functions/FunctionsConversion.cpp
+++ b/dbms/src/Functions/FunctionsConversion.cpp
@@ -66,6 +66,10 @@ void registerFunctionsConversion(FunctionFactory & factory)
     factory.registerFunction();
     factory.registerFunction();
 
+    factory.registerFunction();
+    factory.registerFunction();
+    factory.registerFunction();
+
     factory.registerFunction();
     factory.registerFunction();
     factory.registerFunction();
@@ -79,6 +83,10 @@ void registerFunctionsConversion(FunctionFactory & factory)
     factory.registerFunction();
     factory.registerFunction();
 
+    factory.registerFunction();
+    factory.registerFunction();
+    factory.registerFunction();
+
     factory.registerFunction();
     factory.registerFunction();
     factory.registerFunction();
diff --git a/dbms/src/Functions/FunctionsConversion.h b/dbms/src/Functions/FunctionsConversion.h
index 891e254d9cf..db553f398bf 100644
--- a/dbms/src/Functions/FunctionsConversion.h
+++ b/dbms/src/Functions/FunctionsConversion.h
@@ -543,11 +543,7 @@ struct ConvertThroughParsing
 
             ReadBufferFromMemory read_buffer(&(*chars)[current_offset], string_size);
 
-            if constexpr (IsDataTypeDecimal)
-            {
-                ToDataType::readText(vec_to[i], read_buffer, ToDataType::maxPrecision(), vec_to.getScale());
-            }
-            else if constexpr (exception_mode == ConvertFromStringExceptionMode::Throw)
+            if constexpr (exception_mode == ConvertFromStringExceptionMode::Throw)
             {
                 if constexpr (parsing_mode == ConvertFromStringParsingMode::BestEffort)
                 {
@@ -557,7 +553,10 @@ struct ConvertThroughParsing
                 }
                 else
                 {
-                    parseImpl(vec_to[i], read_buffer, local_time_zone);
+                    if constexpr (IsDataTypeDecimal)
+                        ToDataType::readText(vec_to[i], read_buffer, ToDataType::maxPrecision(), vec_to.getScale());
+                    else
+                        parseImpl(vec_to[i], read_buffer, local_time_zone);
                 }
 
                 if (!isAllRead(read_buffer))
@@ -575,7 +574,12 @@ struct ConvertThroughParsing
                 }
                 else
                 {
-                    parsed = tryParseImpl(vec_to[i], read_buffer, local_time_zone) && isAllRead(read_buffer);
+                    if constexpr (IsDataTypeDecimal)
+                        parsed = ToDataType::tryReadText(vec_to[i], read_buffer, ToDataType::maxPrecision(), vec_to.getScale());
+                    else
+                        parsed = tryParseImpl(vec_to[i], read_buffer, local_time_zone);
+
+                    parsed = parsed && isAllRead(read_buffer);
                 }
 
                 if (!parsed)
@@ -959,27 +963,37 @@ public:
 
     DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override
     {
-        if (arguments.size() != 1 && arguments.size() != 2)
-            throw Exception("Number of arguments for function " + getName() + " doesn't match: passed "
-                + toString(arguments.size()) + ", should be 1 or 2. Second argument (time zone) is optional only make sense for DateTime.",
+        if ((arguments.size() != 1 && arguments.size() != 2) || (to_decimal && arguments.size() != 2))
+            throw Exception("Number of arguments for function " + getName() + " doesn't match: passed " + toString(arguments.size()) +
+                ", should be 1 or 2. Second argument only make sense for DateTime (time zone, optional) and Decimal (scale).",
                 ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
 
         if (!isStringOrFixedString(arguments[0].type))
             throw Exception("Illegal type " + arguments[0].type->getName() + " of first argument of function " + getName(),
                 ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
 
-        /// Optional second argument with time zone is supported.
-
         if (arguments.size() == 2)
         {
-            if constexpr (!std::is_same_v)
+            if constexpr (std::is_same_v)
+            {
+                if (!isString(arguments[1].type))
+                    throw Exception("Illegal type " + arguments[1].type->getName() + " of 2nd argument of function " + getName(),
+                        ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
+            }
+            else if constexpr (to_decimal)
+            {
+                if (!isInteger(arguments[1].type))
+                    throw Exception("Illegal type " + arguments[1].type->getName() + " of 2nd argument of function " + getName(),
+                        ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
+                if (!arguments[1].column)
+                    throw Exception("Second argument for function " + getName() + " must be constant", ErrorCodes::ILLEGAL_COLUMN);
+            }
+            else
+            {
                 throw Exception("Number of arguments for function " + getName() + " doesn't match: passed "
-                    + toString(arguments.size()) + ", should be 1. Second argument makes sense only when converting to DateTime.",
+                    + toString(arguments.size()) + ", should be 1. Second argument makes sense only for DateTime and Decimal.",
                     ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
-
-            if (!isString(arguments[1].type))
-                throw Exception("Illegal type " + arguments[1].type->getName() + " of 2nd argument of function " + getName(),
-                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
+            }
         }
 
         DataTypePtr res;
@@ -987,7 +1001,19 @@ public:
         if constexpr (std::is_same_v)
             res = std::make_shared(extractTimeZoneNameFromFunctionArguments(arguments, 1, 0));
         else if constexpr (to_decimal)
-            throw Exception(getName() + " is only implemented for types String and Decimal", ErrorCodes::NOT_IMPLEMENTED);
+        {
+            UInt64 scale = extractToDecimalScale(arguments[1]);
+
+            if constexpr (std::is_same_v>)
+                res = createDecimal(9, scale);
+            else if constexpr (std::is_same_v>)
+                res = createDecimal(18, scale);
+            else if constexpr (std::is_same_v>)
+                res = createDecimal(38, scale);
+
+            if (!res)
+                throw Exception("Someting wrong with toDecimalNNOrZero() or toDecimalNNOrNull()", ErrorCodes::LOGICAL_ERROR);
+        }
         else
             res = std::make_shared();
 
@@ -1001,13 +1027,45 @@ public:
     {
         const IDataType * from_type = block.getByPosition(arguments[0]).type.get();
 
-        if (checkAndGetDataType(from_type))
-            ConvertThroughParsing::execute(
-                block, arguments, result, input_rows_count);
-        else if (checkAndGetDataType(from_type))
-            ConvertThroughParsing::execute(
-                block, arguments, result, input_rows_count);
+        bool ok = true;
+        if constexpr (to_decimal)
+        {
+            if (arguments.size() != 2)
+                throw Exception{"Function " + getName() + " expects 2 arguments for Decimal.", ErrorCodes::TOO_FEW_ARGUMENTS_FOR_FUNCTION};
+
+            UInt32 scale = extractToDecimalScale(block.getByPosition(arguments[1]));
+
+            if (checkAndGetDataType(from_type))
+            {
+                ConvertThroughParsing::execute(
+                    block, arguments, result, input_rows_count, scale);
+            }
+            else if (checkAndGetDataType(from_type))
+            {
+                ConvertThroughParsing::execute(
+                    block, arguments, result, input_rows_count, scale);
+            }
+            else
+                ok = false;
+        }
         else
+        {
+            if (checkAndGetDataType(from_type))
+            {
+                ConvertThroughParsing::execute(
+                    block, arguments, result, input_rows_count);
+            }
+            else if (checkAndGetDataType(from_type))
+            {
+                ConvertThroughParsing::execute(
+                    block, arguments, result, input_rows_count);
+            }
+            else
+                ok = false;
+
+        }
+
+        if (!ok)
             throw Exception("Illegal type " + block.getByPosition(arguments[0]).type->getName() + " of argument of function " + getName()
                 + ". Only String or FixedString argument is accepted for try-conversion function."
                 + " For other arguments, use function without 'orZero' or 'orNull'.",
@@ -1358,6 +1416,9 @@ struct NameToFloat32OrZero { static constexpr auto name = "toFloat32OrZero"; };
 struct NameToFloat64OrZero { static constexpr auto name = "toFloat64OrZero"; };
 struct NameToDateOrZero { static constexpr auto name = "toDateOrZero"; };
 struct NameToDateTimeOrZero { static constexpr auto name = "toDateTimeOrZero"; };
+struct NameToDecimal32OrZero { static constexpr auto name = "toDecimal32OrZero"; };
+struct NameToDecimal64OrZero { static constexpr auto name = "toDecimal64OrZero"; };
+struct NameToDecimal128OrZero { static constexpr auto name = "toDecimal128OrZero"; };
 
 using FunctionToUInt8OrZero = FunctionConvertFromString;
 using FunctionToUInt16OrZero = FunctionConvertFromString;
@@ -1371,6 +1432,9 @@ using FunctionToFloat32OrZero = FunctionConvertFromString;
 using FunctionToDateOrZero = FunctionConvertFromString;
 using FunctionToDateTimeOrZero = FunctionConvertFromString;
+using FunctionToDecimal32OrZero = FunctionConvertFromString, NameToDecimal32OrZero, ConvertFromStringExceptionMode::Zero>;
+using FunctionToDecimal64OrZero = FunctionConvertFromString, NameToDecimal64OrZero, ConvertFromStringExceptionMode::Zero>;
+using FunctionToDecimal128OrZero = FunctionConvertFromString, NameToDecimal128OrZero, ConvertFromStringExceptionMode::Zero>;
 
 struct NameToUInt8OrNull { static constexpr auto name = "toUInt8OrNull"; };
 struct NameToUInt16OrNull { static constexpr auto name = "toUInt16OrNull"; };
@@ -1384,6 +1448,9 @@ struct NameToFloat32OrNull { static constexpr auto name = "toFloat32OrNull"; };
 struct NameToFloat64OrNull { static constexpr auto name = "toFloat64OrNull"; };
 struct NameToDateOrNull { static constexpr auto name = "toDateOrNull"; };
 struct NameToDateTimeOrNull { static constexpr auto name = "toDateTimeOrNull"; };
+struct NameToDecimal32OrNull { static constexpr auto name = "toDecimal32OrNull"; };
+struct NameToDecimal64OrNull { static constexpr auto name = "toDecimal64OrNull"; };
+struct NameToDecimal128OrNull { static constexpr auto name = "toDecimal128OrNull"; };
 
 using FunctionToUInt8OrNull = FunctionConvertFromString;
 using FunctionToUInt16OrNull = FunctionConvertFromString;
@@ -1397,6 +1464,9 @@ using FunctionToFloat32OrNull = FunctionConvertFromString;
 using FunctionToDateOrNull = FunctionConvertFromString;
 using FunctionToDateTimeOrNull = FunctionConvertFromString;
+using FunctionToDecimal32OrNull = FunctionConvertFromString, NameToDecimal32OrNull, ConvertFromStringExceptionMode::Null>;
+using FunctionToDecimal64OrNull = FunctionConvertFromString, NameToDecimal64OrNull, ConvertFromStringExceptionMode::Null>;
+using FunctionToDecimal128OrNull = FunctionConvertFromString, NameToDecimal128OrNull, ConvertFromStringExceptionMode::Null>;
 
 struct NameParseDateTimeBestEffort { static constexpr auto name = "parseDateTimeBestEffort"; };
 struct NameParseDateTimeBestEffortOrZero { static constexpr auto name = "parseDateTimeBestEffortOrZero"; };
diff --git a/dbms/src/IO/readFloatText.h b/dbms/src/IO/readFloatText.h
index 01303886b7e..ce24e337b6f 100644
--- a/dbms/src/IO/readFloatText.h
+++ b/dbms/src/IO/readFloatText.h
@@ -554,8 +554,8 @@ ReturnType readFloatTextSimpleImpl(T & x, ReadBuffer & buf)
 }
 
 
-template 
-inline void readDigits(ReadBuffer & buf, T & x, unsigned int & digits, int & exponent, bool digits_only = false)
+template 
+inline bool readDigits(ReadBuffer & buf, T & x, unsigned int & digits, int & exponent, bool digits_only = false)
 {
     x = 0;
     exponent = 0;
@@ -567,7 +567,11 @@ inline void readDigits(ReadBuffer & buf, T & x, unsigned int & digits, int & exp
     bool after_point = false;
 
     if (buf.eof())
-        throwReadAfterEOF();
+    {
+        if constexpr (_throw_on_error)
+            throwReadAfterEOF();
+        return false;
+    }
 
     if (!buf.eof())
     {
@@ -618,7 +622,12 @@ inline void readDigits(ReadBuffer & buf, T & x, unsigned int & digits, int & exp
 
                 ++places; // num zeroes before + current digit
                 if (digits + places > max_digits)
-                    throw Exception("Too many digits (" + std::to_string(digits + places) + " > " + std::to_string(max_digits) + ") in decimal value", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
+                {
+                    if constexpr (_throw_on_error)
+                        throw Exception("Too many digits (" + std::to_string(digits + places) + " > " + std::to_string(max_digits)
+                            + ") in decimal value", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
+                    return false;
+                }
 
                 digits += places;
                 if (after_point)
@@ -643,7 +652,11 @@ inline void readDigits(ReadBuffer & buf, T & x, unsigned int & digits, int & exp
 
             default:
                 if (digits_only)
-                    throw Exception("Unexpected symbol while reading decimal", ErrorCodes::CANNOT_PARSE_NUMBER);
+                {
+                    if constexpr (_throw_on_error)
+                        throw Exception("Unexpected symbol while reading decimal", ErrorCodes::CANNOT_PARSE_NUMBER);
+                    return false;
+                }
                 stop = true;
                 continue;
         }
@@ -651,6 +664,7 @@ inline void readDigits(ReadBuffer & buf, T & x, unsigned int & digits, int & exp
     }
 
     x *= sign;
+    return true;
 }
 
 template 
@@ -658,7 +672,7 @@ inline void readDecimalText(ReadBuffer & buf, T & x, unsigned int precision, uns
 {
     unsigned int digits = precision;
     int exponent;
-    readDigits(buf, x, digits, exponent, digits_only);
+    readDigits(buf, x, digits, exponent, digits_only);
 
     if (static_cast(digits) + exponent > static_cast(precision - scale))
         throw Exception("Decimal value is too big", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
@@ -668,6 +682,20 @@ inline void readDecimalText(ReadBuffer & buf, T & x, unsigned int precision, uns
     scale += exponent;
 }
 
+template 
+inline bool tryReadDecimalText(ReadBuffer & buf, T & x, unsigned int precision, unsigned int & scale)
+{
+    unsigned int digits = precision;
+    int exponent;
+
+    if (!readDigits(buf, x, digits, exponent, true) ||
+        static_cast(digits) + exponent > static_cast(precision - scale) ||
+        static_cast(scale) + exponent < 0)
+        return false;
+
+    scale += exponent;
+    return true;
+}
 
 template  void readFloatTextPrecise(T & x, ReadBuffer & in) { readFloatTextPreciseImpl(x, in); }
 template  bool tryReadFloatTextPrecise(T & x, ReadBuffer & in) { return readFloatTextPreciseImpl(x, in); }
diff --git a/dbms/tests/queries/0_stateless/00700_to_decimal_or_something.reference b/dbms/tests/queries/0_stateless/00700_to_decimal_or_something.reference
new file mode 100644
index 00000000000..7a6ff87d096
--- /dev/null
+++ b/dbms/tests/queries/0_stateless/00700_to_decimal_or_something.reference
@@ -0,0 +1,27 @@
+1.1	1.10	1.10000000
+0
+0	0.42
+0	0.420
+0	0.4200
+999999999	0
+-999999999	0
+999999999999999999	0
+-999999999999999999	0
+99999999999999999999999999999999999999
+0
+-99999999999999999999999999999999999999
+0
+----
+1.1	1.10	1.10000000
+\N
+\N	-0.42
+\N	-0.420
+\N	-0.4200
+999999999	\N
+-999999999	\N
+999999999999999999	\N
+-999999999999999999	\N
+99999999999999999999999999999999999999
+\N
+-99999999999999999999999999999999999999
+\N
diff --git a/dbms/tests/queries/0_stateless/00700_to_decimal_or_something.sql b/dbms/tests/queries/0_stateless/00700_to_decimal_or_something.sql
new file mode 100644
index 00000000000..cbf5dc33c07
--- /dev/null
+++ b/dbms/tests/queries/0_stateless/00700_to_decimal_or_something.sql
@@ -0,0 +1,43 @@
+SELECT toDecimal32OrZero('1.1', 1), toDecimal32OrZero('1.1', 2), toDecimal32OrZero('1.1', 8);
+SELECT toDecimal32OrZero('1.1', 0);
+SELECT toDecimal32OrZero(1.1, 0); -- { serverError 43 }
+
+SELECT toDecimal128OrZero('', 0) AS x, toDecimal128OrZero('0.42', 2) AS y;
+SELECT toDecimal64OrZero('', 0) AS x, toDecimal64OrZero('0.42', 3) AS y;
+SELECT toDecimal32OrZero('', 0) AS x, toDecimal32OrZero('0.42', 4) AS y;
+
+SELECT toDecimal32OrZero('999999999', 0), toDecimal32OrZero('1000000000', 0);
+SELECT toDecimal32OrZero('-999999999', 0), toDecimal32OrZero('-1000000000', 0);
+SELECT toDecimal64OrZero('999999999999999999', 0), toDecimal64OrZero('1000000000000000000', 0);
+SELECT toDecimal64OrZero('-999999999999999999', 0), toDecimal64OrZero('-1000000000000000000', 0);
+SELECT toDecimal128OrZero('99999999999999999999999999999999999999', 0);
+SELECT toDecimal64OrZero('100000000000000000000000000000000000000', 0);
+SELECT toDecimal128OrZero('-99999999999999999999999999999999999999', 0);
+SELECT toDecimal64OrZero('-100000000000000000000000000000000000000', 0);
+
+SELECT toDecimal32OrZero('1', rowNumberInBlock()); -- { serverError 44 }
+SELECT toDecimal64OrZero('1', rowNumberInBlock()); -- { serverError 44 }
+SELECT toDecimal128OrZero('1', rowNumberInBlock()); -- { serverError 44 }
+
+SELECT '----';
+
+SELECT toDecimal32OrNull('1.1', 1), toDecimal32OrNull('1.1', 2), toDecimal32OrNull('1.1', 8);
+SELECT toDecimal32OrNull('1.1', 0);
+SELECT toDecimal32OrNull(1.1, 0); -- { serverError 43 }
+
+SELECT toDecimal128OrNull('', 0) AS x, toDecimal128OrNull('-0.42', 2) AS y;
+SELECT toDecimal64OrNull('', 0) AS x, toDecimal64OrNull('-0.42', 3) AS y;
+SELECT toDecimal32OrNull('', 0) AS x, toDecimal32OrNull('-0.42', 4) AS y;
+
+SELECT toDecimal32OrNull('999999999', 0), toDecimal32OrNull('1000000000', 0);
+SELECT toDecimal32OrNull('-999999999', 0), toDecimal32OrNull('-1000000000', 0);
+SELECT toDecimal64OrNull('999999999999999999', 0), toDecimal64OrNull('1000000000000000000', 0);
+SELECT toDecimal64OrNull('-999999999999999999', 0), toDecimal64OrNull('-1000000000000000000', 0);
+SELECT toDecimal128OrNull('99999999999999999999999999999999999999', 0);
+SELECT toDecimal64OrNull('100000000000000000000000000000000000000', 0);
+SELECT toDecimal128OrNull('-99999999999999999999999999999999999999', 0);
+SELECT toDecimal64OrNull('-100000000000000000000000000000000000000', 0);
+
+SELECT toDecimal32OrNull('1', rowNumberInBlock()); -- { serverError 44 }
+SELECT toDecimal64OrNull('1', rowNumberInBlock()); -- { serverError 44 }
+SELECT toDecimal128OrNull('1', rowNumberInBlock()); -- { serverError 44 }

From 2affb3ca822de929a55aee6b67a8170c3a963d8c Mon Sep 17 00:00:00 2001
From: alexey-milovidov 
Date: Thu, 16 May 2019 00:01:14 +0300
Subject: [PATCH 158/194] Update DataTypesDecimal.h

---
 dbms/src/DataTypes/DataTypesDecimal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dbms/src/DataTypes/DataTypesDecimal.h b/dbms/src/DataTypes/DataTypesDecimal.h
index 32d6549a4c8..650e0abdbf3 100644
--- a/dbms/src/DataTypes/DataTypesDecimal.h
+++ b/dbms/src/DataTypes/DataTypesDecimal.h
@@ -321,8 +321,8 @@ convertToDecimal(const typename FromDataType::FieldType & value, UInt32 scale)
 
     if constexpr (std::is_floating_point_v)
     {
-        if (std::isinf(value) || std::isnan(value))
-            throw Exception("Decimal convert overflow. Cannot convert infinity or NaN into decimal", ErrorCodes::DECIMAL_OVERFLOW);
+        if (!std::isfinite(value))
+            throw Exception("Decimal convert overflow. Cannot convert infinity or NaN to decimal", ErrorCodes::DECIMAL_OVERFLOW);
         return value * ToDataType::getScaleMultiplier(scale);
     }
     else

From c6108eec7389fc0c89a53c7eb78f9de241f0d255 Mon Sep 17 00:00:00 2001
From: linceyou 
Date: Thu, 16 May 2019 14:42:56 +0800
Subject: [PATCH 159/194] fix possible deadlock

---
 dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp b/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp
index 4abb97f1ccb..41e18b95fcf 100644
--- a/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp
+++ b/dbms/src/Common/ZooKeeper/ZooKeeperImpl.cpp
@@ -1430,6 +1430,8 @@ void ZooKeeper::pushRequest(RequestInfo && info)
         if (!info.request->xid)
         {
             info.request->xid = next_xid.fetch_add(1);
+            if (info.request->xid == close_xid)
+                throw Exception("xid equal to close_xid", ZSESSIONEXPIRED);
             if (info.request->xid < 0)
                 throw Exception("XID overflow", ZSESSIONEXPIRED);
         }

From ff4d989918373f4b5e5563c16ab0da744ad15b45 Mon Sep 17 00:00:00 2001
From: stavrolia 
Date: Thu, 16 May 2019 13:52:41 +0300
Subject: [PATCH 160/194] Fixed help instruction of usage

---
 dbms/programs/performance-test/PerformanceTestSuite.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dbms/programs/performance-test/PerformanceTestSuite.cpp b/dbms/programs/performance-test/PerformanceTestSuite.cpp
index 9c72ba953dc..523e6787364 100644
--- a/dbms/programs/performance-test/PerformanceTestSuite.cpp
+++ b/dbms/programs/performance-test/PerformanceTestSuite.cpp
@@ -370,7 +370,7 @@ try
     Poco::Logger * log = &Poco::Logger::get("PerformanceTestSuite");
     if (options.count("help"))
     {
-        std::cout << "Usage: " << argv[0] << " [options] [test_file ...] [tests_folder]\n";
+        std::cout << "Usage: " << argv[0] << " [options]\n";
         std::cout << desc << "\n";
         return 0;
     }

From 0d26ac8583c7779d79bd99840f2c9e5b84c813a8 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Fri, 10 May 2019 11:49:03 +0300
Subject: [PATCH 161/194] Reimplement indices in objects in more
 straightforward way

---
 dbms/src/Functions/FunctionsJSON.cpp          | 24 ++++++++++++++---
 dbms/src/Functions/FunctionsJSON.h            | 26 ++++++++++++-------
 .../00918_json_functions_avx2.reference       |  5 +++-
 .../0_stateless/00918_json_functions_avx2.sql |  5 +++-
 .../functions/json_functions.md               | 14 +++++-----
 5 files changed, 54 insertions(+), 20 deletions(-)

diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp
index b936b59bd8d..cf26a5fb50c 100644
--- a/dbms/src/Functions/FunctionsJSON.cpp
+++ b/dbms/src/Functions/FunctionsJSON.cpp
@@ -43,10 +43,11 @@ public:
 
         if (pjh.down())
         {
-            size += 1;
-
+            ++size;
             while (pjh.next())
-                size += 1;
+                ++size;
+            if (pjh.get_scope_type() == '{')
+                size /= 2;
         }
 
         return {size};
@@ -322,6 +323,20 @@ public:
     }
 };
 
+class JSONExtractKeyImpl : public JSONNullableImplBase
+{
+public:
+    static constexpr auto name{"jsonExtractKey"};
+
+    static Field getValue(ParsedJson::iterator & pjh)
+    {
+        if (pjh.get_scope_type() == '{' && pjh.prev() && pjh.is_string())
+            return {String{pjh.get_string()}};
+        else
+            return getDefault();
+    }
+};
+
 }
 #else
 namespace DB
@@ -336,6 +351,7 @@ struct JSONExtractFloatImpl { static constexpr auto name{"jsonExtractFloat"}; };
 struct JSONExtractBoolImpl { static constexpr auto name{"jsonExtractBool"}; };
 //struct JSONExtractRawImpl { static constexpr auto name {"jsonExtractRaw"}; };
 struct JSONExtractStringImpl { static constexpr auto name{"jsonExtractString"}; };
+struct JSONExtractKeyImpl { static constexpr auto name{"jsonExtractKey"}; };
 }
 #endif
 
@@ -360,6 +376,7 @@ void registerFunctionsJSON(FunctionFactory & factory)
         //     false
         // >>();
         factory.registerFunction>();
+        factory.registerFunction>();
         return;
     }
 #endif
@@ -373,6 +390,7 @@ void registerFunctionsJSON(FunctionFactory & factory)
     factory.registerFunction>();
     //factory.registerFunction>();
     factory.registerFunction>();
+    factory.registerFunction>();
 }
 
 }
diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h
index b0722309e63..d729fc886a0 100644
--- a/dbms/src/Functions/FunctionsJSON.h
+++ b/dbms/src/Functions/FunctionsJSON.h
@@ -59,18 +59,26 @@ private:
                 if (!pjh.is_object_or_array() || !pjh.down())
                     return false;
 
-                int steps = accessor.get();
-
-                if (steps > 0)
-                    steps -= 1;
-                else if (steps < 0)
+                int index = accessor.get();
+                size_t steps;
+                if (index > 0)
                 {
-                    steps += 1;
-
+                    if (pjh.get_scope_type() == '{')
+                        steps = index * 2 - 1;
+                    else
+                        steps = index - 1;
+                }
+                else if (index < 0)
+                {
+                    size_t steps_to_end = 0;
                     ParsedJson::iterator pjh1{pjh};
-
                     while (pjh1.next())
-                        steps += 1;
+                        ++steps_to_end;
+
+                    if (pjh.get_scope_type() == '{')
+                        steps = index * 2 + steps_to_end + 2;
+                    else
+                        steps = index + steps_to_end + 1;
                 }
                 else
                     return false;
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
index 00e5c947847..38f816cd820 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
@@ -1,8 +1,11 @@
-4
+2
 Object
 1
 1
 a
+b
+b
+a
 hello
 hello
 3
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
index da14e8c93da..9cfd2972474 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
@@ -2,8 +2,11 @@ select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}');
 select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}');
 select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
 select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
+select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
+select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 2);
+select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -1);
+select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2);
 select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
-select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 2);
 select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
 select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
 select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
diff --git a/docs/en/query_language/functions/json_functions.md b/docs/en/query_language/functions/json_functions.md
index 67c102da09f..cfdde3c0685 100644
--- a/docs/en/query_language/functions/json_functions.md
+++ b/docs/en/query_language/functions/json_functions.md
@@ -79,19 +79,21 @@ An accessor can be either a string, a positive integer or a negative integer.
 * Positive integer = access the n-th member/key from the beginning.
 * Negative integer = access the n-th member/key from the end.
 
-You may use integers to access both JSON arrays and JSON objects. JSON objects are accessed as an array with the `[key, value, key, value, ...]` layout.
+You may use integers to access both JSON arrays and JSON objects.
 
 So, for example:
 
 ```
-select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1) = 'a'
-select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 2) = 'hello'
-select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', -2) = 'b'
+select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 1) = 'a'
+select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 2) = 'b'
+select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -1) = 'b'
+select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2) = 'a'
+select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1) = 'hello'
 ```
 
 ## jsonLength(params[, accessors]...)
 
-Return the length of a JSON array or a JSON object. For JSON objects, both keys and values are included.
+Return the length of a JSON array or a JSON object.
 
 If the value does not exist or has a wrong type, `null` will be returned.
 
@@ -99,7 +101,7 @@ Examples:
 
 ```
 select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 3
-select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}') = 4
+select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}') = 2
 ```
 
 The usage of accessors is the same as above.

From 8be2e728c029d52432fe1eae3aa558d9418680c8 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Fri, 10 May 2019 12:15:10 +0300
Subject: [PATCH 162/194] Use capital letters in the names of json functions:
 jsonHas => JSONHas

---
 dbms/src/Functions/FunctionsJSON.cpp          | 44 +++++++--------
 .../0_stateless/00918_json_functions_avx2.sql | 38 ++++++-------
 .../functions/json_functions.md               | 54 +++++++++----------
 3 files changed, 68 insertions(+), 68 deletions(-)

diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp
index cf26a5fb50c..b542e803e21 100644
--- a/dbms/src/Functions/FunctionsJSON.cpp
+++ b/dbms/src/Functions/FunctionsJSON.cpp
@@ -24,7 +24,7 @@ public:
 class JSONHasImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonHas"};
+    static constexpr auto name{"JSONHas"};
 
     static Field getValue(ParsedJson::iterator &) { return {1}; }
 };
@@ -32,7 +32,7 @@ public:
 class JSONLengthImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonLength"};
+    static constexpr auto name{"JSONLength"};
 
     static Field getValue(ParsedJson::iterator & pjh)
     {
@@ -57,7 +57,7 @@ public:
 class JSONTypeImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonType"};
+    static constexpr auto name{"JSONType"};
 
     static Field getValue(ParsedJson::iterator & pjh)
     {
@@ -88,7 +88,7 @@ public:
 class JSONExtractImpl
 {
 public:
-    static constexpr auto name{"jsonExtract"};
+    static constexpr auto name{"JSONExtract"};
 
     static DataTypePtr getType(const DataTypePtr & type)
     {
@@ -243,7 +243,7 @@ public:
 class JSONExtractUIntImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonExtractUInt"};
+    static constexpr auto name{"JSONExtractUInt"};
 
     static Field getValue(ParsedJson::iterator & pjh)
     {
@@ -257,7 +257,7 @@ public:
 class JSONExtractIntImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonExtractInt"};
+    static constexpr auto name{"JSONExtractInt"};
 
     static Field getValue(ParsedJson::iterator & pjh)
     {
@@ -271,7 +271,7 @@ public:
 class JSONExtractFloatImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonExtractFloat"};
+    static constexpr auto name{"JSONExtractFloat"};
 
     static Field getValue(ParsedJson::iterator & pjh)
     {
@@ -285,7 +285,7 @@ public:
 class JSONExtractBoolImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonExtractBool"};
+    static constexpr auto name{"JSONExtractBool"};
 
     static Field getValue(ParsedJson::iterator & pjh)
     {
@@ -301,7 +301,7 @@ public:
 // class JSONExtractRawImpl: public JSONNullableImplBase
 // {
 // public:
-//     static constexpr auto name {"jsonExtractRaw"};
+//     static constexpr auto name {"JSONExtractRaw"};
 
 //     static Field getValue(ParsedJson::iterator & pjh)
 //     {
@@ -312,7 +312,7 @@ public:
 class JSONExtractStringImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonExtractString"};
+    static constexpr auto name{"JSONExtractString"};
 
     static Field getValue(ParsedJson::iterator & pjh)
     {
@@ -326,7 +326,7 @@ public:
 class JSONExtractKeyImpl : public JSONNullableImplBase
 {
 public:
-    static constexpr auto name{"jsonExtractKey"};
+    static constexpr auto name{"JSONExtractKey"};
 
     static Field getValue(ParsedJson::iterator & pjh)
     {
@@ -341,17 +341,17 @@ public:
 #else
 namespace DB
 {
-struct JSONHasImpl { static constexpr auto name{"jsonHas"}; };
-struct JSONLengthImpl { static constexpr auto name{"jsonLength"}; };
-struct JSONTypeImpl { static constexpr auto name{"jsonType"}; };
-struct JSONExtractImpl { static constexpr auto name{"jsonExtract"}; };
-struct JSONExtractUIntImpl { static constexpr auto name{"jsonExtractUInt"}; };
-struct JSONExtractIntImpl { static constexpr auto name{"jsonExtractInt"}; };
-struct JSONExtractFloatImpl { static constexpr auto name{"jsonExtractFloat"}; };
-struct JSONExtractBoolImpl { static constexpr auto name{"jsonExtractBool"}; };
-//struct JSONExtractRawImpl { static constexpr auto name {"jsonExtractRaw"}; };
-struct JSONExtractStringImpl { static constexpr auto name{"jsonExtractString"}; };
-struct JSONExtractKeyImpl { static constexpr auto name{"jsonExtractKey"}; };
+struct JSONHasImpl { static constexpr auto name{"JSONHas"}; };
+struct JSONLengthImpl { static constexpr auto name{"JSONLength"}; };
+struct JSONTypeImpl { static constexpr auto name{"JSONType"}; };
+struct JSONExtractImpl { static constexpr auto name{"JSONExtract"}; };
+struct JSONExtractUIntImpl { static constexpr auto name{"JSONExtractUInt"}; };
+struct JSONExtractIntImpl { static constexpr auto name{"JSONExtractInt"}; };
+struct JSONExtractFloatImpl { static constexpr auto name{"JSONExtractFloat"}; };
+struct JSONExtractBoolImpl { static constexpr auto name{"JSONExtractBool"}; };
+//struct JSONExtractRawImpl { static constexpr auto name {"JSONExtractRaw"}; };
+struct JSONExtractStringImpl { static constexpr auto name{"JSONExtractString"}; };
+struct JSONExtractKeyImpl { static constexpr auto name{"JSONExtractKey"}; };
 }
 #endif
 
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
index 9cfd2972474..3d4f63b854f 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
@@ -1,19 +1,19 @@
-select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}');
-select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}');
-select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
-select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
-select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
-select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 2);
-select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -1);
-select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2);
-select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
-select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
-select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
-select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
-select jsonExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1);
-select jsonExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2);
-select jsonExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1);
-select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))');
-select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Int32)', 'b');
-select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(String)');
-select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Tuple(Int16, Float32, UInt8))');
+SELECT JSONLength('{"a": "hello", "b": [-100, 200.0, 300]}');
+SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}');
+SELECT JSONHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
+SELECT JSONHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
+SELECT JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
+SELECT JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 2);
+SELECT JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -1);
+SELECT JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2);
+SELECT JSONExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
+SELECT JSONExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
+SELECT JSONLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
+SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
+SELECT JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1);
+SELECT JSONExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2);
+SELECT JSONExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1);
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Int32)', 'b');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(String)');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Tuple(Int16, Float32, UInt8))');
diff --git a/docs/en/query_language/functions/json_functions.md b/docs/en/query_language/functions/json_functions.md
index cfdde3c0685..38a6a6f7404 100644
--- a/docs/en/query_language/functions/json_functions.md
+++ b/docs/en/query_language/functions/json_functions.md
@@ -60,7 +60,7 @@ There is currently no support for code points in the format `\uXXXX\uYYYY` that
 
 The following functions are based on [simdjson](https://github.com/lemire/simdjson) designed for more complex JSON parsing requirements. The assumption 2 mentioned above still applies.
 
-## jsonHas(params[, accessors]...)
+## JSONHas(params[, accessors]...)
 
 If the value exists in the JSON document, `1` will be returned.
 
@@ -69,8 +69,8 @@ If the value does not exist, `null` will be returned.
 Examples:
 
 ```
-select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 1
-select jsonHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 4) = null
+select JSONHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 1
+select JSONHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 4) = null
 ```
 
 An accessor can be either a string, a positive integer or a negative integer.
@@ -84,14 +84,14 @@ You may use integers to access both JSON arrays and JSON objects.
 So, for example:
 
 ```
-select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 1) = 'a'
-select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 2) = 'b'
-select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -1) = 'b'
-select jsonExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2) = 'a'
-select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1) = 'hello'
+select JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 1) = 'a'
+select JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 2) = 'b'
+select JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -1) = 'b'
+select JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2) = 'a'
+select JSONExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1) = 'hello'
 ```
 
-## jsonLength(params[, accessors]...)
+## JSONLength(params[, accessors]...)
 
 Return the length of a JSON array or a JSON object.
 
@@ -100,13 +100,13 @@ If the value does not exist or has a wrong type, `null` will be returned.
 Examples:
 
 ```
-select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 3
-select jsonLength('{"a": "hello", "b": [-100, 200.0, 300]}') = 2
+select JSONLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 3
+select JSONLength('{"a": "hello", "b": [-100, 200.0, 300]}') = 2
 ```
 
 The usage of accessors is the same as above.
 
-## jsonType(params[, accessors]...)
+## JSONType(params[, accessors]...)
 
 Return the type of a JSON value.
 
@@ -115,18 +115,18 @@ If the value does not exist, `null` will be returned.
 Examples:
 
 ```
-select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}') = 'Object'
-select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}', 'a') = 'String'
-select jsonType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 'Array'
+select JSONType('{"a": "hello", "b": [-100, 200.0, 300]}') = 'Object'
+select JSONType('{"a": "hello", "b": [-100, 200.0, 300]}', 'a') = 'String'
+select JSONType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = 'Array'
 ```
 
 The usage of accessors is the same as above.
 
-## jsonExtractUInt(params[, accessors]...)
-## jsonExtractInt(params[, accessors]...)
-## jsonExtractFloat(params[, accessors]...)
-## jsonExtractBool(params[, accessors]...)
-## jsonExtractString(params[, accessors]...)
+## JSONExtractUInt(params[, accessors]...)
+## JSONExtractInt(params[, accessors]...)
+## JSONExtractFloat(params[, accessors]...)
+## JSONExtractBool(params[, accessors]...)
+## JSONExtractString(params[, accessors]...)
 
 Parse data from JSON values which is similar to `visitParam` functions.
 
@@ -135,15 +135,15 @@ If the value does not exist or has a wrong type, `null` will be returned.
 Examples:
 
 ```
-select jsonExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a') = 'hello'
-select jsonExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1) = -100
-select jsonExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2) = 200.0
-select jsonExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1) = 300
+select JSONExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a') = 'hello'
+select JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1) = -100
+select JSONExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2) = 200.0
+select JSONExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1) = 300
 ```
 
 The usage of accessors is the same as above.
 
-## jsonExtract(params, type[, accessors]...)
+## JSONExtract(params, type[, accessors]...)
 
 Parse data from JSON values with a given ClickHouse data type.
 
@@ -152,8 +152,8 @@ If the value does not exist or has a wrong type, `null` will be returned.
 Examples:
 
 ```
-select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Int8', 'b', 1) = -100
-select jsonExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))') = ('a', 'hello', 'b', [-100.0, 200.0, 300.0])
+select JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Int8', 'b', 1) = -100
+select JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))') = ('a', 'hello', 'b', [-100.0, 200.0, 300.0])
 ```
 
 The usage of accessors is the same as above.

From 900f5cac81f3aee635832d5da25c33067ecca3c2 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Fri, 10 May 2019 13:03:44 +0300
Subject: [PATCH 163/194] Return Enum8 instead of string from JSONType().

---
 dbms/src/Functions/FunctionsJSON.cpp | 35 ++++++++++++++++++----------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp
index b542e803e21..41983af8bf8 100644
--- a/dbms/src/Functions/FunctionsJSON.cpp
+++ b/dbms/src/Functions/FunctionsJSON.cpp
@@ -8,6 +8,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 namespace DB
@@ -54,33 +55,43 @@ public:
     }
 };
 
-class JSONTypeImpl : public JSONNullableImplBase
+class JSONTypeImpl
 {
 public:
     static constexpr auto name{"JSONType"};
 
+    static DataTypePtr getType()
+    {
+        static const std::vector> values = {
+            {"Array", '['},
+            {"Object", '{'},
+            {"String", '"'},
+            {"Int", 'l'},
+            {"Float",'d'},
+            {"Bool", 'b'},
+            {"Null",'n'},
+        };
+        return std::make_shared(std::make_shared>(values));
+    }
+
+    static Field getDefault() { return {}; }
+
     static Field getValue(ParsedJson::iterator & pjh)
     {
         switch (pjh.get_type())
         {
             case '[':
-                return "Array";
             case '{':
-                return "Object";
             case '"':
-                return "String";
             case 'l':
-                return "Int64";
             case 'd':
-                return "Float64";
-            case 't':
-                return "Bool";
-            case 'f':
-                return "Bool";
             case 'n':
-                return "Null";
+                return {pjh.get_type()};
+            case 't':
+            case 'f':
+                return {'b'};
             default:
-                return "Unknown";
+                return {};
         }
     }
 };

From d00368262668f856301ad41e596b92cfda77870e Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Mon, 13 May 2019 16:46:19 +0300
Subject: [PATCH 164/194] Implement function JSONExtractRaw().

---
 dbms/src/Functions/FunctionsJSON.cpp          | 116 +++++++++++++++---
 .../00918_json_functions_avx2.reference       |   7 ++
 .../0_stateless/00918_json_functions_avx2.sql |   7 ++
 .../functions/json_functions.md               |  13 ++
 4 files changed, 128 insertions(+), 15 deletions(-)

diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp
index 41983af8bf8..b5ec5fd6c64 100644
--- a/dbms/src/Functions/FunctionsJSON.cpp
+++ b/dbms/src/Functions/FunctionsJSON.cpp
@@ -309,16 +309,105 @@ public:
     }
 };
 
-// class JSONExtractRawImpl: public JSONNullableImplBase
-// {
-// public:
-//     static constexpr auto name {"JSONExtractRaw"};
+class JSONExtractRawImpl: public JSONNullableImplBase
+{
+public:
+    static constexpr auto name {"JSONExtractRaw"};
 
-//     static Field getValue(ParsedJson::iterator & pjh)
-//     {
-//         //
-//     }
-// };
+    static Field getValue(ParsedJson::iterator & pjh)
+    {
+        WriteBufferFromOwnString buf;
+        traverse(pjh, buf);
+        return {std::move(buf.str())};
+    }
+
+private:
+    static void traverse(ParsedJson::iterator & pjh, WriteBuffer & buf)
+    {
+        switch (pjh.get_type())
+        {
+            case '{':
+            {
+                writeChar('{', buf);
+                if (pjh.down())
+                {
+                    writeJSONString(pjh.get_string(), pjh.get_string() + pjh.get_string_length(), buf, format_settings());
+                    writeChar(':', buf);
+                    pjh.next();
+                    traverse(pjh, buf);
+                    while (pjh.next())
+                    {
+                        writeChar(',', buf);
+                        writeJSONString(pjh.get_string(), pjh.get_string() + pjh.get_string_length(), buf, format_settings());
+                        writeChar(':', buf);
+                        pjh.next();
+                        traverse(pjh, buf);
+                    }
+                    pjh.up();
+                }
+                writeChar('}', buf);
+                break;
+            }
+            case '[':
+            {
+                writeChar('[', buf);
+                if (pjh.down())
+                {
+                    traverse(pjh, buf);
+                    while (pjh.next())
+                    {
+                        writeChar(',', buf);
+                        traverse(pjh, buf);
+                    }
+                    pjh.up();
+                }
+                writeChar(']', buf);
+                break;
+            }
+            case '"':
+            {
+                writeJSONString(pjh.get_string(), pjh.get_string() + pjh.get_string_length(), buf, format_settings());
+                break;
+            }
+            case 'l':
+            {
+                writeIntText(pjh.get_integer(), buf);
+                break;
+            }
+            case 'd':
+            {
+                writeFloatText(pjh.get_double(), buf);
+                break;
+            }
+            case 't':
+            {
+                writeCString("true", buf);
+                break;
+            }
+            case 'f':
+            {
+                writeCString("false", buf);
+                break;
+            }
+            case 'n':
+            {
+                writeCString("null", buf);
+                break;
+            }
+        }
+    }
+
+    static const FormatSettings & format_settings()
+    {
+        static const FormatSettings the_instance = []
+        {
+            FormatSettings settings;
+            settings.json.escape_forward_slashes = false;
+            return settings;
+        }();
+        return the_instance;
+    }
+};
 
 class JSONExtractStringImpl : public JSONNullableImplBase
 {
@@ -360,7 +449,7 @@ struct JSONExtractUIntImpl { static constexpr auto name{"JSONExtractUInt"}; };
 struct JSONExtractIntImpl { static constexpr auto name{"JSONExtractInt"}; };
 struct JSONExtractFloatImpl { static constexpr auto name{"JSONExtractFloat"}; };
 struct JSONExtractBoolImpl { static constexpr auto name{"JSONExtractBool"}; };
-//struct JSONExtractRawImpl { static constexpr auto name {"JSONExtractRaw"}; };
+struct JSONExtractRawImpl { static constexpr auto name {"JSONExtractRaw"}; };
 struct JSONExtractStringImpl { static constexpr auto name{"JSONExtractString"}; };
 struct JSONExtractKeyImpl { static constexpr auto name{"JSONExtractKey"}; };
 }
@@ -382,10 +471,7 @@ void registerFunctionsJSON(FunctionFactory & factory)
         factory.registerFunction>();
         factory.registerFunction>();
         factory.registerFunction>();
-        // factory.registerFunction>();
+        factory.registerFunction>();
         factory.registerFunction>();
         factory.registerFunction>();
         return;
@@ -399,7 +485,7 @@ void registerFunctionsJSON(FunctionFactory & factory)
     factory.registerFunction>();
     factory.registerFunction>();
     factory.registerFunction>();
-    //factory.registerFunction>();
+    factory.registerFunction>();
     factory.registerFunction>();
     factory.registerFunction>();
 }
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
index 38f816cd820..ba6d2eeaa4a 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
@@ -17,3 +17,10 @@ Array
 [-100,NULL,300]
 ['a','hello','b',NULL]
 [(NULL,NULL,NULL),(NULL,NULL,NULL),(NULL,NULL,NULL),(-100,200,44)]
+{"a":"hello","b":[-100,200,300],"c":{"d":[121,144]}}
+"hello"
+[-100,200,300]
+-100
+{"d":[121,144]}
+[121,144]
+144
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
index 3d4f63b854f..5c5ddbd3985 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
@@ -17,3 +17,10 @@ SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, Str
 SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Int32)', 'b');
 SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(String)');
 SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Tuple(Int16, Float32, UInt8))');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'a');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'b');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'b', 1);
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'c');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'c', 'd');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'c', 'd', 2);
diff --git a/docs/en/query_language/functions/json_functions.md b/docs/en/query_language/functions/json_functions.md
index 38a6a6f7404..d20a7a38d2b 100644
--- a/docs/en/query_language/functions/json_functions.md
+++ b/docs/en/query_language/functions/json_functions.md
@@ -157,3 +157,16 @@ select JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, Str
 ```
 
 The usage of accessors is the same as above.
+
+## JSONExtractRaw(params[, accessors]...)
+
+Returns a part of JSON.
+If the part does not exist or has a wrong type, `null` will be returned.
+
+Examples:
+
+```
+select JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300]}', 'b') = '[-100, 200.0, 300]'
+```
+
+The usage of accessors is the same as above.

From 76bda0342b51f3f54b8dfb888b7500b2df315127 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Mon, 13 May 2019 18:05:03 +0300
Subject: [PATCH 165/194] Move ExtraArg to the end of arguments of
 JSONExtract().

---
 dbms/src/Functions/FunctionsJSON.h                        | 8 ++++----
 .../queries/0_stateless/00918_json_functions_avx2.sql     | 2 +-
 docs/en/query_language/functions/json_functions.md        | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h
index d729fc886a0..fb13c990e27 100644
--- a/dbms/src/Functions/FunctionsJSON.h
+++ b/dbms/src/Functions/FunctionsJSON.h
@@ -117,10 +117,10 @@ public:
             if (arguments.size() < 2)
                 throw Exception{"Function " + getName() + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
 
-            auto col_type_const = typeid_cast(arguments[1].column.get());
+            auto col_type_const = typeid_cast(arguments[arguments.size() - 1].column.get());
 
             if (!col_type_const)
-                throw Exception{"Illegal non-const column " + arguments[1].column->getName() + " of argument of function " + getName(),
+                throw Exception{"Illegal non-const column " + arguments[arguments.size() - 1].column->getName() + " of argument of function " + getName(),
                                 ErrorCodes::ILLEGAL_COLUMN};
 
             virtual_type = DataTypeFactory::instance().get(col_type_const->getValue());
@@ -137,7 +137,7 @@ public:
 
         actions.reserve(arguments.size() - 1 - ExtraArg);
 
-        for (const auto i : ext::range(1 + ExtraArg, arguments.size()))
+        for (const auto i : ext::range(1, arguments.size() - ExtraArg))
         {
             if (isString(arguments[i].type))
                 actions.push_back(Action::key);
@@ -194,7 +194,7 @@ public:
                 if (!ok)
                     break;
 
-                ok = tryMove(pjh, actions[j], (*block.getByPosition(arguments[j + 1 + ExtraArg]).column)[i]);
+                ok = tryMove(pjh, actions[j], (*block.getByPosition(arguments[j + 1]).column)[i]);
             }
 
             if (ok)
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
index 5c5ddbd3985..438a256ecf8 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
@@ -14,7 +14,7 @@ SELECT JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1);
 SELECT JSONExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2);
 SELECT JSONExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1);
 SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))');
-SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Int32)', 'b');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 'Array(Int32)');
 SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(String)');
 SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Tuple(Int16, Float32, UInt8))');
 SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}');
diff --git a/docs/en/query_language/functions/json_functions.md b/docs/en/query_language/functions/json_functions.md
index d20a7a38d2b..aee6512a772 100644
--- a/docs/en/query_language/functions/json_functions.md
+++ b/docs/en/query_language/functions/json_functions.md
@@ -143,7 +143,7 @@ select JSONExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1) = 300
 
 The usage of accessors is the same as above.
 
-## JSONExtract(params, type[, accessors]...)
+## JSONExtract(params[, accessors...], type)
 
 Parse data from JSON values with a given ClickHouse data type.
 
@@ -152,7 +152,7 @@ If the value does not exist or has a wrong type, `null` will be returned.
 Examples:
 
 ```
-select JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Int8', 'b', 1) = -100
+select JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1, 'Int8') = -100
 select JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))') = ('a', 'hello', 'b', [-100.0, 200.0, 300.0])
 ```
 

From c93bd3169532f4c597d633ca3e378a75e5188941 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Tue, 14 May 2019 02:44:55 +0300
Subject: [PATCH 166/194] Simplify template implementation.

---
 dbms/src/Core/AccurateComparison.h            |    7 +
 dbms/src/Functions/DummyJSONParser.h          |   46 +
 dbms/src/Functions/FunctionsJSON.cpp          |  480 +-------
 dbms/src/Functions/FunctionsJSON.h            | 1072 ++++++++++++++---
 dbms/src/Functions/SimdJSONParser.h           |  110 ++
 dbms/src/IO/WriteBufferFromVector.h           |   12 +-
 .../00918_json_functions_avx2.reference       |   54 +-
 .../0_stateless/00918_json_functions_avx2.sql |   62 +-
 8 files changed, 1155 insertions(+), 688 deletions(-)
 create mode 100644 dbms/src/Functions/DummyJSONParser.h
 create mode 100644 dbms/src/Functions/SimdJSONParser.h

diff --git a/dbms/src/Core/AccurateComparison.h b/dbms/src/Core/AccurateComparison.h
index af1ea285a89..e26269b136d 100644
--- a/dbms/src/Core/AccurateComparison.h
+++ b/dbms/src/Core/AccurateComparison.h
@@ -430,6 +430,13 @@ inline bool_if_safe_conversion greaterOrEqualsOp(A a, B b)
 template 
 inline bool NO_SANITIZE_UNDEFINED convertNumeric(From value, To & result)
 {
+    /// If the type is actually the same it's not necessary to do any checks.
+    if constexpr (std::is_same_v)
+    {
+        result = value;
+        return true;
+    }
+
     /// Note that NaNs doesn't compare equal to anything, but they are still in range of any Float type.
     if (isNaN(value) && std::is_floating_point_v)
     {
diff --git a/dbms/src/Functions/DummyJSONParser.h b/dbms/src/Functions/DummyJSONParser.h
new file mode 100644
index 00000000000..3b66d4607dc
--- /dev/null
+++ b/dbms/src/Functions/DummyJSONParser.h
@@ -0,0 +1,46 @@
+#pragma once
+
+#include 
+#include 
+#include 
+
+namespace DB
+{
+namespace ErrorCodes
+{
+    extern const int NOT_IMPLEMENTED;
+}
+
+/// This class can be used as an argument for the template class FunctionJSON when we unable to parse JSONs.
+/// It can't do anything useful and just throws an exception.
+struct DummyJSONParser
+{
+    static constexpr bool need_preallocate = false;
+    void preallocate(size_t) {}
+    bool parse(const char *, size_t) { throw Exception{"Functions JSON* are not supported without AVX2", ErrorCodes::NOT_IMPLEMENTED}; }
+
+    using Iterator = std::nullptr_t;
+    Iterator getRoot() const { return nullptr; }
+
+    static bool downToArray(Iterator &) { return false; }
+    static bool downToObject(Iterator &) { return false; }
+    static bool downToObject(Iterator &, StringRef &) { return false; }
+    static bool parentScopeIsObject(const Iterator &) { return false; }
+    static bool next(Iterator &) { return false; }
+    static bool nextKeyValue(Iterator &) { return false; }
+    static bool nextKeyValue(Iterator &, StringRef &) { return false; }
+    static bool isInteger(const Iterator &) { return false; }
+    static bool isFloat(const Iterator &) { return false; }
+    static bool isString(const Iterator &) { return false; }
+    static bool isArray(const Iterator &) { return false; }
+    static bool isObject(const Iterator &) { return false; }
+    static bool isBool(const Iterator &) { return false; }
+    static bool isNull(const Iterator &) { return false; }
+    static StringRef getKey(const Iterator &) { return {}; }
+    static StringRef getString(const Iterator &) { return {}; }
+    static Int64 getInteger(const Iterator &) { return 0; }
+    static double getFloat(const Iterator &) { return 0; }
+    static bool getBool(const Iterator &) { return false; }
+};
+
+}
diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp
index b5ec5fd6c64..9383b58b05a 100644
--- a/dbms/src/Functions/FunctionsJSON.cpp
+++ b/dbms/src/Functions/FunctionsJSON.cpp
@@ -1,459 +1,7 @@
 #include 
-#include 
-#include 
+#include 
+#include 
 
-#if USE_SIMDJSON
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-
-namespace DB
-{
-template 
-class JSONNullableImplBase
-{
-public:
-    static DataTypePtr getType() { return std::make_shared(std::make_shared()); }
-
-    static Field getDefault() { return {}; }
-};
-
-class JSONHasImpl : public JSONNullableImplBase
-{
-public:
-    static constexpr auto name{"JSONHas"};
-
-    static Field getValue(ParsedJson::iterator &) { return {1}; }
-};
-
-class JSONLengthImpl : public JSONNullableImplBase
-{
-public:
-    static constexpr auto name{"JSONLength"};
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        if (!pjh.is_object_or_array())
-            return getDefault();
-
-        size_t size = 0;
-
-        if (pjh.down())
-        {
-            ++size;
-            while (pjh.next())
-                ++size;
-            if (pjh.get_scope_type() == '{')
-                size /= 2;
-        }
-
-        return {size};
-    }
-};
-
-class JSONTypeImpl
-{
-public:
-    static constexpr auto name{"JSONType"};
-
-    static DataTypePtr getType()
-    {
-        static const std::vector> values = {
-            {"Array", '['},
-            {"Object", '{'},
-            {"String", '"'},
-            {"Int", 'l'},
-            {"Float",'d'},
-            {"Bool", 'b'},
-            {"Null",'n'},
-        };
-        return std::make_shared(std::make_shared>(values));
-    }
-
-    static Field getDefault() { return {}; }
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        switch (pjh.get_type())
-        {
-            case '[':
-            case '{':
-            case '"':
-            case 'l':
-            case 'd':
-            case 'n':
-                return {pjh.get_type()};
-            case 't':
-            case 'f':
-                return {'b'};
-            default:
-                return {};
-        }
-    }
-};
-
-class JSONExtractImpl
-{
-public:
-    static constexpr auto name{"JSONExtract"};
-
-    static DataTypePtr getType(const DataTypePtr & type)
-    {
-        WhichDataType which{type};
-
-        if (which.isNativeUInt() || which.isNativeInt() || which.isFloat() || which.isEnum() || which.isDateOrDateTime()
-            || which.isStringOrFixedString() || which.isInterval())
-            return std::make_shared(type);
-
-        if (which.isArray())
-        {
-            auto array_type = static_cast(type.get());
-
-            return std::make_shared(getType(array_type->getNestedType()));
-        }
-
-        if (which.isTuple())
-        {
-            auto tuple_type = static_cast(type.get());
-
-            DataTypes types;
-            types.reserve(tuple_type->getElements().size());
-
-            for (const DataTypePtr & element : tuple_type->getElements())
-            {
-                types.push_back(getType(element));
-            }
-
-            return std::make_shared(std::move(types));
-        }
-
-        throw Exception{"Unsupported return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
-    }
-
-    static Field getDefault(const DataTypePtr & type)
-    {
-        WhichDataType which{type};
-
-        if (which.isNativeUInt() || which.isNativeInt() || which.isFloat() || which.isEnum() || which.isDateOrDateTime()
-            || which.isStringOrFixedString() || which.isInterval())
-            return {};
-
-        if (which.isArray())
-            return {Array{}};
-
-        if (which.isTuple())
-        {
-            auto tuple_type = static_cast(type.get());
-
-            Tuple tuple;
-            tuple.toUnderType().reserve(tuple_type->getElements().size());
-
-            for (const DataTypePtr & element : tuple_type->getElements())
-                tuple.toUnderType().push_back(getDefault(element));
-
-            return {tuple};
-        }
-
-        // should not reach
-        throw Exception{"Unsupported return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
-    }
-
-    static Field getValue(ParsedJson::iterator & pjh, const DataTypePtr & type)
-    {
-        WhichDataType which{type};
-
-        if (which.isNativeUInt() || which.isNativeInt() || which.isEnum() || which.isDateOrDateTime() || which.isInterval())
-        {
-            if (pjh.is_integer())
-                return {pjh.get_integer()};
-            else
-                return getDefault(type);
-        }
-
-        if (which.isFloat())
-        {
-            if (pjh.is_integer())
-                return {static_cast(pjh.get_integer())};
-            else if (pjh.is_double())
-                return {pjh.get_double()};
-            else
-                return getDefault(type);
-        }
-
-        if (which.isStringOrFixedString())
-        {
-            if (pjh.is_string())
-                return {String{pjh.get_string()}};
-            else
-                return getDefault(type);
-        }
-
-        if (which.isArray())
-        {
-            if (!pjh.is_object_or_array())
-                return getDefault(type);
-
-            auto array_type = static_cast(type.get());
-
-            Array array;
-
-            bool first = true;
-
-            while (first ? pjh.down() : pjh.next())
-            {
-                first = false;
-
-                ParsedJson::iterator pjh1{pjh};
-
-                array.push_back(getValue(pjh1, array_type->getNestedType()));
-            }
-
-            return {array};
-        }
-
-        if (which.isTuple())
-        {
-            if (!pjh.is_object_or_array())
-                return getDefault(type);
-
-            auto tuple_type = static_cast(type.get());
-
-            Tuple tuple;
-            tuple.toUnderType().reserve(tuple_type->getElements().size());
-
-            bool valid = true;
-            bool first = true;
-
-            for (const DataTypePtr & element : tuple_type->getElements())
-            {
-                if (valid)
-                {
-                    valid &= first ? pjh.down() : pjh.next();
-                    first = false;
-
-                    ParsedJson::iterator pjh1{pjh};
-
-                    tuple.toUnderType().push_back(getValue(pjh1, element));
-                }
-                else
-                    tuple.toUnderType().push_back(getDefault(element));
-            }
-
-            return {tuple};
-        }
-
-        // should not reach
-        throw Exception{"Unsupported return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
-    }
-};
-
-class JSONExtractUIntImpl : public JSONNullableImplBase
-{
-public:
-    static constexpr auto name{"JSONExtractUInt"};
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        if (pjh.is_integer())
-            return {pjh.get_integer()};
-        else
-            return getDefault();
-    }
-};
-
-class JSONExtractIntImpl : public JSONNullableImplBase
-{
-public:
-    static constexpr auto name{"JSONExtractInt"};
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        if (pjh.is_integer())
-            return {pjh.get_integer()};
-        else
-            return getDefault();
-    }
-};
-
-class JSONExtractFloatImpl : public JSONNullableImplBase
-{
-public:
-    static constexpr auto name{"JSONExtractFloat"};
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        if (pjh.is_double())
-            return {pjh.get_double()};
-        else
-            return getDefault();
-    }
-};
-
-class JSONExtractBoolImpl : public JSONNullableImplBase
-{
-public:
-    static constexpr auto name{"JSONExtractBool"};
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        if (pjh.get_type() == 't')
-            return {1};
-        else if (pjh.get_type() == 'f')
-            return {0};
-        else
-            return getDefault();
-    }
-};
-
-class JSONExtractRawImpl: public JSONNullableImplBase
-{
-public:
-    static constexpr auto name {"JSONExtractRaw"};
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        WriteBufferFromOwnString buf;
-        traverse(pjh, buf);
-        return {std::move(buf.str())};
-    }
-
-private:
-    static void traverse(ParsedJson::iterator & pjh, WriteBuffer & buf)
-    {
-        switch (pjh.get_type())
-        {
-            case '{':
-            {
-                writeChar('{', buf);
-                if (pjh.down())
-                {
-                    writeJSONString(pjh.get_string(), pjh.get_string() + pjh.get_string_length(), buf, format_settings());
-                    writeChar(':', buf);
-                    pjh.next();
-                    traverse(pjh, buf);
-                    while (pjh.next())
-                    {
-                        writeChar(',', buf);
-                        writeJSONString(pjh.get_string(), pjh.get_string() + pjh.get_string_length(), buf, format_settings());
-                        writeChar(':', buf);
-                        pjh.next();
-                        traverse(pjh, buf);
-                    }
-                    pjh.up();
-                }
-                writeChar('}', buf);
-                break;
-            }
-            case '[':
-            {
-                writeChar('[', buf);
-                if (pjh.down())
-                {
-                    traverse(pjh, buf);
-                    while (pjh.next())
-                    {
-                        writeChar(',', buf);
-                        traverse(pjh, buf);
-                    }
-                    pjh.up();
-                }
-                writeChar(']', buf);
-                break;
-            }
-            case '"':
-            {
-                writeJSONString(pjh.get_string(), pjh.get_string() + pjh.get_string_length(), buf, format_settings());
-                break;
-            }
-            case 'l':
-            {
-                writeIntText(pjh.get_integer(), buf);
-                break;
-            }
-            case 'd':
-            {
-                writeFloatText(pjh.get_double(), buf);
-                break;
-            }
-            case 't':
-            {
-                writeCString("true", buf);
-                break;
-            }
-            case 'f':
-            {
-                writeCString("false", buf);
-                break;
-            }
-            case 'n':
-            {
-                writeCString("null", buf);
-                break;
-            }
-        }
-    }
-
-    static const FormatSettings & format_settings()
-    {
-        static const FormatSettings the_instance = []
-        {
-            FormatSettings settings;
-            settings.json.escape_forward_slashes = false;
-            return settings;
-        }();
-        return the_instance;
-    }
-};
-
-class JSONExtractStringImpl : public JSONNullableImplBase
-{
-public:
-    static constexpr auto name{"JSONExtractString"};
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        if (pjh.is_string())
-            return {String{pjh.get_string()}};
-        else
-            return getDefault();
-    }
-};
-
-class JSONExtractKeyImpl : public JSONNullableImplBase
-{
-public:
-    static constexpr auto name{"JSONExtractKey"};
-
-    static Field getValue(ParsedJson::iterator & pjh)
-    {
-        if (pjh.get_scope_type() == '{' && pjh.prev() && pjh.is_string())
-            return {String{pjh.get_string()}};
-        else
-            return getDefault();
-    }
-};
-
-}
-#else
-namespace DB
-{
-struct JSONHasImpl { static constexpr auto name{"JSONHas"}; };
-struct JSONLengthImpl { static constexpr auto name{"JSONLength"}; };
-struct JSONTypeImpl { static constexpr auto name{"JSONType"}; };
-struct JSONExtractImpl { static constexpr auto name{"JSONExtract"}; };
-struct JSONExtractUIntImpl { static constexpr auto name{"JSONExtractUInt"}; };
-struct JSONExtractIntImpl { static constexpr auto name{"JSONExtractInt"}; };
-struct JSONExtractFloatImpl { static constexpr auto name{"JSONExtractFloat"}; };
-struct JSONExtractBoolImpl { static constexpr auto name{"JSONExtractBool"}; };
-struct JSONExtractRawImpl { static constexpr auto name {"JSONExtractRaw"}; };
-struct JSONExtractStringImpl { static constexpr auto name{"JSONExtractString"}; };
-struct JSONExtractKeyImpl { static constexpr auto name{"JSONExtractKey"}; };
-}
-#endif
 
 namespace DB
 {
@@ -463,31 +11,11 @@ void registerFunctionsJSON(FunctionFactory & factory)
 #if USE_SIMDJSON
     if (__builtin_cpu_supports("avx2"))
     {
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
-        factory.registerFunction>();
+        registerFunctionsJSONTemplate(factory);
         return;
     }
 #endif
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
-    factory.registerFunction>();
+    registerFunctionsJSONTemplate(factory);
 }
 
 }
diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h
index fb13c990e27..bcab236bcdd 100644
--- a/dbms/src/Functions/FunctionsJSON.h
+++ b/dbms/src/Functions/FunctionsJSON.h
@@ -1,168 +1,68 @@
 #pragma once
 
 #include 
-#include 
-
-#if USE_SIMDJSON
-
+#include 
+#include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
-#include 
+#include 
+#include 
+#include 
 #include 
 
-#ifdef __clang__
-    #pragma clang diagnostic push
-    #pragma clang diagnostic ignored "-Wold-style-cast"
-    #pragma clang diagnostic ignored "-Wnewline-eof"
-#endif
-
-#include 
-
-#ifdef __clang__
-    #pragma clang diagnostic pop
-#endif
 
 namespace DB
 {
 namespace ErrorCodes
 {
-    extern const int CANNOT_ALLOCATE_MEMORY;
     extern const int ILLEGAL_COLUMN;
     extern const int ILLEGAL_TYPE_OF_ARGUMENT;
     extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
 }
 
-template 
-class FunctionJSONBase : public IFunction
+
+/// Functions to parse JSONs and extract values from it.
+/// The first argument of all these functions gets a JSON,
+/// after that there are any number of arguments specifying path to a desired part from the JSON's root.
+/// For example,
+/// select JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', b, 1) = -100
+template  typename Impl, typename JSONParser>
+class FunctionJSON : public IFunction
 {
-private:
-    enum class Action
-    {
-        key = 1,
-        index = 2,
-    };
-
-    mutable std::vector actions;
-    mutable DataTypePtr virtual_type;
-
-    bool tryMove(ParsedJson::iterator & pjh, Action action, const Field & accessor)
-    {
-        switch (action)
-        {
-            case Action::key:
-                if (!pjh.is_object() || !pjh.move_to_key(accessor.get().data()))
-                    return false;
-
-                break;
-            case Action::index:
-                if (!pjh.is_object_or_array() || !pjh.down())
-                    return false;
-
-                int index = accessor.get();
-                size_t steps;
-                if (index > 0)
-                {
-                    if (pjh.get_scope_type() == '{')
-                        steps = index * 2 - 1;
-                    else
-                        steps = index - 1;
-                }
-                else if (index < 0)
-                {
-                    size_t steps_to_end = 0;
-                    ParsedJson::iterator pjh1{pjh};
-                    while (pjh1.next())
-                        ++steps_to_end;
-
-                    if (pjh.get_scope_type() == '{')
-                        steps = index * 2 + steps_to_end + 2;
-                    else
-                        steps = index + steps_to_end + 1;
-                }
-                else
-                    return false;
-
-                for (const auto i : ext::range(0, steps))
-                {
-                    (void)i;
-
-                    if (!pjh.next())
-                        return false;
-                }
-
-                break;
-        }
-
-        return true;
-    }
-
 public:
-    static constexpr auto name = Impl::name;
-
-    static FunctionPtr create(const Context &) { return std::make_shared(); }
-
-    String getName() const override { return Impl::name; }
-
+    static constexpr auto name = Name::name;
+    static FunctionPtr create(const Context &) { return std::make_shared(); }
+    String getName() const override { return Name::name; }
     bool isVariadic() const override { return true; }
-
     size_t getNumberOfArguments() const override { return 0; }
-
-    bool useDefaultImplementationForConstants() const override { return true; }
-
-    DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override
-    {
-        if constexpr (ExtraArg)
-        {
-            if (arguments.size() < 2)
-                throw Exception{"Function " + getName() + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
-
-            auto col_type_const = typeid_cast(arguments[arguments.size() - 1].column.get());
-
-            if (!col_type_const)
-                throw Exception{"Illegal non-const column " + arguments[arguments.size() - 1].column->getName() + " of argument of function " + getName(),
-                                ErrorCodes::ILLEGAL_COLUMN};
-
-            virtual_type = DataTypeFactory::instance().get(col_type_const->getValue());
-        }
-        else
-        {
-            if (arguments.size() < 1)
-                throw Exception{"Function " + getName() + " requires at least one arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
-        }
-
-        if (!isString(arguments[0].type))
-            throw Exception{"Illegal type " + arguments[0].type->getName() + " of argument of function " + getName(),
-                            ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
-
-        actions.reserve(arguments.size() - 1 - ExtraArg);
-
-        for (const auto i : ext::range(1, arguments.size() - ExtraArg))
-        {
-            if (isString(arguments[i].type))
-                actions.push_back(Action::key);
-            else if (isInteger(arguments[i].type))
-                actions.push_back(Action::index);
-            else
-                throw Exception{"Illegal type " + arguments[i].type->getName() + " of argument of function " + getName(),
-                                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
-        }
-
-        if constexpr (ExtraArg)
-            return Impl::getType(virtual_type);
-        else
-            return Impl::getType();
-    }
+    bool useDefaultImplementationForConstants() const override { return false; }
+    DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override { return Impl::getType(arguments); }
 
     void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result_pos, size_t input_rows_count) override
     {
         MutableColumnPtr to{block.getByPosition(result_pos).type->createColumn()};
         to->reserve(input_rows_count);
 
-        const ColumnPtr & arg_json = block.getByPosition(arguments[0]).column;
+        if (arguments.size() < 1)
+            throw Exception{"Function " + getName() + " requires at least one arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
 
+        const auto & first_column = block.getByPosition(arguments[0]);
+        if (!isString(first_column.type))
+            throw Exception{"Illegal type " + first_column.type->getName() + " of argument of function " + getName(),
+                            ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+
+        const ColumnPtr & arg_json = first_column.column;
         auto col_json_const = typeid_cast(arg_json.get());
-
         auto col_json_string
             = typeid_cast(col_json_const ? col_json_const->getDataColumnPtr().get() : arg_json.get());
 
@@ -172,80 +72,888 @@ public:
         const ColumnString::Chars & chars = col_json_string->getChars();
         const ColumnString::Offsets & offsets = col_json_string->getOffsets();
 
-        size_t max_size = 1;
+        std::vector moves;
+        constexpr size_t num_extra_arguments = Impl::num_extra_arguments;
+        const size_t num_moves = arguments.size() - num_extra_arguments - 1;
+        moves.reserve(num_moves);
+        for (const auto i : ext::range(0, num_moves))
+        {
+            const auto & column = block.getByPosition(arguments[1 + i]);
+            if (column.column->isColumnConst())
+            {
+                const auto & column_const = static_cast(*column.column);
+                if (isString(column.type))
+                    moves.emplace_back(MoveType::ConstKey, column_const.getField().get());
+                else if (isInteger(column.type))
+                    moves.emplace_back(MoveType::ConstIndex, column_const.getField().get());
+                else
+                    throw Exception{"Illegal type " + column.type->getName() + " of argument of function " + getName(),
+                                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+            }
+            else
+            {
+                if (isString(column.type))
+                    moves.emplace_back(MoveType::Key, "");
+                else if (isInteger(column.type))
+                    moves.emplace_back(MoveType::Index, 0);
+                else
+                    throw Exception{"Illegal type " + column.type->getName() + " of argument of function " + getName(),
+                                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+            }
+        }
 
-        for (const auto i : ext::range(0, input_rows_count))
-            if (max_size < offsets[i] - offsets[i - 1] - 1)
-                max_size = offsets[i] - offsets[i - 1] - 1;
+        JSONParser parser;
+        if (parser.need_preallocate)
+        {
+            size_t max_size = 1;
 
-        ParsedJson pj;
-        if (!pj.allocateCapacity(max_size))
-            throw Exception{"Can not allocate memory for " + std::to_string(max_size) + " units when parsing JSON",
-                            ErrorCodes::CANNOT_ALLOCATE_MEMORY};
+            for (const auto i : ext::range(0, input_rows_count))
+                if (max_size < offsets[i] - offsets[i - 1] - 1)
+                    max_size = offsets[i] - offsets[i - 1] - 1;
+
+            parser.preallocate(max_size);
+        }
+
+        Impl impl;
+        impl.prepare(block, arguments, result_pos);
 
         for (const auto i : ext::range(0, input_rows_count))
         {
-            bool ok = json_parse(&chars[offsets[i - 1]], offsets[i] - offsets[i - 1] - 1, pj) == 0;
+            bool ok = parser.parse(reinterpret_cast(&chars[offsets[i - 1]]), offsets[i] - offsets[i - 1] - 1);
 
-            ParsedJson::iterator pjh{pj};
-
-            for (const auto j : ext::range(0, actions.size()))
+            auto it = parser.getRoot();
+            for (const auto j : ext::range(0, moves.size()))
             {
                 if (!ok)
                     break;
 
-                ok = tryMove(pjh, actions[j], (*block.getByPosition(arguments[j + 1]).column)[i]);
+                switch (moves[j].type)
+                {
+                    case MoveType::ConstIndex:
+                        ok = moveIteratorToElementByIndex(it, moves[j].index);
+                        break;
+                    case MoveType::ConstKey:
+                        ok = moveIteratorToElementByKey(it, moves[j].key);
+                        break;
+                    case MoveType::Index:
+                    {
+                        const Field field = (*block.getByPosition(arguments[j + 1]).column)[i];
+                        ok = moveIteratorToElementByIndex(it, field.get());
+                        break;
+                    }
+                    case MoveType::Key:
+                    {
+                        const Field field = (*block.getByPosition(arguments[j + 1]).column)[i];
+                        ok = moveIteratorToElementByKey(it, field.get().data());
+                        break;
+                    }
+                }
             }
 
             if (ok)
+                ok = impl.addValueToColumn(*to, it);
+
+            if (!ok)
+                to->insertDefault();
+        }
+        block.getByPosition(result_pos).column = std::move(to);
+    }
+
+private:
+    enum class MoveType
+    {
+        Key,
+        Index,
+        ConstKey,
+        ConstIndex,
+    };
+    struct Move
+    {
+        Move(MoveType type_, size_t index_ = 0) : type(type_), index(index_) {}
+        Move(MoveType type_, const String & key_) : type(type_), key(key_) {}
+        MoveType type;
+        size_t index = 0;
+        String key;
+    };
+
+    using Iterator = typename JSONParser::Iterator;
+    bool moveIteratorToElementByIndex(Iterator & it, int index)
+    {
+        if (JSONParser::isArray(it))
+        {
+            if (!JSONParser::downToArray(it))
+                return false;
+            size_t steps;
+            if (index > 0)
             {
-                if constexpr (ExtraArg)
-                    to->insert(Impl::getValue(pjh, virtual_type));
-                else
-                    to->insert(Impl::getValue(pjh));
+                steps = index - 1;
             }
             else
             {
-                if constexpr (ExtraArg)
-                    to->insert(Impl::getDefault(virtual_type));
-                else
-                    to->insert(Impl::getDefault());
+                size_t length = 1;
+                Iterator it2 = it;
+                while (JSONParser::next(it2))
+                    ++length;
+                steps = index + length;
+            }
+            while (steps--)
+            {
+                if (!JSONParser::next(it))
+                    return false;
+            }
+            return true;
+        }
+        if (JSONParser::isObject(it))
+        {
+            if (!JSONParser::downToObject(it))
+                return false;
+            size_t steps;
+            if (index > 0)
+            {
+                steps = index - 1;
+            }
+            else
+            {
+                size_t length = 1;
+                Iterator it2 = it;
+                while (JSONParser::nextKeyValue(it2))
+                    ++length;
+                steps = index + length;
+            }
+            while (steps--)
+            {
+                if (!JSONParser::nextKeyValue(it))
+                    return false;
+            }
+            return true;
+        }
+        return false;
+    }
+
+    bool moveIteratorToElementByKey(Iterator & it, const String & key)
+    {
+        if (JSONParser::isObject(it))
+        {
+            StringRef current_key;
+            if (!JSONParser::downToObject(it, current_key))
+                return false;
+            do
+            {
+                if (current_key == key)
+                    return true;
+            } while (JSONParser::nextKeyValue(it, current_key));
+        }
+        return false;
+    }
+};
+
+
+struct NameJSONHas { static constexpr auto name{"JSONHas"}; };
+struct NameJSONLength { static constexpr auto name{"JSONLength"}; };
+struct NameJSONKey { static constexpr auto name{"JSONKey"}; };
+struct NameJSONType { static constexpr auto name{"JSONType"}; };
+struct NameJSONExtractInt { static constexpr auto name{"JSONExtractInt"}; };
+struct NameJSONExtractUInt { static constexpr auto name{"JSONExtractUInt"}; };
+struct NameJSONExtractFloat { static constexpr auto name{"JSONExtractFloat"}; };
+struct NameJSONExtractBool { static constexpr auto name{"JSONExtractBool"}; };
+struct NameJSONExtractString { static constexpr auto name{"JSONExtractString"}; };
+struct NameJSONExtractRaw { static constexpr auto name{"JSONExtractRaw"}; };
+struct NameJSONExtract { static constexpr auto name{"JSONExtract"}; };
+
+
+template 
+class JSONHasImpl
+{
+public:
+    static DataTypePtr getType(const ColumnsWithTypeAndName &) { return std::make_shared(); }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator &)
+    {
+        ColumnVector & col_vec = static_cast &>(dest);
+        col_vec.insertValue(1);
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+};
+
+
+template 
+class JSONLengthImpl
+{
+public:
+    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    {
+        return std::make_shared();
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        size_t size;
+        if (JSONParser::isArray(it))
+        {
+            size = 0;
+            Iterator it2 = it;
+            if (JSONParser::downToArray(it2))
+            {
+                do
+                    ++size;
+                while (JSONParser::next(it2));
+            }
+        }
+        else if (JSONParser::isObject(it))
+        {
+            size = 0;
+            Iterator it2 = it;
+            if (JSONParser::downToObject(it2))
+            {
+                do
+                    ++size;
+                while (JSONParser::nextKeyValue(it2));
+            }
+        }
+        else
+            return false;
+
+        ColumnVector & col_vec = static_cast &>(dest);
+        col_vec.insertValue(size);
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+};
+
+
+template 
+class JSONKeyImpl
+{
+public:
+    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    {
+        return std::make_shared();
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        if (!JSONParser::parentScopeIsObject(it))
+            return false;
+        StringRef key = JSONParser::getKey(it);
+        ColumnString & col_str = static_cast(dest);
+        col_str.insertData(key.data, key.size);
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+};
+
+
+template 
+class JSONTypeImpl
+{
+public:
+    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    {
+        static const std::vector> values = {
+            {"Array", '['},
+            {"Object", '{'},
+            {"String", '"'},
+            {"Integer", 'l'},
+            {"Float", 'd'},
+            {"Bool", 'b'},
+            {"Null", 0},
+        };
+        return std::make_shared>(values);
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        UInt8 type;
+        if (JSONParser::isInteger(it))
+            type = 'l';
+        else if (JSONParser::isFloat(it))
+            type = 'd';
+        else if (JSONParser::isBool(it))
+            type = 'b';
+        else if (JSONParser::isString(it))
+            type = '"';
+        else if (JSONParser::isArray(it))
+            type = '[';
+        else if (JSONParser::isObject(it))
+            type = '{';
+        else if (JSONParser::isNull(it))
+            type = 0;
+        else
+            return false;
+
+        ColumnVector & col_vec = static_cast &>(dest);
+        col_vec.insertValue(type);
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+};
+
+
+template 
+class JSONExtractNumericImpl
+{
+public:
+    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    {
+        return std::make_shared>();
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        NumberType value;
+
+        if (JSONParser::isInteger(it))
+        {
+            if (!accurate::convertNumeric(JSONParser::getInteger(it), value))
+                return false;
+        }
+        else if (JSONParser::isFloat(it))
+        {
+            if (!accurate::convertNumeric(JSONParser::getFloat(it), value))
+                return false;
+        }
+        else if (JSONParser::isBool(it) && std::is_integral_v && convert_bool_to_integer)
+            value = static_cast(JSONParser::getBool(it));
+        else
+            return false;
+
+        auto & col_vec = static_cast &>(dest);
+        col_vec.insertValue(value);
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+};
+
+template 
+using JSONExtractInt8Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractUInt8Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractInt16Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractUInt16Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractInt32Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractUInt32Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractInt64Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractUInt64Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractFloat32Impl = JSONExtractNumericImpl;
+template 
+using JSONExtractFloat64Impl = JSONExtractNumericImpl;
+
+
+template 
+class JSONExtractBoolImpl
+{
+public:
+    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    {
+        return std::make_shared();
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        if (!JSONParser::isBool(it))
+            return false;
+
+        auto & col_vec = static_cast &>(dest);
+        col_vec.insertValue(static_cast(JSONParser::getBool(it)));
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+};
+
+
+template 
+class JSONExtractStringImpl
+{
+public:
+    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    {
+        return std::make_shared();
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        if (!JSONParser::isString(it))
+            return false;
+
+        StringRef str = JSONParser::getString(it);
+        ColumnString & col_str = static_cast(dest);
+        col_str.insertData(str.data, str.size);
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+};
+
+
+template 
+class JSONExtractRawImpl
+{
+public:
+    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    {
+        return std::make_shared();
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        ColumnString & col_str = static_cast(dest);
+        auto & chars = col_str.getChars();
+        WriteBufferFromVector buf(chars, WriteBufferFromVector::AppendModeTag());
+        traverse(it, buf);
+        buf.finish();
+        chars.push_back(0);
+        col_str.getOffsets().push_back(chars.size());
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+
+private:
+    static void traverse(const Iterator & it, WriteBuffer & buf)
+    {
+        if (JSONParser::isInteger(it))
+        {
+            writeIntText(JSONParser::getInteger(it), buf);
+            return;
+        }
+        if (JSONParser::isFloat(it))
+        {
+            writeFloatText(JSONParser::getFloat(it), buf);
+            return;
+        }
+        if (JSONParser::isBool(it))
+        {
+            if (JSONParser::getBool(it))
+                writeCString("true", buf);
+            else
+                writeCString("false", buf);
+            return;
+        }
+        if (JSONParser::isString(it))
+        {
+            writeJSONString(JSONParser::getString(it), buf, format_settings());
+            return;
+        }
+        if (JSONParser::isArray(it))
+        {
+            writeChar('[', buf);
+            Iterator it2 = it;
+            if (JSONParser::downToArray(it2))
+            {
+                traverse(it2, buf);
+                while (JSONParser::next(it2))
+                {
+                    writeChar(',', buf);
+                    traverse(it2, buf);
+                }
+            }
+            writeChar(']', buf);
+            return;
+        }
+        if (JSONParser::isObject(it))
+        {
+            writeChar('{', buf);
+            Iterator it2 = it;
+            StringRef key;
+            if (JSONParser::downToObject(it2, key))
+            {
+                writeJSONString(key, buf, format_settings());
+                writeChar(':', buf);
+                traverse(it2, buf);
+                while (JSONParser::nextKeyValue(it2, key))
+                {
+                    writeChar(',', buf);
+                    writeJSONString(key, buf, format_settings());
+                    writeChar(':', buf);
+                    traverse(it2, buf);
+                }
+            }
+            writeChar('}', buf);
+            return;
+        }
+        if (JSONParser::isNull(it))
+        {
+            writeCString("null", buf);
+            return;
+        }
+    }
+
+    static const FormatSettings & format_settings()
+    {
+        static const FormatSettings the_instance = []
+        {
+            FormatSettings settings;
+            settings.json.escape_forward_slashes = false;
+            return settings;
+        }();
+        return the_instance;
+    }
+};
+
+
+template 
+class JSONExtractImpl
+{
+public:
+    static constexpr size_t num_extra_arguments = 1;
+
+    static DataTypePtr getType(const ColumnsWithTypeAndName & arguments)
+    {
+        if (arguments.size() < 2)
+            throw Exception{"Function JSONExtract requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
+
+        auto col_type_const = typeid_cast(arguments.back().column.get());
+        if (!col_type_const)
+            throw Exception{"Illegal non-const column " + arguments.back().column->getName() + " of the last argument of function JSONExtract",
+                            ErrorCodes::ILLEGAL_COLUMN};
+
+        return DataTypeFactory::instance().get(col_type_const->getValue());
+    }
+
+    void prepare(const Block & block, const ColumnNumbers &, size_t result_pos)
+    {
+        extract_tree = buildExtractTree(block.getByPosition(result_pos).type);
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        return extract_tree->addValueToColumn(dest, it);
+    }
+
+private:
+    class Node
+    {
+    public:
+        Node() {}
+        virtual ~Node() {}
+        virtual bool addValueToColumn(IColumn &, const Iterator &) = 0;
+    };
+
+    template 
+    class NumericNode : public Node
+    {
+    public:
+        bool addValueToColumn(IColumn & dest, const Iterator & it) override
+        {
+            return JSONExtractNumericImpl::addValueToColumn(dest, it);
+        }
+    };
+
+    class StringNode : public Node
+    {
+    public:
+        bool addValueToColumn(IColumn & dest, const Iterator & it) override
+        {
+            return JSONExtractStringImpl::addValueToColumn(dest, it);
+        }
+    };
+
+    class FixedStringNode : public Node
+    {
+    public:
+        bool addValueToColumn(IColumn & dest, const Iterator & it) override
+        {
+            if (!JSONParser::isString(it))
+                return false;
+            auto & col_str = static_cast(dest);
+            StringRef str = JSONParser::getString(it);
+            if (str.size > col_str.getN())
+                return false;
+            col_str.insertData(str.data, str.size);
+            return true;
+        }
+    };
+
+    template 
+    class EnumNode : public Node
+    {
+    public:
+        EnumNode(const std::vector> & name_value_pairs_) : name_value_pairs(name_value_pairs_)
+        {
+            for (const auto & name_value_pair : name_value_pairs)
+            {
+                name_to_value_map.emplace(name_value_pair.first, name_value_pair.second);
+                only_values.emplace(name_value_pair.second);
             }
         }
 
-        block.getByPosition(result_pos).column = std::move(to);
-    }
-};
-}
-#endif
+        bool addValueToColumn(IColumn & dest, const Iterator & it) override
+        {
+            auto & col_vec = static_cast &>(dest);
 
-namespace DB
-{
-namespace ErrorCodes
-{
-    extern const int NOT_IMPLEMENTED;
-}
+            if (JSONParser::isInteger(it))
+            {
+                size_t value = static_cast(JSONParser::getInteger(it));
+                if (!only_values.count(value))
+                    return false;
+                col_vec.insertValue(value);
+                return true;
+            }
 
-template 
-class FunctionJSONDummy : public IFunction
-{
-public:
-    static constexpr auto name = Impl::name;
-    static FunctionPtr create(const Context &) { return std::make_shared(); }
+            if (JSONParser::isString(it))
+            {
+                auto value = name_to_value_map.find(JSONParser::getString(it));
+                if (value == name_to_value_map.end())
+                    return false;
+                col_vec.insertValue(value->second);
+                return true;
+            }
 
-    String getName() const override { return Impl::name; }
-    bool isVariadic() const override { return true; }
-    size_t getNumberOfArguments() const override { return 0; }
+            return false;
+        }
 
-    DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName &) const override
+    private:
+        std::vector> name_value_pairs;
+        std::unordered_map name_to_value_map;
+        std::unordered_set only_values;
+    };
+
+    class NullableNode : public Node
     {
-        throw Exception{"Function " + getName() + " is not supported without AVX2", ErrorCodes::NOT_IMPLEMENTED};
+    public:
+        NullableNode(std::unique_ptr nested_) : nested(std::move(nested_)) {}
+
+        bool addValueToColumn(IColumn & dest, const Iterator & it) override
+        {
+            ColumnNullable & col_null = static_cast(dest);
+            if (!nested->addValueToColumn(col_null.getNestedColumn(), it))
+                return false;
+            col_null.getNullMapColumn().insertValue(0);
+            return true;
+        }
+
+    private:
+        std::unique_ptr nested;
+    };
+
+    class ArrayNode : public Node
+    {
+    public:
+        ArrayNode(std::unique_ptr nested_) : nested(std::move(nested_)) {}
+
+        bool addValueToColumn(IColumn & dest, const Iterator & it) override
+        {
+            if (!JSONParser::isArray(it))
+                return false;
+
+            Iterator it2 = it;
+            if (!JSONParser::downToArray(it2))
+                return false;
+
+            ColumnArray & col_arr = static_cast(dest);
+            auto & data = col_arr.getData();
+            size_t old_size = data.size();
+            bool were_valid_elements = false;
+
+            do
+            {
+                if (nested->addValueToColumn(data, it2))
+                    were_valid_elements = true;
+                else
+                    data.insertDefault();
+            }
+            while (JSONParser::next(it2));
+
+            if (!were_valid_elements)
+            {
+                data.popBack(data.size() - old_size);
+                return false;
+            }
+
+            col_arr.getOffsets().push_back(data.size());
+            return true;
+        }
+
+    private:
+        std::unique_ptr nested;
+    };
+
+    class TupleNode : public Node
+    {
+    public:
+        TupleNode(std::vector> nested_, const std::vector & explicit_names_) : nested(std::move(nested_)), explicit_names(explicit_names_)
+        {
+            for (size_t i = 0; i != explicit_names.size(); ++i)
+                name_to_index_map.emplace(explicit_names[i], i);
+        }
+
+        bool addValueToColumn(IColumn & dest, const Iterator & it) override
+        {
+            ColumnTuple & tuple = static_cast(dest);
+            size_t old_size = dest.size();
+            bool were_valid_elements = false;
+
+            auto set_size = [&](size_t size)
+            {
+                for (size_t i = 0; i != tuple.tupleSize(); ++i)
+                {
+                    auto & col = tuple.getColumn(i);
+                    if (col.size() != size)
+                    {
+                        if (col.size() > size)
+                            col.popBack(col.size() - size);
+                        else
+                            while (col.size() < size)
+                                col.insertDefault();
+                    }
+                }
+            };
+
+            if (JSONParser::isArray(it))
+            {
+                Iterator it2 = it;
+                if (!JSONParser::downToArray(it2))
+                    return false;
+
+                size_t index = 0;
+                do
+                {
+                    if (nested[index]->addValueToColumn(tuple.getColumn(index), it2))
+                        were_valid_elements = true;
+                    else
+                        tuple.getColumn(index).insertDefault();
+                    ++index;
+                }
+                while (JSONParser::next(it2));
+
+                set_size(old_size + static_cast(were_valid_elements));
+                return were_valid_elements;
+            }
+
+            if (JSONParser::isObject(it))
+            {
+                if (name_to_index_map.empty())
+                {
+                    Iterator it2 = it;
+                    if (!JSONParser::downToObject(it2))
+                        return false;
+
+                    size_t index = 0;
+                    do
+                    {
+                        if (nested[index]->addValueToColumn(tuple.getColumn(index), it2))
+                            were_valid_elements = true;
+                        else
+                            tuple.getColumn(index).insertDefault();
+                        ++index;
+                    }
+                    while (JSONParser::nextKeyValue(it2));
+                }
+                else
+                {
+                    Iterator it2 = it;
+                    StringRef key;
+                    if (!JSONParser::downToObject(it2, key))
+                        return false;
+
+                    do
+                    {
+                        auto index = name_to_index_map.find(key);
+                        if (index != name_to_index_map.end())
+                        {
+                            if (nested[index->second]->addValueToColumn(tuple.getColumn(index->second), it2))
+                                were_valid_elements = true;
+                        }
+                    }
+                    while (JSONParser::nextKeyValue(it2, key));
+                }
+
+                set_size(old_size + static_cast(were_valid_elements));
+                return were_valid_elements;
+            }
+
+            return false;
+        }
+
+    private:
+        std::vector> nested;
+        std::vector explicit_names;
+        std::unordered_map name_to_index_map;
+    };
+
+    std::unique_ptr buildExtractTree(const DataTypePtr & type)
+    {
+        switch (type->getTypeId())
+        {
+            case TypeIndex::UInt8: return std::make_unique>();
+            case TypeIndex::UInt16: return std::make_unique>();
+            case TypeIndex::UInt32: return std::make_unique>();
+            case TypeIndex::UInt64: return std::make_unique>();
+            case TypeIndex::Int8: return std::make_unique>();
+            case TypeIndex::Int16: return std::make_unique>();
+            case TypeIndex::Int32: return std::make_unique>();
+            case TypeIndex::Int64: return std::make_unique>();
+            case TypeIndex::Float32: return std::make_unique>();
+            case TypeIndex::Float64: return std::make_unique>();
+            case TypeIndex::String: return std::make_unique();
+            case TypeIndex::FixedString: return std::make_unique();
+            case TypeIndex::Enum8: return std::make_unique>(static_cast(*type).getValues());
+            case TypeIndex::Enum16: return std::make_unique>(static_cast(*type).getValues());
+            case TypeIndex::Nullable: return std::make_unique(buildExtractTree(static_cast(*type).getNestedType()));
+            case TypeIndex::Array: return std::make_unique(buildExtractTree(static_cast(*type).getNestedType()));
+            case TypeIndex::Tuple:
+            {
+                const auto & tuple = static_cast(*type);
+                const auto & tuple_elements = tuple.getElements();
+                std::vector> elements;
+                for (const auto & tuple_element : tuple_elements)
+                    elements.emplace_back(buildExtractTree(tuple_element));
+                return std::make_unique(std::move(elements), tuple.haveExplicitNames() ? tuple.getElementNames() : Strings{});
+            }
+            default:
+                throw Exception{"Unsupported return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+        }
     }
 
-    void executeImpl(Block &, const ColumnNumbers &, size_t, size_t) override
-    {
-        throw Exception{"Function " + getName() + " is not supported without AVX2", ErrorCodes::NOT_IMPLEMENTED};
-    }
+    std::unique_ptr extract_tree;
 };
 
+
+template 
+void registerFunctionsJSONTemplate(FunctionFactory & factory)
+{
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
+}
+
 }
diff --git a/dbms/src/Functions/SimdJSONParser.h b/dbms/src/Functions/SimdJSONParser.h
new file mode 100644
index 00000000000..103b4a4b9c0
--- /dev/null
+++ b/dbms/src/Functions/SimdJSONParser.h
@@ -0,0 +1,110 @@
+#pragma once
+
+#include 
+#if USE_SIMDJSON
+
+#include 
+#include 
+#include 
+
+#ifdef __clang__
+    #pragma clang diagnostic push
+    #pragma clang diagnostic ignored "-Wold-style-cast"
+    #pragma clang diagnostic ignored "-Wnewline-eof"
+#endif
+
+#include 
+
+#ifdef __clang__
+    #pragma clang diagnostic pop
+#endif
+
+
+namespace DB
+{
+namespace ErrorCodes
+{
+    extern const int CANNOT_ALLOCATE_MEMORY;
+}
+
+/// This class can be used as an argument for the template class FunctionJSON.
+/// It provides ability to parse JSONs using simdjson library.
+struct SimdJSONParser
+{
+    static constexpr bool need_preallocate = true;
+
+    void preallocate(size_t max_size)
+    {
+        if (!pj.allocateCapacity(max_size))
+            throw Exception{"Can not allocate memory for " + std::to_string(max_size) + " units when parsing JSON",
+                            ErrorCodes::CANNOT_ALLOCATE_MEMORY};
+    }
+
+    bool parse(const char * data, size_t size) { return !json_parse(data, size, pj); }
+
+    using Iterator = ParsedJson::iterator;
+    Iterator getRoot() { return Iterator{pj}; }
+
+    static bool downToArray(Iterator & it) { return it.down(); }
+
+    static bool downToObject(Iterator & it) { return it.down() && it.next(); }
+
+    static bool downToObject(Iterator & it, StringRef & first_key)
+    {
+        if (!it.down())
+            return false;
+        first_key.data = it.get_string();
+        first_key.size = it.get_string_length();
+        return it.next();
+    }
+
+    static bool parentScopeIsObject(const Iterator & it) { return it.get_scope_type() == '{'; }
+
+    static bool next(Iterator & it) { return it.next(); }
+
+    static bool nextKeyValue(Iterator & it) { return it.next() && it.next(); }
+
+    static bool nextKeyValue(Iterator & it, StringRef & key)
+    {
+        if (!it.next())
+            return false;
+        key.data = it.get_string();
+        key.size = it.get_string_length();
+        return it.next();
+    }
+
+    static bool isInteger(const Iterator & it) { return it.is_integer(); }
+
+    static bool isFloat(const Iterator & it) { return it.is_double(); }
+
+    static bool isString(const Iterator & it) { return it.is_string(); }
+
+    static bool isArray(const Iterator & it) { return it.is_array(); }
+
+    static bool isObject(const Iterator & it) { return it.is_object(); }
+
+    static bool isBool(const Iterator & it) { return it.get_type() == 't' || it.get_type() == 'f'; }
+
+    static bool isNull(const Iterator & it) { return it.get_type() == 'n'; }
+
+    static StringRef getKey(const Iterator & it)
+    {
+        Iterator it2 = it;
+        it2.prev();
+        return StringRef{it2.get_string(), it2.get_string_length()};
+    }
+
+    static StringRef getString(const Iterator & it) { return StringRef{it.get_string(), it.get_string_length()}; }
+
+    static Int64 getInteger(const Iterator & it) { return it.get_integer(); }
+
+    static double getFloat(const Iterator & it) { return it.get_double(); }
+
+    static bool getBool(const Iterator & it) { return it.get_type() == 't'; }
+
+private:
+    ParsedJson pj;
+};
+
+}
+#endif
diff --git a/dbms/src/IO/WriteBufferFromVector.h b/dbms/src/IO/WriteBufferFromVector.h
index e52ff7d8411..2c5dedfd664 100644
--- a/dbms/src/IO/WriteBufferFromVector.h
+++ b/dbms/src/IO/WriteBufferFromVector.h
@@ -38,18 +38,28 @@ private:
         working_buffer = internal_buffer;
     }
 
+    static constexpr size_t initial_size = 32;
+
 public:
     WriteBufferFromVector(VectorType & vector_)
         : WriteBuffer(reinterpret_cast(vector_.data()), vector_.size()), vector(vector_)
     {
         if (vector.empty())
         {
-            static constexpr size_t initial_size = 32;
             vector.resize(initial_size);
             set(reinterpret_cast(vector.data()), vector.size());
         }
     }
 
+    struct AppendModeTag {};
+    WriteBufferFromVector(VectorType & vector_, AppendModeTag)
+        : WriteBuffer(nullptr, 0), vector(vector_)
+    {
+        size_t old_size = vector.size();
+        vector.resize(vector.capacity() < initial_size ? initial_size : vector.capacity());
+        set(reinterpret_cast(vector.data() + old_size), (vector.size() - old_size) * sizeof(typename VectorType::value_type));
+    }
+
     void finish()
     {
         if (is_finished)
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
index ba6d2eeaa4a..8d98d3202db 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
@@ -1,26 +1,52 @@
+--JSONLength--
 2
-Object
-1
-1
-a
-b
-b
-a
-hello
-hello
 3
+0
+--JSONHas--
+1
+1
+0
+--JSONKey--
+a
+b
+b
+a
+--JSONType--
+Object
 Array
+--JSONExtract--
+hello
+hello
 -100
 200
 300
-('a','hello','b',[-100,200,300])
-[-100,NULL,300]
-['a','hello','b',NULL]
-[(NULL,NULL,NULL),(NULL,NULL,NULL),(NULL,NULL,NULL),(-100,200,44)]
-{"a":"hello","b":[-100,200,300],"c":{"d":[121,144]}}
+1
+--JSONExtract (generic)--
+('hello',[-100,200,300])
+('hello',[-100,200,300])
+([-100,200,300],'hello')
+('hello\0',0)
+hello
+[-100,200,300]
+(-100,200,300)
+[-100,0,0]
+[-100,NULL,NULL]
+[0,200,0]
+[NULL,200,NULL]
+-100
+200
+\N
+Thursday
+Friday
+--JSONExtractRaw--
+{"a":"hello","b":[-100,200,300]}
 "hello"
 [-100,200,300]
 -100
+{"a":"hello","b":[-100,200,300],"c":{"d":[121,144]}}
 {"d":[121,144]}
 [121,144]
 144
+
+{"passed":true}
+{}
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
index 438a256ecf8..5654b3528a5 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
@@ -1,26 +1,58 @@
+SELECT '--JSONLength--';
 SELECT JSONLength('{"a": "hello", "b": [-100, 200.0, 300]}');
-SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}');
+SELECT JSONLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
+SELECT JSONLength('{}');
+
+SELECT '--JSONHas--';
 SELECT JSONHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
 SELECT JSONHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
-SELECT JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
-SELECT JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', 2);
-SELECT JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -1);
-SELECT JSONExtractKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2);
-SELECT JSONExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
-SELECT JSONExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
-SELECT JSONLength('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
+SELECT JSONHas('{"a": "hello", "b": [-100, 200.0, 300]}', 'c');
+
+SELECT '--JSONKey--';
+SELECT JSONKey('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
+SELECT JSONKey('{"a": "hello", "b": [-100, 200.0, 300]}', 2);
+SELECT JSONKey('{"a": "hello", "b": [-100, 200.0, 300]}', -1);
+SELECT JSONKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2);
+
+SELECT '--JSONType--';
+SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}');
 SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
+
+SELECT '--JSONExtract--';
+SELECT JSONExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
+SELECT JSONExtractString('{"a": "hello", "b": [-100, 200.0, 300]}', 1);
 SELECT JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1);
 SELECT JSONExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2);
 SELECT JSONExtractUInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', -1);
-SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, String, String, Array(Float64))');
-SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 'Array(Int32)');
-SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(String)');
-SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Tuple(Int16, Float32, UInt8))');
+SELECT JSONExtractBool('{"passed": true}', 'passed');
+
+SELECT '--JSONExtract (generic)--';
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(String, Array(Float64))');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(a String, b Array(Float64))');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(b Array(Float64), a String)');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'Tuple(a FixedString(6), c UInt8)');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'a', 'String');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 'Array(Float32)');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 'Tuple(Int8, Float32, UInt16)');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 'Array(Int8)');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 'Array(Nullable(Int8))');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 'Array(UInt8)');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 'Array(Nullable(UInt8))');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1, 'Int8');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2, 'Int32');
+SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 4, 'Nullable(Int64)');
+SELECT JSONExtract('{"day": "Thursday"}', 'day', 'Enum8(\'Sunday\' = 0, \'Monday\' = 1, \'Tuesday\' = 2, \'Wednesday\' = 3, \'Thursday\' = 4, \'Friday\' = 5, \'Saturday\' = 6)');
+SELECT JSONExtract('{"day": 5}', 'day', 'Enum8(\'Sunday\' = 0, \'Monday\' = 1, \'Tuesday\' = 2, \'Wednesday\' = 3, \'Thursday\' = 4, \'Friday\' = 5, \'Saturday\' = 6)');
+
+SELECT '--JSONExtractRaw--';
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300]}');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300]}', 'a');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1);
 SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}');
-SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'a');
-SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'b');
-SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'b', 1);
 SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'c');
 SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'c', 'd');
 SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'c', 'd', 2);
+SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'c', 'd', 3);
+SELECT JSONExtractRaw('{"passed": true}');
+SELECT JSONExtractRaw('{}');

From edf1c42c7b372bd5834a473239fabb5fbfa4b420 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Thu, 16 May 2019 01:00:05 +0300
Subject: [PATCH 167/194] Add comments to the class template FunctionJSON.

---
 dbms/src/Functions/FunctionsJSON.h | 131 ++++++++++++++++++-----------
 1 file changed, 81 insertions(+), 50 deletions(-)

diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h
index bcab236bcdd..0d340f6cd73 100644
--- a/dbms/src/Functions/FunctionsJSON.h
+++ b/dbms/src/Functions/FunctionsJSON.h
@@ -35,7 +35,7 @@ namespace ErrorCodes
 /// The first argument of all these functions gets a JSON,
 /// after that there are any number of arguments specifying path to a desired part from the JSON's root.
 /// For example,
-/// select JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', b, 1) = -100
+/// select JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1) = -100
 template  typename Impl, typename JSONParser>
 class FunctionJSON : public IFunction
 {
@@ -46,7 +46,11 @@ public:
     bool isVariadic() const override { return true; }
     size_t getNumberOfArguments() const override { return 0; }
     bool useDefaultImplementationForConstants() const override { return false; }
-    DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override { return Impl::getType(arguments); }
+
+    DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override
+    {
+        return Impl::getType(Name::name, arguments);
+    }
 
     void executeImpl(Block & block, const ColumnNumbers & arguments, size_t result_pos, size_t input_rows_count) override
     {
@@ -54,11 +58,11 @@ public:
         to->reserve(input_rows_count);
 
         if (arguments.size() < 1)
-            throw Exception{"Function " + getName() + " requires at least one arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
+            throw Exception{"Function " + getName() + " requires at least one argument", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
 
         const auto & first_column = block.getByPosition(arguments[0]);
         if (!isString(first_column.type))
-            throw Exception{"Illegal type " + first_column.type->getName() + " of argument of function " + getName(),
+            throw Exception{"The first argument of function " + getName() + " should be a string containing JSON, illegal type: " + first_column.type->getName(),
                             ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
 
         const ColumnPtr & arg_json = first_column.column;
@@ -67,55 +71,60 @@ public:
             = typeid_cast(col_json_const ? col_json_const->getDataColumnPtr().get() : arg_json.get());
 
         if (!col_json_string)
-            throw Exception{"Illegal column " + arg_json->getName() + " of argument of function " + getName(), ErrorCodes::ILLEGAL_COLUMN};
+            throw Exception{"Illegal column " + arg_json->getName(), ErrorCodes::ILLEGAL_COLUMN};
 
         const ColumnString::Chars & chars = col_json_string->getChars();
         const ColumnString::Offsets & offsets = col_json_string->getOffsets();
 
+        /// Prepare list of moves.
         std::vector moves;
         constexpr size_t num_extra_arguments = Impl::num_extra_arguments;
         const size_t num_moves = arguments.size() - num_extra_arguments - 1;
         moves.reserve(num_moves);
         for (const auto i : ext::range(0, num_moves))
         {
-            const auto & column = block.getByPosition(arguments[1 + i]);
+            const auto & column = block.getByPosition(arguments[i + 1]);
+            if (!isString(column.type) && !isInteger(column.type))
+                throw Exception{"The argument " + std::to_string(i + 2) + " of function " + getName()
+                                    + " should be a string specifying key or an integer specifying index, illegal type: " + column.type->getName(),
+                                ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+
             if (column.column->isColumnConst())
             {
                 const auto & column_const = static_cast(*column.column);
                 if (isString(column.type))
                     moves.emplace_back(MoveType::ConstKey, column_const.getField().get());
-                else if (isInteger(column.type))
-                    moves.emplace_back(MoveType::ConstIndex, column_const.getField().get());
                 else
-                    throw Exception{"Illegal type " + column.type->getName() + " of argument of function " + getName(),
-                                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+                    moves.emplace_back(MoveType::ConstIndex, column_const.getField().get());
             }
             else
             {
                 if (isString(column.type))
                     moves.emplace_back(MoveType::Key, "");
-                else if (isInteger(column.type))
-                    moves.emplace_back(MoveType::Index, 0);
                 else
-                    throw Exception{"Illegal type " + column.type->getName() + " of argument of function " + getName(),
-                                    ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+                    moves.emplace_back(MoveType::Index, 0);
             }
         }
 
+        /// Preallocate memory in parser if necessary.
         JSONParser parser;
         if (parser.need_preallocate)
         {
-            size_t max_size = 1;
-
+            size_t max_size = 0;
             for (const auto i : ext::range(0, input_rows_count))
-                if (max_size < offsets[i] - offsets[i - 1] - 1)
-                    max_size = offsets[i] - offsets[i - 1] - 1;
+                if (max_size < offsets[i] - offsets[i - 1])
+                    max_size = offsets[i] - offsets[i - 1];
+
+            if (max_size < 1)
+                max_size = 1;
 
             parser.preallocate(max_size);
         }
 
         Impl impl;
-        impl.prepare(block, arguments, result_pos);
+
+        /// prepare() does Impl-specific preparation before handling each row.
+        impl.prepare(Name::name, block, arguments, result_pos);
 
         for (const auto i : ext::range(0, input_rows_count))
         {
@@ -127,6 +136,7 @@ public:
                 if (!ok)
                     break;
 
+                /// Perform moves.
                 switch (moves[j].type)
                 {
                     case MoveType::ConstIndex:
@@ -153,6 +163,7 @@ public:
             if (ok)
                 ok = impl.addValueToColumn(*to, it);
 
+            /// We add default value (=null or zero) if something goes wrong, we don't throw exceptions in these JSON functions.
             if (!ok)
                 to->insertDefault();
         }
@@ -160,6 +171,10 @@ public:
     }
 
 private:
+    /// Represents a move of a JSON iterator described by a single argument passed to a JSON function.
+    /// For example, the call JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1)
+    /// contains two moves: {MoveType::ConstKey, "b"} and {MoveType::ConstIndex, 1}.
+    /// Keys and indices can be nonconst, in this case they are calculated for each row.
     enum class MoveType
     {
         Key,
@@ -177,6 +192,8 @@ private:
     };
 
     using Iterator = typename JSONParser::Iterator;
+
+    /// Performs moves of types MoveType::Index and MoveType::ConstIndex.
     bool moveIteratorToElementByIndex(Iterator & it, int index)
     {
         if (JSONParser::isArray(it))
@@ -230,6 +247,7 @@ private:
         return false;
     }
 
+    /// Performs moves of types MoveType::Key and MoveType::ConstKey.
     bool moveIteratorToElementByKey(Iterator & it, const String & key)
     {
         if (JSONParser::isObject(it))
@@ -265,7 +283,7 @@ template 
 class JSONHasImpl
 {
 public:
-    static DataTypePtr getType(const ColumnsWithTypeAndName &) { return std::make_shared(); }
+    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &) { return std::make_shared(); }
 
     using Iterator = typename JSONParser::Iterator;
     static bool addValueToColumn(IColumn & dest, const Iterator &)
@@ -276,7 +294,7 @@ public:
     }
 
     static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
 };
 
 
@@ -284,7 +302,7 @@ template 
 class JSONLengthImpl
 {
 public:
-    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &)
     {
         return std::make_shared();
     }
@@ -324,7 +342,7 @@ public:
     }
 
     static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
 };
 
 
@@ -332,7 +350,7 @@ template 
 class JSONKeyImpl
 {
 public:
-    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &)
     {
         return std::make_shared();
     }
@@ -349,7 +367,7 @@ public:
     }
 
     static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
 };
 
 
@@ -357,7 +375,7 @@ template 
 class JSONTypeImpl
 {
 public:
-    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &)
     {
         static const std::vector> values = {
             {"Array", '['},
@@ -366,7 +384,7 @@ public:
             {"Integer", 'l'},
             {"Float", 'd'},
             {"Bool", 'b'},
-            {"Null", 0},
+            {"Null", 0}, /// the default value for the column.
         };
         return std::make_shared>(values);
     }
@@ -398,7 +416,7 @@ public:
     }
 
     static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
 };
 
 
@@ -406,7 +424,7 @@ template >();
     }
@@ -437,7 +455,7 @@ public:
     }
 
     static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
 };
 
 template 
@@ -466,7 +484,7 @@ template 
 class JSONExtractBoolImpl
 {
 public:
-    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &)
     {
         return std::make_shared();
     }
@@ -483,7 +501,7 @@ public:
     }
 
     static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
 };
 
 
@@ -491,7 +509,7 @@ template 
 class JSONExtractStringImpl
 {
 public:
-    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &)
     {
         return std::make_shared();
     }
@@ -509,7 +527,7 @@ public:
     }
 
     static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
 };
 
 
@@ -517,7 +535,7 @@ template 
 class JSONExtractRawImpl
 {
 public:
-    static DataTypePtr getType(const ColumnsWithTypeAndName &)
+    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &)
     {
         return std::make_shared();
     }
@@ -536,7 +554,7 @@ public:
     }
 
     static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const Block &, const ColumnNumbers &, size_t) {}
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
 
 private:
     static void traverse(const Iterator & it, WriteBuffer & buf)
@@ -627,22 +645,24 @@ class JSONExtractImpl
 public:
     static constexpr size_t num_extra_arguments = 1;
 
-    static DataTypePtr getType(const ColumnsWithTypeAndName & arguments)
+    static DataTypePtr getType(const char * function_name, const ColumnsWithTypeAndName & arguments)
     {
         if (arguments.size() < 2)
-            throw Exception{"Function JSONExtract requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
+            throw Exception{"Function " + String(function_name) + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
 
-        auto col_type_const = typeid_cast(arguments.back().column.get());
-        if (!col_type_const)
-            throw Exception{"Illegal non-const column " + arguments.back().column->getName() + " of the last argument of function JSONExtract",
+        const auto & col = arguments.back();
+        auto col_type_const = typeid_cast(col.column.get());
+        if (!col_type_const || !isString(col.type))
+            throw Exception{"The last argument of function " + String(function_name)
+                                + " should be a constant string specifying the data type, illegal value: " + col.column->getName(),
                             ErrorCodes::ILLEGAL_COLUMN};
 
         return DataTypeFactory::instance().get(col_type_const->getValue());
     }
 
-    void prepare(const Block & block, const ColumnNumbers &, size_t result_pos)
+    void prepare(const char * function_name, const Block & block, const ColumnNumbers &, size_t result_pos)
     {
-        extract_tree = buildExtractTree(block.getByPosition(result_pos).type);
+        extract_tree = buildExtractTree(function_name, block.getByPosition(result_pos).type);
     }
 
     using Iterator = typename JSONParser::Iterator;
@@ -652,6 +672,7 @@ public:
     }
 
 private:
+    /// Node of the extract tree. We need a tree to extract complex values containing array, tuples or nullables.
     class Node
     {
     public:
@@ -902,7 +923,7 @@ private:
         std::unordered_map name_to_index_map;
     };
 
-    std::unique_ptr buildExtractTree(const DataTypePtr & type)
+    std::unique_ptr buildExtractTree(const char * function_name, const DataTypePtr & type)
     {
         switch (type->getTypeId())
         {
@@ -918,21 +939,31 @@ private:
             case TypeIndex::Float64: return std::make_unique>();
             case TypeIndex::String: return std::make_unique();
             case TypeIndex::FixedString: return std::make_unique();
-            case TypeIndex::Enum8: return std::make_unique>(static_cast(*type).getValues());
-            case TypeIndex::Enum16: return std::make_unique>(static_cast(*type).getValues());
-            case TypeIndex::Nullable: return std::make_unique(buildExtractTree(static_cast(*type).getNestedType()));
-            case TypeIndex::Array: return std::make_unique(buildExtractTree(static_cast(*type).getNestedType()));
+            case TypeIndex::Enum8:
+                return std::make_unique>(static_cast(*type).getValues());
+            case TypeIndex::Enum16:
+                return std::make_unique>(static_cast(*type).getValues());
+            case TypeIndex::Nullable:
+            {
+                return std::make_unique(
+                    buildExtractTree(function_name, static_cast(*type).getNestedType()));
+            }
+            case TypeIndex::Array:
+            {
+                return std::make_unique(
+                    buildExtractTree(function_name, static_cast(*type).getNestedType()));
+            }
             case TypeIndex::Tuple:
             {
                 const auto & tuple = static_cast(*type);
                 const auto & tuple_elements = tuple.getElements();
                 std::vector> elements;
                 for (const auto & tuple_element : tuple_elements)
-                    elements.emplace_back(buildExtractTree(tuple_element));
+                    elements.emplace_back(buildExtractTree(function_name, tuple_element));
                 return std::make_unique(std::move(elements), tuple.haveExplicitNames() ? tuple.getElementNames() : Strings{});
             }
             default:
-                throw Exception{"Unsupported return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
+                throw Exception{"Function " + String(function_name) + " doesn't support the return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
         }
     }
 

From 99ab74acc6758904a29aef161956c781447bf2d4 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Thu, 16 May 2019 01:45:11 +0300
Subject: [PATCH 168/194] Use CpuFlagsCache instead of __builtin_cpu_supports.

---
 dbms/src/Functions/FunctionsJSON.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp
index 9383b58b05a..d8c33945f52 100644
--- a/dbms/src/Functions/FunctionsJSON.cpp
+++ b/dbms/src/Functions/FunctionsJSON.cpp
@@ -1,6 +1,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 namespace DB
@@ -9,7 +10,7 @@ namespace DB
 void registerFunctionsJSON(FunctionFactory & factory)
 {
 #if USE_SIMDJSON
-    if (__builtin_cpu_supports("avx2"))
+    if (Cpu::CpuFlagsCache::have_AVX2)
     {
         registerFunctionsJSONTemplate(factory);
         return;

From f4942007e1c4e5b210a0e7b75139a8159def9c50 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Thu, 16 May 2019 02:56:10 +0300
Subject: [PATCH 169/194] Add function JSONExtractKeysAndValues().

---
 dbms/src/Functions/FunctionsJSON.h            | 368 +++++++++++-------
 .../00918_json_functions_avx2.reference       |   5 +
 .../0_stateless/00918_json_functions_avx2.sql |   6 +
 3 files changed, 232 insertions(+), 147 deletions(-)

diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h
index 0d340f6cd73..acf853b6c83 100644
--- a/dbms/src/Functions/FunctionsJSON.h
+++ b/dbms/src/Functions/FunctionsJSON.h
@@ -275,8 +275,9 @@ struct NameJSONExtractUInt { static constexpr auto name{"JSONExtractUInt"}; };
 struct NameJSONExtractFloat { static constexpr auto name{"JSONExtractFloat"}; };
 struct NameJSONExtractBool { static constexpr auto name{"JSONExtractBool"}; };
 struct NameJSONExtractString { static constexpr auto name{"JSONExtractString"}; };
-struct NameJSONExtractRaw { static constexpr auto name{"JSONExtractRaw"}; };
 struct NameJSONExtract { static constexpr auto name{"JSONExtract"}; };
+struct NameJSONExtractKeysAndValues { static constexpr auto name{"JSONExtractKeysAndValues"}; };
+struct NameJSONExtractRaw { static constexpr auto name{"JSONExtractRaw"}; };
 
 
 template 
@@ -531,148 +532,12 @@ public:
 };
 
 
+/// Nodes of the extract tree. We need the extract tree to extract from JSON complex values containing array, tuples or nullables.
 template 
-class JSONExtractRawImpl
+struct JSONExtractTree
 {
-public:
-    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &)
-    {
-        return std::make_shared();
-    }
-
     using Iterator = typename JSONParser::Iterator;
-    static bool addValueToColumn(IColumn & dest, const Iterator & it)
-    {
-        ColumnString & col_str = static_cast(dest);
-        auto & chars = col_str.getChars();
-        WriteBufferFromVector buf(chars, WriteBufferFromVector::AppendModeTag());
-        traverse(it, buf);
-        buf.finish();
-        chars.push_back(0);
-        col_str.getOffsets().push_back(chars.size());
-        return true;
-    }
 
-    static constexpr size_t num_extra_arguments = 0;
-    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
-
-private:
-    static void traverse(const Iterator & it, WriteBuffer & buf)
-    {
-        if (JSONParser::isInteger(it))
-        {
-            writeIntText(JSONParser::getInteger(it), buf);
-            return;
-        }
-        if (JSONParser::isFloat(it))
-        {
-            writeFloatText(JSONParser::getFloat(it), buf);
-            return;
-        }
-        if (JSONParser::isBool(it))
-        {
-            if (JSONParser::getBool(it))
-                writeCString("true", buf);
-            else
-                writeCString("false", buf);
-            return;
-        }
-        if (JSONParser::isString(it))
-        {
-            writeJSONString(JSONParser::getString(it), buf, format_settings());
-            return;
-        }
-        if (JSONParser::isArray(it))
-        {
-            writeChar('[', buf);
-            Iterator it2 = it;
-            if (JSONParser::downToArray(it2))
-            {
-                traverse(it2, buf);
-                while (JSONParser::next(it2))
-                {
-                    writeChar(',', buf);
-                    traverse(it2, buf);
-                }
-            }
-            writeChar(']', buf);
-            return;
-        }
-        if (JSONParser::isObject(it))
-        {
-            writeChar('{', buf);
-            Iterator it2 = it;
-            StringRef key;
-            if (JSONParser::downToObject(it2, key))
-            {
-                writeJSONString(key, buf, format_settings());
-                writeChar(':', buf);
-                traverse(it2, buf);
-                while (JSONParser::nextKeyValue(it2, key))
-                {
-                    writeChar(',', buf);
-                    writeJSONString(key, buf, format_settings());
-                    writeChar(':', buf);
-                    traverse(it2, buf);
-                }
-            }
-            writeChar('}', buf);
-            return;
-        }
-        if (JSONParser::isNull(it))
-        {
-            writeCString("null", buf);
-            return;
-        }
-    }
-
-    static const FormatSettings & format_settings()
-    {
-        static const FormatSettings the_instance = []
-        {
-            FormatSettings settings;
-            settings.json.escape_forward_slashes = false;
-            return settings;
-        }();
-        return the_instance;
-    }
-};
-
-
-template 
-class JSONExtractImpl
-{
-public:
-    static constexpr size_t num_extra_arguments = 1;
-
-    static DataTypePtr getType(const char * function_name, const ColumnsWithTypeAndName & arguments)
-    {
-        if (arguments.size() < 2)
-            throw Exception{"Function " + String(function_name) + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
-
-        const auto & col = arguments.back();
-        auto col_type_const = typeid_cast(col.column.get());
-        if (!col_type_const || !isString(col.type))
-            throw Exception{"The last argument of function " + String(function_name)
-                                + " should be a constant string specifying the data type, illegal value: " + col.column->getName(),
-                            ErrorCodes::ILLEGAL_COLUMN};
-
-        return DataTypeFactory::instance().get(col_type_const->getValue());
-    }
-
-    void prepare(const char * function_name, const Block & block, const ColumnNumbers &, size_t result_pos)
-    {
-        extract_tree = buildExtractTree(function_name, block.getByPosition(result_pos).type);
-    }
-
-    using Iterator = typename JSONParser::Iterator;
-    bool addValueToColumn(IColumn & dest, const Iterator & it)
-    {
-        return extract_tree->addValueToColumn(dest, it);
-    }
-
-private:
-    /// Node of the extract tree. We need a tree to extract complex values containing array, tuples or nullables.
     class Node
     {
     public:
@@ -923,7 +788,7 @@ private:
         std::unordered_map name_to_index_map;
     };
 
-    std::unique_ptr buildExtractTree(const char * function_name, const DataTypePtr & type)
+    static std::unique_ptr build(const char * function_name, const DataTypePtr & type)
     {
         switch (type->getTypeId())
         {
@@ -945,13 +810,11 @@ private:
                 return std::make_unique>(static_cast(*type).getValues());
             case TypeIndex::Nullable:
             {
-                return std::make_unique(
-                    buildExtractTree(function_name, static_cast(*type).getNestedType()));
+                return std::make_unique(build(function_name, static_cast(*type).getNestedType()));
             }
             case TypeIndex::Array:
             {
-                return std::make_unique(
-                    buildExtractTree(function_name, static_cast(*type).getNestedType()));
+                return std::make_unique(build(function_name, static_cast(*type).getNestedType()));
             }
             case TypeIndex::Tuple:
             {
@@ -959,15 +822,225 @@ private:
                 const auto & tuple_elements = tuple.getElements();
                 std::vector> elements;
                 for (const auto & tuple_element : tuple_elements)
-                    elements.emplace_back(buildExtractTree(function_name, tuple_element));
+                    elements.emplace_back(build(function_name, tuple_element));
                 return std::make_unique(std::move(elements), tuple.haveExplicitNames() ? tuple.getElementNames() : Strings{});
             }
             default:
                 throw Exception{"Function " + String(function_name) + " doesn't support the return type schema: " + type->getName(), ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT};
         }
     }
+};
 
-    std::unique_ptr extract_tree;
+template 
+class JSONExtractImpl
+{
+public:
+    static constexpr size_t num_extra_arguments = 1;
+
+    static DataTypePtr getType(const char * function_name, const ColumnsWithTypeAndName & arguments)
+    {
+        if (arguments.size() < 2)
+            throw Exception{"Function " + String(function_name) + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
+
+        const auto & col = arguments.back();
+        auto col_type_const = typeid_cast(col.column.get());
+        if (!col_type_const || !isString(col.type))
+            throw Exception{"The last argument of function " + String(function_name)
+                                + " should be a constant string specifying the return data type, illegal value: " + col.column->getName(),
+                            ErrorCodes::ILLEGAL_COLUMN};
+
+        return DataTypeFactory::instance().get(col_type_const->getValue());
+    }
+
+    void prepare(const char * function_name, const Block & block, const ColumnNumbers &, size_t result_pos)
+    {
+        extract_tree = JSONExtractTree::build(function_name, block.getByPosition(result_pos).type);
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        return extract_tree->addValueToColumn(dest, it);
+    }
+
+protected:
+    std::unique_ptr::Node> extract_tree;
+};
+
+
+template 
+class JSONExtractKeysAndValuesImpl
+{
+public:
+    static constexpr size_t num_extra_arguments = 1;
+
+    static DataTypePtr getType(const char * function_name, const ColumnsWithTypeAndName & arguments)
+    {
+        if (arguments.size() < 2)
+            throw Exception{"Function " + String(function_name) + " requires at least two arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH};
+
+        const auto & col = arguments.back();
+        auto col_type_const = typeid_cast(col.column.get());
+        if (!col_type_const || !isString(col.type))
+            throw Exception{"The last argument of function " + String(function_name)
+                                + " should be a constant string specifying the values' data type, illegal value: " + col.column->getName(),
+                            ErrorCodes::ILLEGAL_COLUMN};
+
+        DataTypePtr value_type = DataTypeFactory::instance().get(col_type_const->getValue());
+        DataTypePtr key_type = std::make_unique();
+        DataTypePtr tuple_type = std::make_unique(DataTypes{key_type, value_type});
+        return std::make_unique(tuple_type);
+    }
+
+    void prepare(const char * function_name, const Block & block, const ColumnNumbers &, size_t result_pos)
+    {
+        const auto & result_type = block.getByPosition(result_pos).type;
+        const auto tuple_type = typeid_cast(result_type.get())->getNestedType();
+        const auto value_type = typeid_cast(tuple_type.get())->getElements()[1];
+        extract_tree = JSONExtractTree::build(function_name, value_type);
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        if (!JSONParser::isObject(it))
+            return false;
+
+        auto & col_arr = static_cast(dest);
+        auto & col_tuple = static_cast(col_arr.getData());
+        size_t old_size = col_tuple.size();
+        auto & col_key = static_cast(col_tuple.getColumn(0));
+        auto & col_value = col_tuple.getColumn(1);
+
+        StringRef key;
+        Iterator it2 = it;
+        if (!JSONParser::downToObject(it2, key))
+            return false;
+
+        do
+        {
+            if (extract_tree->addValueToColumn(col_value, it2))
+                col_key.insertData(key.data, key.size);
+        }
+        while (JSONParser::nextKeyValue(it2, key));
+
+        if (col_tuple.size() == old_size)
+            return false;
+
+        col_arr.getOffsets().push_back(col_tuple.size());
+        return true;
+    }
+
+private:
+    std::unique_ptr::Node> extract_tree;
+};
+
+
+template 
+class JSONExtractRawImpl
+{
+public:
+    static DataTypePtr getType(const char *, const ColumnsWithTypeAndName &)
+    {
+        return std::make_shared();
+    }
+
+    using Iterator = typename JSONParser::Iterator;
+    static bool addValueToColumn(IColumn & dest, const Iterator & it)
+    {
+        ColumnString & col_str = static_cast(dest);
+        auto & chars = col_str.getChars();
+        WriteBufferFromVector buf(chars, WriteBufferFromVector::AppendModeTag());
+        traverse(it, buf);
+        buf.finish();
+        chars.push_back(0);
+        col_str.getOffsets().push_back(chars.size());
+        return true;
+    }
+
+    static constexpr size_t num_extra_arguments = 0;
+    static void prepare(const char *, const Block &, const ColumnNumbers &, size_t) {}
+
+private:
+    static void traverse(const Iterator & it, WriteBuffer & buf)
+    {
+        if (JSONParser::isInteger(it))
+        {
+            writeIntText(JSONParser::getInteger(it), buf);
+            return;
+        }
+        if (JSONParser::isFloat(it))
+        {
+            writeFloatText(JSONParser::getFloat(it), buf);
+            return;
+        }
+        if (JSONParser::isBool(it))
+        {
+            if (JSONParser::getBool(it))
+                writeCString("true", buf);
+            else
+                writeCString("false", buf);
+            return;
+        }
+        if (JSONParser::isString(it))
+        {
+            writeJSONString(JSONParser::getString(it), buf, format_settings());
+            return;
+        }
+        if (JSONParser::isArray(it))
+        {
+            writeChar('[', buf);
+            Iterator it2 = it;
+            if (JSONParser::downToArray(it2))
+            {
+                traverse(it2, buf);
+                while (JSONParser::next(it2))
+                {
+                    writeChar(',', buf);
+                    traverse(it2, buf);
+                }
+            }
+            writeChar(']', buf);
+            return;
+        }
+        if (JSONParser::isObject(it))
+        {
+            writeChar('{', buf);
+            Iterator it2 = it;
+            StringRef key;
+            if (JSONParser::downToObject(it2, key))
+            {
+                writeJSONString(key, buf, format_settings());
+                writeChar(':', buf);
+                traverse(it2, buf);
+                while (JSONParser::nextKeyValue(it2, key))
+                {
+                    writeChar(',', buf);
+                    writeJSONString(key, buf, format_settings());
+                    writeChar(':', buf);
+                    traverse(it2, buf);
+                }
+            }
+            writeChar('}', buf);
+            return;
+        }
+        if (JSONParser::isNull(it))
+        {
+            writeCString("null", buf);
+            return;
+        }
+    }
+
+    static const FormatSettings & format_settings()
+    {
+        static const FormatSettings the_instance = []
+        {
+            FormatSettings settings;
+            settings.json.escape_forward_slashes = false;
+            return settings;
+        }();
+        return the_instance;
+    }
 };
 
 
@@ -983,8 +1056,9 @@ void registerFunctionsJSONTemplate(FunctionFactory & factory)
     factory.registerFunction>();
     factory.registerFunction>();
     factory.registerFunction>();
-    factory.registerFunction>();
     factory.registerFunction>();
+    factory.registerFunction>();
+    factory.registerFunction>();
 }
 
 }
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
index 8d98d3202db..86200f12129 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.reference
@@ -50,3 +50,8 @@ Friday
 
 {"passed":true}
 {}
+--JSONExtractKeysAndValues--
+[('a','hello')]
+[('b',[-100,200,300])]
+[('a','hello'),('b','world')]
+[('a',5),('b',7),('c',11)]
diff --git a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
index 5654b3528a5..4afb7d84cff 100644
--- a/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
+++ b/dbms/tests/queries/0_stateless/00918_json_functions_avx2.sql
@@ -56,3 +56,9 @@ SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144
 SELECT JSONExtractRaw('{"a": "hello", "b": [-100, 200.0, 300], "c":{"d":[121,144]}}', 'c', 'd', 3);
 SELECT JSONExtractRaw('{"passed": true}');
 SELECT JSONExtractRaw('{}');
+
+SELECT '--JSONExtractKeysAndValues--';
+SELECT JSONExtractKeysAndValues('{"a": "hello", "b": [-100, 200.0, 300]}', 'String');
+SELECT JSONExtractKeysAndValues('{"a": "hello", "b": [-100, 200.0, 300]}', 'Array(Float64)');
+SELECT JSONExtractKeysAndValues('{"a": "hello", "b": "world"}', 'String');
+SELECT JSONExtractKeysAndValues('{"x": {"a": 5, "b": 7, "c": 11}}', 'x', 'Int8');

From 263fc16bd50e0c48482533304de3ff7035c05766 Mon Sep 17 00:00:00 2001
From: Vitaly Baranov 
Date: Thu, 16 May 2019 15:16:21 +0300
Subject: [PATCH 170/194] Fix handling wrong JSONs.

---
 dbms/src/Functions/FunctionsJSON.cpp |  2 +-
 dbms/src/Functions/FunctionsJSON.h   | 49 ++++++++++++++--------------
 2 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp
index d8c33945f52..819f97f07c7 100644
--- a/dbms/src/Functions/FunctionsJSON.cpp
+++ b/dbms/src/Functions/FunctionsJSON.cpp
@@ -1,7 +1,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 
 namespace DB
diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h
index acf853b6c83..fa56b34bef0 100644
--- a/dbms/src/Functions/FunctionsJSON.h
+++ b/dbms/src/Functions/FunctionsJSON.h
@@ -130,38 +130,39 @@ public:
         {
             bool ok = parser.parse(reinterpret_cast(&chars[offsets[i - 1]]), offsets[i] - offsets[i - 1] - 1);
 
-            auto it = parser.getRoot();
-            for (const auto j : ext::range(0, moves.size()))
+            if (ok)
             {
-                if (!ok)
-                    break;
+                auto it = parser.getRoot();
 
                 /// Perform moves.
-                switch (moves[j].type)
+                for (size_t j = 0; (j != moves.size()) && ok; ++j)
                 {
-                    case MoveType::ConstIndex:
-                        ok = moveIteratorToElementByIndex(it, moves[j].index);
-                        break;
-                    case MoveType::ConstKey:
-                        ok = moveIteratorToElementByKey(it, moves[j].key);
-                        break;
-                    case MoveType::Index:
+                    switch (moves[j].type)
                     {
-                        const Field field = (*block.getByPosition(arguments[j + 1]).column)[i];
-                        ok = moveIteratorToElementByIndex(it, field.get());
-                        break;
-                    }
-                    case MoveType::Key:
-                    {
-                        const Field field = (*block.getByPosition(arguments[j + 1]).column)[i];
-                        ok = moveIteratorToElementByKey(it, field.get().data());
-                        break;
+                        case MoveType::ConstIndex:
+                            ok = moveIteratorToElementByIndex(it, moves[j].index);
+                            break;
+                        case MoveType::ConstKey:
+                            ok = moveIteratorToElementByKey(it, moves[j].key);
+                            break;
+                        case MoveType::Index:
+                        {
+                            const Field field = (*block.getByPosition(arguments[j + 1]).column)[i];
+                            ok = moveIteratorToElementByIndex(it, field.get());
+                            break;
+                        }
+                        case MoveType::Key:
+                        {
+                            const Field field = (*block.getByPosition(arguments[j + 1]).column)[i];
+                            ok = moveIteratorToElementByKey(it, field.get().data());
+                            break;
+                        }
                     }
                 }
-            }
 
-            if (ok)
-                ok = impl.addValueToColumn(*to, it);
+                if (ok)
+                    ok = impl.addValueToColumn(*to, it);
+            }
 
             /// We add default value (=null or zero) if something goes wrong, we don't throw exceptions in these JSON functions.
             if (!ok)

From 50c35a70db5c4bc760a48f17a986c7858e570ae9 Mon Sep 17 00:00:00 2001
From: chertus 
Date: Thu, 16 May 2019 15:53:33 +0300
Subject: [PATCH 171/194] support quanitle, quantiles, median for Decimal

---
 .../AggregateFunctionQuantile.cpp                | 10 ++++++----
 .../00700_decimal_aggregates.reference           | 13 ++++++++++++-
 .../0_stateless/00700_decimal_aggregates.sql     | 16 ++++++++++++++--
 3 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/dbms/src/AggregateFunctions/AggregateFunctionQuantile.cpp b/dbms/src/AggregateFunctions/AggregateFunctionQuantile.cpp
index 9c4e63c1dc2..2963230b3c8 100644
--- a/dbms/src/AggregateFunctions/AggregateFunctionQuantile.cpp
+++ b/dbms/src/AggregateFunctions/AggregateFunctionQuantile.cpp
@@ -43,7 +43,9 @@ template  using FuncQuantilesTDigestWeighted =
 template