fix typos

This commit is contained in:
Anton Popov 2021-11-26 17:47:40 +03:00
parent de7f5dc2a5
commit 923159d408
3 changed files with 11 additions and 11 deletions

View File

@ -49,7 +49,7 @@ public:
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
/// 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.
void seek(size_t offset_in_compressed_file, size_t offset_in_decompressed_block);

View File

@ -208,7 +208,7 @@ void traverseCNF(const ASTPtr & node, CNFQuery::AndGroup & result)
}
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();
size_t num_atoms = countAtoms(cnf);
@ -216,8 +216,8 @@ std::optional<CNFQuery> TreeCNFConverter::tryConvertToCNF(
splitMultiLogic(cnf);
traversePushNot(cnf, false);
size_t max_atoms = max_growth_multipler
? std::max(MAX_ATOMS_WITHOUT_CHECK, num_atoms * max_growth_multipler)
size_t max_atoms = max_growth_multiplier
? std::max(MAX_ATOMS_WITHOUT_CHECK, num_atoms * max_growth_multiplier)
: 0;
if (!traversePushOr(cnf, num_atoms, max_atoms))
@ -232,13 +232,13 @@ std::optional<CNFQuery> TreeCNFConverter::tryConvertToCNF(
}
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)
throw Exception(ErrorCodes::TOO_MANY_TEMPORARY_COLUMNS,
"Cannot expression '{}' to CNF, because it produces to many clauses."
"Size of formula inCNF can be exponential of size of source formula.");
"Cannot convert expression '{}' to CNF, because it produces to many clauses."
"Size of boolean formula in CNF can be exponential of size of source formula.");
return *cnf;
}

View File

@ -148,16 +148,16 @@ public:
static constexpr size_t DEFAULT_MAX_GROWTH_MULTIPLIER = 20;
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.
/// CNF of boolean formula with N clauses can have 2^N clauses.
/// If amount of atomic formulas will be exceeded nullopt will be returned.
/// 0 - means unlimited.
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(
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);
};