mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 10:31:57 +00:00
Better [#CLICKHOUSE-2]
This commit is contained in:
parent
431da20d99
commit
1efef27af9
@ -14,8 +14,7 @@ public:
|
||||
#ifdef __SIZEOF_INT128__
|
||||
using BigNum = __uint128_t; /// Must contain the result of multiplying two UInt64.
|
||||
#else
|
||||
// TODO: incomplete temporary fallback. change with boost::multiprecision
|
||||
using BigNum = uint64_t;
|
||||
#error "No uint128_t type. Sampling ratios cannot work correctly."
|
||||
#endif
|
||||
|
||||
struct Rational
|
||||
|
@ -10,6 +10,22 @@
|
||||
#include <Parsers/ASTIdentifier.h>
|
||||
#include <Parsers/ASTFunction.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/FilterBlockInputStream.h>
|
||||
#include <DataStreams/CollapsingFinalBlockInputStream.h>
|
||||
|
Loading…
Reference in New Issue
Block a user