mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
fix typos
This commit is contained in:
parent
de7f5dc2a5
commit
923159d408
@ -49,7 +49,7 @@ public:
|
|||||||
explicit CompressedReadBufferFromFile(std::unique_ptr<ReadBufferFromFileBase> buf, bool allow_different_codecs_ = false);
|
explicit CompressedReadBufferFromFile(std::unique_ptr<ReadBufferFromFileBase> buf, bool allow_different_codecs_ = false);
|
||||||
|
|
||||||
/// Seek is lazy in some sense. We move position in compressed file_in to offset_in_compressed_file, but don't
|
/// Seek is lazy in some sense. We move position in compressed file_in to offset_in_compressed_file, but don't
|
||||||
/// read data into working_buffer and don't shit our position to offset_in_decompressed_block. Instead
|
/// read data into working_buffer and don't shift our position to offset_in_decompressed_block. Instead
|
||||||
/// we store this offset inside nextimpl_working_buffer_offset.
|
/// we store this offset inside nextimpl_working_buffer_offset.
|
||||||
void seek(size_t offset_in_compressed_file, size_t offset_in_decompressed_block);
|
void seek(size_t offset_in_compressed_file, size_t offset_in_decompressed_block);
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ void traverseCNF(const ASTPtr & node, CNFQuery::AndGroup & result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::optional<CNFQuery> TreeCNFConverter::tryConvertToCNF(
|
std::optional<CNFQuery> TreeCNFConverter::tryConvertToCNF(
|
||||||
const ASTPtr & query, size_t max_growth_multipler)
|
const ASTPtr & query, size_t max_growth_multiplier)
|
||||||
{
|
{
|
||||||
auto cnf = query->clone();
|
auto cnf = query->clone();
|
||||||
size_t num_atoms = countAtoms(cnf);
|
size_t num_atoms = countAtoms(cnf);
|
||||||
@ -216,8 +216,8 @@ std::optional<CNFQuery> TreeCNFConverter::tryConvertToCNF(
|
|||||||
splitMultiLogic(cnf);
|
splitMultiLogic(cnf);
|
||||||
traversePushNot(cnf, false);
|
traversePushNot(cnf, false);
|
||||||
|
|
||||||
size_t max_atoms = max_growth_multipler
|
size_t max_atoms = max_growth_multiplier
|
||||||
? std::max(MAX_ATOMS_WITHOUT_CHECK, num_atoms * max_growth_multipler)
|
? std::max(MAX_ATOMS_WITHOUT_CHECK, num_atoms * max_growth_multiplier)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
if (!traversePushOr(cnf, num_atoms, max_atoms))
|
if (!traversePushOr(cnf, num_atoms, max_atoms))
|
||||||
@ -232,13 +232,13 @@ std::optional<CNFQuery> TreeCNFConverter::tryConvertToCNF(
|
|||||||
}
|
}
|
||||||
|
|
||||||
CNFQuery TreeCNFConverter::toCNF(
|
CNFQuery TreeCNFConverter::toCNF(
|
||||||
const ASTPtr & query, size_t max_growth_multipler)
|
const ASTPtr & query, size_t max_growth_multiplier)
|
||||||
{
|
{
|
||||||
auto cnf = tryConvertToCNF(query, max_growth_multipler);
|
auto cnf = tryConvertToCNF(query, max_growth_multiplier);
|
||||||
if (!cnf)
|
if (!cnf)
|
||||||
throw Exception(ErrorCodes::TOO_MANY_TEMPORARY_COLUMNS,
|
throw Exception(ErrorCodes::TOO_MANY_TEMPORARY_COLUMNS,
|
||||||
"Cannot expression '{}' to CNF, because it produces to many clauses."
|
"Cannot convert expression '{}' to CNF, because it produces to many clauses."
|
||||||
"Size of formula inCNF can be exponential of size of source formula.");
|
"Size of boolean formula in CNF can be exponential of size of source formula.");
|
||||||
|
|
||||||
return *cnf;
|
return *cnf;
|
||||||
}
|
}
|
||||||
|
@ -148,16 +148,16 @@ public:
|
|||||||
static constexpr size_t DEFAULT_MAX_GROWTH_MULTIPLIER = 20;
|
static constexpr size_t DEFAULT_MAX_GROWTH_MULTIPLIER = 20;
|
||||||
static constexpr size_t MAX_ATOMS_WITHOUT_CHECK = 200;
|
static constexpr size_t MAX_ATOMS_WITHOUT_CHECK = 200;
|
||||||
|
|
||||||
/// @max_growth_multipler means that it's allowed to grow size of formula only
|
/// @max_growth_multiplier means that it's allowed to grow size of formula only
|
||||||
/// in that amount of times. It's needed to avoid exponential explosion of formula.
|
/// in that amount of times. It's needed to avoid exponential explosion of formula.
|
||||||
/// CNF of boolean formula with N clauses can have 2^N clauses.
|
/// CNF of boolean formula with N clauses can have 2^N clauses.
|
||||||
/// If amount of atomic formulas will be exceeded nullopt will be returned.
|
/// If amount of atomic formulas will be exceeded nullopt will be returned.
|
||||||
/// 0 - means unlimited.
|
/// 0 - means unlimited.
|
||||||
static std::optional<CNFQuery> tryConvertToCNF(
|
static std::optional<CNFQuery> tryConvertToCNF(
|
||||||
const ASTPtr & query, size_t max_growth_multipler = DEFAULT_MAX_GROWTH_MULTIPLIER);
|
const ASTPtr & query, size_t max_growth_multiplier = DEFAULT_MAX_GROWTH_MULTIPLIER);
|
||||||
|
|
||||||
static CNFQuery toCNF(
|
static CNFQuery toCNF(
|
||||||
const ASTPtr & query, size_t max_growth_multipler = DEFAULT_MAX_GROWTH_MULTIPLIER);
|
const ASTPtr & query, size_t max_growth_multiplier = DEFAULT_MAX_GROWTH_MULTIPLIER);
|
||||||
|
|
||||||
static ASTPtr fromCNF(const CNFQuery & cnf);
|
static ASTPtr fromCNF(const CNFQuery & cnf);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user