mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
dbms: development [#CONV-2944].
This commit is contained in:
parent
504f799f28
commit
db0959a383
@ -35,6 +35,13 @@ struct PlusImpl
|
||||
c[i] = a[i] + b;
|
||||
}
|
||||
|
||||
static void constant_vector(A a, const std::vector<B> & b, std::vector<ResultType> & c)
|
||||
{
|
||||
size_t size = b.size();
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
c[i] = a + b[i];
|
||||
}
|
||||
|
||||
static void constant_constant(A a, B b, ResultType & c)
|
||||
{
|
||||
c = a + b;
|
||||
@ -60,6 +67,13 @@ struct MultiplyImpl
|
||||
c[i] = a[i] * b;
|
||||
}
|
||||
|
||||
static void constant_vector(A a, const std::vector<B> & b, std::vector<ResultType> & c)
|
||||
{
|
||||
size_t size = b.size();
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
c[i] = a * b[i];
|
||||
}
|
||||
|
||||
static void constant_constant(A a, B b, ResultType & c)
|
||||
{
|
||||
c = a * b;
|
||||
@ -85,6 +99,13 @@ struct MinusImpl
|
||||
c[i] = a[i] - b;
|
||||
}
|
||||
|
||||
static void constant_vector(A a, const std::vector<B> & b, std::vector<ResultType> & c)
|
||||
{
|
||||
size_t size = b.size();
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
c[i] = a - b[i];
|
||||
}
|
||||
|
||||
static void constant_constant(A a, B b, ResultType & c)
|
||||
{
|
||||
c = a - b;
|
||||
@ -110,6 +131,13 @@ struct DivideFloatingImpl
|
||||
c[i] = static_cast<ResultType>(a[i]) / b;
|
||||
}
|
||||
|
||||
static void constant_vector(A a, const std::vector<B> & b, std::vector<ResultType> & c)
|
||||
{
|
||||
size_t size = b.size();
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
c[i] = static_cast<ResultType>(a) / b[i];
|
||||
}
|
||||
|
||||
static void constant_constant(A a, B b, ResultType & c)
|
||||
{
|
||||
c = static_cast<ResultType>(a) / b;
|
||||
@ -135,6 +163,13 @@ struct DivideIntegralImpl
|
||||
c[i] = a[i] / b;
|
||||
}
|
||||
|
||||
static void constant_vector(A a, const std::vector<B> & b, std::vector<ResultType> & c)
|
||||
{
|
||||
size_t size = b.size();
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
c[i] = a / b[i];
|
||||
}
|
||||
|
||||
static void constant_constant(A a, B b, ResultType & c)
|
||||
{
|
||||
c = a / b;
|
||||
@ -160,6 +195,13 @@ struct ModuloImpl
|
||||
c[i] = a[i] % b;
|
||||
}
|
||||
|
||||
static void constant_vector(A a, const std::vector<B> & b, std::vector<ResultType> & c)
|
||||
{
|
||||
size_t size = b.size();
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
c[i] = a % b[i];
|
||||
}
|
||||
|
||||
static void constant_constant(A a, B b, ResultType & c)
|
||||
{
|
||||
c = a % b;
|
||||
@ -254,7 +296,7 @@ private:
|
||||
|
||||
typename ColumnVector<ResultType>::Container_t & vec_res = col_res->getData();
|
||||
vec_res.resize(col_left->size());
|
||||
Impl<T1, T0>::vector_constant(col_right->getData(), col_left->getData(), vec_res);
|
||||
Impl<T0, T1>::constant_vector(col_left->getData(), col_right->getData(), vec_res);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -316,7 +358,7 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
/// Получить все имена функции.
|
||||
/// Получить имя функции.
|
||||
String getName() const
|
||||
{
|
||||
return Name::get();
|
||||
|
Loading…
Reference in New Issue
Block a user