#pragma once #include #include #include #include #include #include #include #include #include #include #include #if !defined(ARCADIA_BUILD) # include #endif #if USE_EMBEDDED_COMPILER # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wunused-parameter" # include # pragma GCC diagnostic pop #endif namespace DB { namespace ErrorCodes { extern const int ILLEGAL_TYPE_OF_ARGUMENT; extern const int LOGICAL_ERROR; } template struct UnaryOperationImpl { using ResultType = typename Op::ResultType; using ColVecA = std::conditional_t, ColumnDecimal, ColumnVector>; using ColVecC = std::conditional_t, ColumnDecimal, ColumnVector>; using ArrayA = typename ColVecA::Container; using ArrayC = typename ColVecC::Container; static void NO_INLINE vector(const ArrayA & a, ArrayC & c) { size_t size = a.size(); for (size_t i = 0; i < size; ++i) c[i] = Op::apply(a[i]); } static void constant(A a, ResultType & c) { c = Op::apply(a); } }; template struct FixedStringUnaryOperationImpl { static void NO_INLINE vector(const ColumnFixedString::Chars & a, ColumnFixedString::Chars & c) { size_t size = a.size(); for (size_t i = 0; i < size; ++i) c[i] = Op::apply(a[i]); } }; template struct FunctionUnaryArithmeticMonotonicity; /// Used to indicate undefined operation struct InvalidType; template