Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into constant-folding-scalar-subqueries
- Loading branch information
Showing
62 changed files
with
1,001 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#include <base/Decimal.h> | ||
#include <base/extended_types.h> | ||
|
||
namespace DB | ||
{ | ||
|
||
/// Explicit template instantiations. | ||
|
||
#define FOR_EACH_UNDERLYING_DECIMAL_TYPE(M) \ | ||
M(Int32) \ | ||
M(Int64) \ | ||
M(Int128) \ | ||
M(Int256) | ||
|
||
#define FOR_EACH_UNDERLYING_DECIMAL_TYPE_PASS(M, X) \ | ||
M(Int32, X) \ | ||
M(Int64, X) \ | ||
M(Int128, X) \ | ||
M(Int256, X) | ||
|
||
template <typename T> const Decimal<T> & Decimal<T>::operator += (const T & x) { value += x; return *this; } | ||
template <typename T> const Decimal<T> & Decimal<T>::operator -= (const T & x) { value -= x; return *this; } | ||
template <typename T> const Decimal<T> & Decimal<T>::operator *= (const T & x) { value *= x; return *this; } | ||
template <typename T> const Decimal<T> & Decimal<T>::operator /= (const T & x) { value /= x; return *this; } | ||
template <typename T> const Decimal<T> & Decimal<T>::operator %= (const T & x) { value %= x; return *this; } | ||
|
||
template <typename T> void NO_SANITIZE_UNDEFINED Decimal<T>::addOverflow(const T & x) { value += x; } | ||
|
||
/// Maybe this explicit instantiation affects performance since operators cannot be inlined. | ||
|
||
template <typename T> template <typename U> const Decimal<T> & Decimal<T>::operator += (const Decimal<U> & x) { value += static_cast<T>(x.value); return *this; } | ||
template <typename T> template <typename U> const Decimal<T> & Decimal<T>::operator -= (const Decimal<U> & x) { value -= static_cast<T>(x.value); return *this; } | ||
template <typename T> template <typename U> const Decimal<T> & Decimal<T>::operator *= (const Decimal<U> & x) { value *= static_cast<T>(x.value); return *this; } | ||
template <typename T> template <typename U> const Decimal<T> & Decimal<T>::operator /= (const Decimal<U> & x) { value /= static_cast<T>(x.value); return *this; } | ||
template <typename T> template <typename U> const Decimal<T> & Decimal<T>::operator %= (const Decimal<U> & x) { value %= static_cast<T>(x.value); return *this; } | ||
|
||
#define DISPATCH(TYPE_T, TYPE_U) \ | ||
template const Decimal<TYPE_T> & Decimal<TYPE_T>::operator += (const Decimal<TYPE_U> & x); \ | ||
template const Decimal<TYPE_T> & Decimal<TYPE_T>::operator -= (const Decimal<TYPE_U> & x); \ | ||
template const Decimal<TYPE_T> & Decimal<TYPE_T>::operator *= (const Decimal<TYPE_U> & x); \ | ||
template const Decimal<TYPE_T> & Decimal<TYPE_T>::operator /= (const Decimal<TYPE_U> & x); \ | ||
template const Decimal<TYPE_T> & Decimal<TYPE_T>::operator %= (const Decimal<TYPE_U> & x); | ||
#define INVOKE(X) FOR_EACH_UNDERLYING_DECIMAL_TYPE_PASS(DISPATCH, X) | ||
FOR_EACH_UNDERLYING_DECIMAL_TYPE(INVOKE); | ||
#undef INVOKE | ||
#undef DISPATCH | ||
|
||
#define DISPATCH(TYPE) template struct Decimal<TYPE>; | ||
FOR_EACH_UNDERLYING_DECIMAL_TYPE(DISPATCH) | ||
#undef DISPATCH | ||
|
||
template <typename T> bool operator< (const Decimal<T> & x, const Decimal<T> & y) { return x.value < y.value; } | ||
template <typename T> bool operator> (const Decimal<T> & x, const Decimal<T> & y) { return x.value > y.value; } | ||
template <typename T> bool operator<= (const Decimal<T> & x, const Decimal<T> & y) { return x.value <= y.value; } | ||
template <typename T> bool operator>= (const Decimal<T> & x, const Decimal<T> & y) { return x.value >= y.value; } | ||
template <typename T> bool operator== (const Decimal<T> & x, const Decimal<T> & y) { return x.value == y.value; } | ||
template <typename T> bool operator!= (const Decimal<T> & x, const Decimal<T> & y) { return x.value != y.value; } | ||
|
||
#define DISPATCH(TYPE) \ | ||
template bool operator< (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template bool operator> (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template bool operator<= (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template bool operator>= (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template bool operator== (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template bool operator!= (const Decimal<TYPE> & x, const Decimal<TYPE> & y); | ||
FOR_EACH_UNDERLYING_DECIMAL_TYPE(DISPATCH) | ||
#undef DISPATCH | ||
|
||
|
||
template <typename T> Decimal<T> operator+ (const Decimal<T> & x, const Decimal<T> & y) { return x.value + y.value; } | ||
template <typename T> Decimal<T> operator- (const Decimal<T> & x, const Decimal<T> & y) { return x.value - y.value; } | ||
template <typename T> Decimal<T> operator* (const Decimal<T> & x, const Decimal<T> & y) { return x.value * y.value; } | ||
template <typename T> Decimal<T> operator/ (const Decimal<T> & x, const Decimal<T> & y) { return x.value / y.value; } | ||
template <typename T> Decimal<T> operator- (const Decimal<T> & x) { return -x.value; } | ||
|
||
#define DISPATCH(TYPE) \ | ||
template Decimal<TYPE> operator+ (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template Decimal<TYPE> operator- (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template Decimal<TYPE> operator* (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template Decimal<TYPE> operator/ (const Decimal<TYPE> & x, const Decimal<TYPE> & y); \ | ||
template Decimal<TYPE> operator- (const Decimal<TYPE> & x); | ||
FOR_EACH_UNDERLYING_DECIMAL_TYPE(DISPATCH) | ||
#undef DISPATCH | ||
|
||
#undef FOR_EACH_UNDERLYING_DECIMAL_TYPE_PASS | ||
#undef FOR_EACH_UNDERLYING_DECIMAL_TYPE | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <Columns/ColumnUnique.h> | ||
|
||
namespace DB | ||
{ | ||
|
||
/// Explicit template instantiations. | ||
template class ColumnUnique<ColumnInt8>; | ||
template class ColumnUnique<ColumnUInt8>; | ||
template class ColumnUnique<ColumnInt16>; | ||
template class ColumnUnique<ColumnUInt16>; | ||
template class ColumnUnique<ColumnInt32>; | ||
template class ColumnUnique<ColumnUInt32>; | ||
template class ColumnUnique<ColumnInt64>; | ||
template class ColumnUnique<ColumnUInt64>; | ||
template class ColumnUnique<ColumnInt128>; | ||
template class ColumnUnique<ColumnUInt128>; | ||
template class ColumnUnique<ColumnInt256>; | ||
template class ColumnUnique<ColumnUInt256>; | ||
template class ColumnUnique<ColumnFloat32>; | ||
template class ColumnUnique<ColumnFloat64>; | ||
template class ColumnUnique<ColumnString>; | ||
template class ColumnUnique<ColumnFixedString>; | ||
template class ColumnUnique<ColumnDateTime64>; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.