mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 11:52:27 +00:00
d4d266fa18
* ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * Fixed error in ColumnArray::replicateGeneric [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150]. * ColumnConst: unification (incomplete) [#CLICKHOUSE-3150].
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
#include <Storages/IStorage.h>
|
|
#include <Parsers/TablePropertiesQueriesASTs.h>
|
|
#include <Parsers/formatAST.h>
|
|
#include <DataStreams/OneBlockInputStream.h>
|
|
#include <DataStreams/BlockIO.h>
|
|
#include <DataStreams/copyData.h>
|
|
#include <DataTypes/DataTypesNumber.h>
|
|
#include <DataTypes/DataTypeString.h>
|
|
#include <Columns/ColumnString.h>
|
|
#include <Common/typeid_cast.h>
|
|
#include <Interpreters/Context.h>
|
|
#include <Interpreters/InterpreterShowCreateQuery.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
BlockIO InterpreterShowCreateQuery::execute()
|
|
{
|
|
BlockIO res;
|
|
res.in = executeImpl();
|
|
res.in_sample = getSampleBlock();
|
|
|
|
return res;
|
|
}
|
|
|
|
|
|
Block InterpreterShowCreateQuery::getSampleBlock()
|
|
{
|
|
return {{ nullptr, std::make_shared<DataTypeString>(), "statement" }};
|
|
}
|
|
|
|
|
|
BlockInputStreamPtr InterpreterShowCreateQuery::executeImpl()
|
|
{
|
|
const ASTShowCreateQuery & ast = typeid_cast<const ASTShowCreateQuery &>(*query_ptr);
|
|
|
|
std::stringstream stream;
|
|
formatAST(*context.getCreateQuery(ast.database, ast.table), stream, 0, false, true);
|
|
String res = stream.str();
|
|
|
|
ColumnPtr column = std::make_shared<ColumnString>();
|
|
column->insert(res);
|
|
|
|
return std::make_shared<OneBlockInputStream>(Block{{
|
|
column,
|
|
std::make_shared<DataTypeString>(),
|
|
"statement"}});
|
|
}
|
|
|
|
}
|