Better [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2017-12-01 23:38:50 +03:00
parent 431da20d99
commit 1efef27af9
2 changed files with 17 additions and 2 deletions

View File

@ -14,8 +14,7 @@ public:
#ifdef __SIZEOF_INT128__ #ifdef __SIZEOF_INT128__
using BigNum = __uint128_t; /// Must contain the result of multiplying two UInt64. using BigNum = __uint128_t; /// Must contain the result of multiplying two UInt64.
#else #else
// TODO: incomplete temporary fallback. change with boost::multiprecision #error "No uint128_t type. Sampling ratios cannot work correctly."
using BigNum = uint64_t;
#endif #endif
struct Rational struct Rational

View File

@ -10,6 +10,22 @@
#include <Parsers/ASTIdentifier.h> #include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTFunction.h> #include <Parsers/ASTFunction.h>
#include <Parsers/ASTSampleRatio.h> #include <Parsers/ASTSampleRatio.h>
/// Allow to use __uint128_t as a template parameter for boost::rational.
namespace std
{
template <>
struct numeric_limits<__uint128_t>
{
static constexpr bool is_specialized = true;
static constexpr bool is_signed = false;
static constexpr bool is_integer = true;
static constexpr int radix = 2;
static constexpr int digits = 8 * sizeof(char) * 2;
static constexpr __uint128_t min () { return 0; } // used in boost 1.65.1+
};
}
#include <DataStreams/ExpressionBlockInputStream.h> #include <DataStreams/ExpressionBlockInputStream.h>
#include <DataStreams/FilterBlockInputStream.h> #include <DataStreams/FilterBlockInputStream.h>
#include <DataStreams/CollapsingFinalBlockInputStream.h> #include <DataStreams/CollapsingFinalBlockInputStream.h>