update

fix test

fix test
This commit is contained in:
feng lv 2021-07-01 14:07:55 +00:00
parent fe22563465
commit 9ad405cae8
3 changed files with 9 additions and 7 deletions

View File

@ -62,7 +62,7 @@ void TableFunctionMerge::parseArguments(const ASTPtr & ast_function, ContextPtr
}
const std::unordered_map<String, std::unordered_set<String>> & TableFunctionMerge::getSourceDatabasesAndTables(ContextPtr context) const
const TableFunctionMerge::DbToTableSetMap & TableFunctionMerge::getSourceDatabasesAndTables(ContextPtr context) const
{
if (source_databases_and_tables)
return *source_databases_and_tables;
@ -155,7 +155,7 @@ TableFunctionMerge::getMatchedTablesWithAccess(const String & database_name, con
continue;
if (!granted_select_on_all_tables)
access->checkAccess(AccessType::SELECT, database_name, it->name());
tables.insert(it->name());
tables.emplace(it->name());
}
return tables;
}

View File

@ -15,11 +15,13 @@ class TableFunctionMerge : public ITableFunction
public:
static constexpr auto name = "merge";
std::string getName() const override { return name; }
private:
StoragePtr executeImpl(const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription cached_columns) const override;
const char * getStorageTypeName() const override { return "Merge"; }
const std::unordered_map<String, std::unordered_set<String>> & getSourceDatabasesAndTables(ContextPtr context) const;
using DbToTableSetMap = std::unordered_map<String, std::unordered_set<String>>;
const DbToTableSetMap & getSourceDatabasesAndTables(ContextPtr context) const;
ColumnsDescription getActualTableStructure(ContextPtr context) const override;
void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
static NameSet getMatchedTablesWithAccess(const String & database_name, const String & table_regexp, const ContextPtr & context);
@ -27,7 +29,7 @@ private:
String source_database_name_or_regexp;
String source_table_regexp;
bool database_is_regexp = false;
mutable std::optional<std::unordered_map<String, std::unordered_set<String>>> source_databases_and_tables;
mutable std::optional<DbToTableSetMap> source_databases_and_tables;
};

View File

@ -49,9 +49,9 @@
2018-08-01 100
2018-08-01 200
--------------Implicit type conversion------------
2018-08-01 -1
2018-08-01 1
2018-08-01 -1
2018-08-01 1
2018-08-01 18446744073709551615
2018-08-01 1
2018-08-01 18446744073709551615
2018-08-01 1
2018-08-01 1