mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 17:20:50 +00:00
Merge pull request #25152 from ClickHouse/move-code-in-more-local-place
Move code to more appropriate place
This commit is contained in:
commit
4185c5954f
@ -269,20 +269,6 @@ public:
|
||||
void operator() (const AggregateFunctionStateData & x) const;
|
||||
};
|
||||
|
||||
/// This is a special visitor which is used to get partition ID.
|
||||
/// Calculate hash for UUID the same way as for UInt128.
|
||||
/// It worked this way until 21.5, and we cannot change it,
|
||||
/// or partition ID will be different in case UUID is used in partition key.
|
||||
/// (It is not recommended to use UUID as partition key).
|
||||
class LegacyFieldVisitorHash : public FieldVisitorHash
|
||||
{
|
||||
public:
|
||||
using FieldVisitorHash::FieldVisitorHash;
|
||||
using FieldVisitorHash::operator();
|
||||
void operator() (const UUID & x) const { FieldVisitorHash::operator()(x.toUnderType()); }
|
||||
};
|
||||
|
||||
|
||||
template <typename T> constexpr bool isDecimalField() { return false; }
|
||||
template <> constexpr bool isDecimalField<DecimalField<Decimal32>>() { return true; }
|
||||
template <> constexpr bool isDecimalField<DecimalField<Decimal64>>() { return true; }
|
||||
|
@ -14,11 +14,28 @@
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
/// This is a special visitor which is used to get partition ID.
|
||||
/// Calculate hash for UUID the same way as for UInt128.
|
||||
/// It worked this way until 21.5, and we cannot change it,
|
||||
/// or partition ID will be different in case UUID is used in partition key.
|
||||
/// (It is not recommended to use UUID as partition key).
|
||||
class LegacyFieldVisitorHash : public FieldVisitorHash
|
||||
{
|
||||
public:
|
||||
using FieldVisitorHash::FieldVisitorHash;
|
||||
using FieldVisitorHash::operator();
|
||||
void operator() (const UUID & x) const { FieldVisitorHash::operator()(x.toUnderType()); }
|
||||
};
|
||||
}
|
||||
|
||||
static std::unique_ptr<ReadBufferFromFileBase> openForReading(const DiskPtr & disk, const String & path)
|
||||
{
|
||||
return disk->readFile(path, std::min(size_t(DBMS_DEFAULT_BUFFER_SIZE), disk->getFileSize(path)));
|
||||
|
Loading…
Reference in New Issue
Block a user