mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Minor: cleanup
This commit is contained in:
parent
f01a566646
commit
168155eeec
@ -45,7 +45,6 @@ BlockIO InterpreterOptimizeQuery::execute()
|
||||
}
|
||||
|
||||
metadata_snapshot->check(column_names, NamesAndTypesList{}, table_id);
|
||||
// TODO: validate that deduplicate_by_columns contains all primary key columns.
|
||||
for (const auto & primary_key : metadata_snapshot->getPrimaryKeyColumns())
|
||||
{
|
||||
if (std::find(column_names.begin(), column_names.end(), primary_key) == column_names.end())
|
||||
|
@ -80,8 +80,6 @@
|
||||
#include <ext/scope_guard.h>
|
||||
#include <memory>
|
||||
|
||||
#include <Core/iostream_debug_helpers.h>
|
||||
#include <Parsers/formatAST.h>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ public:
|
||||
/// A flag can be specified - perform optimization "to the end" instead of one step.
|
||||
bool final = false;
|
||||
/// Do deduplicate (default: false)
|
||||
bool deduplicate;
|
||||
bool deduplicate = false;
|
||||
/// Deduplicate by columns.
|
||||
ASTPtr deduplicate_by_columns;
|
||||
|
||||
|
@ -117,17 +117,9 @@ protected:
|
||||
*/
|
||||
class ParserQualifiedAsterisk : public IParserBase
|
||||
{
|
||||
public:
|
||||
using ColumnTransformers = ParserColumnsTransformers::ColumnTransformers;
|
||||
ParserQualifiedAsterisk(ColumnTransformers allowed_transformers_ = ParserColumnsTransformers::AllTransformers)
|
||||
: allowed_transformers(allowed_transformers_)
|
||||
{}
|
||||
|
||||
protected:
|
||||
const char * getName() const override { return "qualified asterisk"; }
|
||||
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
||||
|
||||
ColumnTransformers allowed_transformers;
|
||||
};
|
||||
|
||||
/** COLUMNS('<regular expression>')
|
||||
|
@ -1,8 +1,5 @@
|
||||
#include <Parsers/IParserBase.h>
|
||||
|
||||
#include <Parsers/formatAST.h>
|
||||
#include <IO/WriteBufferFromOStream.h>
|
||||
#include <iostream>
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -13,20 +10,9 @@ bool IParserBase::parse(Pos & pos, ASTPtr & node, Expected & expected)
|
||||
|
||||
return wrapParseImpl(pos, IncreaseDepthTag{}, [&]
|
||||
{
|
||||
// std::cerr << pos.depth << " 0x" << static_cast<const void*>(this) << " " << getName() << " parsing \"" << pos.get().begin << "\" ... " << std::endl;
|
||||
bool res = parseImpl(pos, node, expected);
|
||||
// std::cerr << pos.depth << " 0x" << static_cast<const void*>(this) << " " << getName() << " " << (res ? "OK" : "FAIL") << std::endl;
|
||||
if (!res)
|
||||
node = nullptr;
|
||||
// else if (node)
|
||||
// {
|
||||
// std::cerr << pos.depth << " 0x" << static_cast<const void*>(this) << "\t" << std::ends;
|
||||
// {
|
||||
// WriteBufferFromOStream out(std::cerr, 4096);
|
||||
// formatAST(*node, out);
|
||||
// }
|
||||
// std::cerr << std::endl;
|
||||
// }
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ INSTANTIATE_TEST_SUITE_P(Merge, ReplicatedMergeTreeLogEntryDataTest,
|
||||
R"re(^format version: 6.+merge.+into.+deduplicate: 1.+into_uuid: 00000000-075b-cd15-0000-093233447e0c.+deduplicate_by_columns: \["foo","bar","qux"].*$)re"
|
||||
},
|
||||
{
|
||||
// Validate that exotic column names are serialized/desirialized properly
|
||||
// Validate that exotic column names are serialized/deserialized properly
|
||||
{
|
||||
.type = ReplicatedMergeTreeLogEntryData::MERGE_PARTS,
|
||||
.new_part_type = MergeTreeDataPartType::WIDE,
|
||||
|
@ -1,3 +1,5 @@
|
||||
--- See also tests/queries/0_stateless/01581_deduplicate_by_columns_replicated.sql
|
||||
|
||||
--- local case
|
||||
|
||||
-- Just in case if previous tests run left some stuff behind.
|
||||
|
@ -1,4 +1,4 @@
|
||||
--- Put it into tests/queries/0_stateless/01581_deduplicate_by_columns.sql
|
||||
--- See also tests/queries/0_stateless/01581_deduplicate_by_columns_local.sql
|
||||
|
||||
--- replicated case
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user