Better UNION ALL: development #1947

This commit is contained in:
Alexey Milovidov 2018-02-28 07:55:43 +03:00
parent 7fc6e0f16e
commit 8b2ca20da2

View File

@ -1,20 +1,18 @@
#include <Storages/IStorage.h> #include <Storages/IStorage.h>
#include <Parsers/TablePropertiesQueriesASTs.h>
#include <DataStreams/OneBlockInputStream.h> #include <DataStreams/OneBlockInputStream.h>
#include <DataStreams/BlockIO.h> #include <DataStreams/BlockIO.h>
#include <DataTypes/DataTypeString.h> #include <DataTypes/DataTypeString.h>
#include <Columns/ColumnString.h>
#include <Parsers/queryToString.h> #include <Parsers/queryToString.h>
#include <Common/typeid_cast.h>
#include <TableFunctions/ITableFunction.h>
#include <TableFunctions/TableFunctionFactory.h>
#include <Interpreters/InterpreterSelectWithUnionQuery.h>
#include <Interpreters/Context.h> #include <Interpreters/Context.h>
#include <Interpreters/InterpreterDescribeQuery.h> #include <Interpreters/InterpreterDescribeQuery.h>
#include <Common/typeid_cast.h>
#include <Parsers/ASTSelectQuery.h>
#include <Parsers/ASTFunction.h>
#include <TableFunctions/ITableFunction.h>
#include <Interpreters/InterpreterSelectQuery.h>
#include <TableFunctions/TableFunctionFactory.h>
#include <Parsers/ASTIdentifier.h> #include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTTablesInSelectQuery.h> #include <Parsers/ASTTablesInSelectQuery.h>
#include <Parsers/TablePropertiesQueriesASTs.h>
namespace DB namespace DB
@ -62,7 +60,9 @@ BlockInputStreamPtr InterpreterDescribeQuery::executeImpl()
auto table_expression = typeid_cast<const ASTTableExpression *>(ast.table_expression.get()); auto table_expression = typeid_cast<const ASTTableExpression *>(ast.table_expression.get());
if (table_expression->subquery) if (table_expression->subquery)
columns = InterpreterSelectQuery::getSampleBlock(table_expression->subquery->children[0], context).getNamesAndTypesList(); {
columns = InterpreterSelectWithUnionQuery::getSampleBlock(table_expression->subquery->children[0], context).getNamesAndTypesList();
}
else else
{ {
if (table_expression->table_function) if (table_expression->table_function)