Fixed tests

This commit is contained in:
Maksim Kita 2023-09-12 21:26:53 +03:00
parent 32cad222bf
commit 60a63212c8
2 changed files with 11 additions and 8 deletions

View File

@ -48,7 +48,7 @@ static bool equals(const DataTypes & lhs, const DataTypes & rhs)
FutureSetFromStorage::FutureSetFromStorage(SetPtr set_) : set(std::move(set_)) {} FutureSetFromStorage::FutureSetFromStorage(SetPtr set_) : set(std::move(set_)) {}
SetPtr FutureSetFromStorage::get() const { return set; } SetPtr FutureSetFromStorage::get() const { return set; }
const DataTypes & FutureSetFromStorage::getTypes() const { return set->getElementsTypes(); } DataTypes FutureSetFromStorage::getTypes() const { return set->getElementsTypes(); }
SetPtr FutureSetFromStorage::buildOrderedSetInplace(const ContextPtr &) SetPtr FutureSetFromStorage::buildOrderedSetInplace(const ContextPtr &)
{ {
@ -73,7 +73,7 @@ FutureSetFromTuple::FutureSetFromTuple(Block block, const Settings & settings)
set->finishInsert(); set->finishInsert();
} }
const DataTypes & FutureSetFromTuple::getTypes() const { return set->getElementsTypes(); } DataTypes FutureSetFromTuple::getTypes() const { return set->getElementsTypes(); }
SetPtr FutureSetFromTuple::buildOrderedSetInplace(const ContextPtr & context) SetPtr FutureSetFromTuple::buildOrderedSetInplace(const ContextPtr & context)
{ {
@ -138,7 +138,7 @@ void FutureSetFromSubquery::setQueryPlan(std::unique_ptr<QueryPlan> source_)
set_and_key->set->setHeader(source->getCurrentDataStream().header.getColumnsWithTypeAndName()); set_and_key->set->setHeader(source->getCurrentDataStream().header.getColumnsWithTypeAndName());
} }
const DataTypes & FutureSetFromSubquery::getTypes() const DataTypes FutureSetFromSubquery::getTypes() const
{ {
return set_and_key->set->getElementsTypes(); return set_and_key->set->getElementsTypes();
} }
@ -183,7 +183,10 @@ SetPtr FutureSetFromSubquery::buildOrderedSetInplace(const ContextPtr & context)
{ {
auto set = external_table_set->buildOrderedSetInplace(context); auto set = external_table_set->buildOrderedSetInplace(context);
if (set) if (set)
return set_and_key->set = set; {
set_and_key->set = set;
return set_and_key->set;
}
} }
auto plan = build(context); auto plan = build(context);

View File

@ -47,7 +47,7 @@ public:
/// Returns set if set is ready (created and filled) or nullptr if not. /// Returns set if set is ready (created and filled) or nullptr if not.
virtual SetPtr get() const = 0; virtual SetPtr get() const = 0;
/// Returns set->getElementsTypes(), even if set is not created yet. /// Returns set->getElementsTypes(), even if set is not created yet.
virtual const DataTypes & getTypes() const = 0; virtual DataTypes getTypes() const = 0;
/// If possible, return set with stored elements useful for PK analysis. /// If possible, return set with stored elements useful for PK analysis.
virtual SetPtr buildOrderedSetInplace(const ContextPtr & context) = 0; virtual SetPtr buildOrderedSetInplace(const ContextPtr & context) = 0;
}; };
@ -62,7 +62,7 @@ public:
FutureSetFromStorage(SetPtr set_); FutureSetFromStorage(SetPtr set_);
SetPtr get() const override; SetPtr get() const override;
const DataTypes & getTypes() const override; DataTypes getTypes() const override;
SetPtr buildOrderedSetInplace(const ContextPtr &) override; SetPtr buildOrderedSetInplace(const ContextPtr &) override;
private: private:
@ -79,7 +79,7 @@ public:
SetPtr get() const override { return set; } SetPtr get() const override { return set; }
SetPtr buildOrderedSetInplace(const ContextPtr & context) override; SetPtr buildOrderedSetInplace(const ContextPtr & context) override;
const DataTypes & getTypes() const override; DataTypes getTypes() const override;
private: private:
SetPtr set; SetPtr set;
@ -105,7 +105,7 @@ public:
const Settings & settings); const Settings & settings);
SetPtr get() const override; SetPtr get() const override;
const DataTypes & getTypes() const override; DataTypes getTypes() const override;
SetPtr buildOrderedSetInplace(const ContextPtr & context) override; SetPtr buildOrderedSetInplace(const ContextPtr & context) override;
std::unique_ptr<QueryPlan> build(const ContextPtr & context); std::unique_ptr<QueryPlan> build(const ContextPtr & context);