mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-29 05:00:47 +00:00
minor fixes
This commit is contained in:
parent
fb31544d4a
commit
e1cf60990a
@ -6,6 +6,7 @@
|
||||
#include <TableFunctions/ITableFunction.h>
|
||||
#include <TableFunctions/TableFunctionFactory.h>
|
||||
#include <TableFunctions/TableFunctionNull.h>
|
||||
#include <Interpreters/evaluateConstantExpression.h>
|
||||
#include "registerTableFunctions.h"
|
||||
|
||||
|
||||
@ -26,10 +27,7 @@ StoragePtr TableFunctionNull::executeImpl(const ASTPtr & ast_function, const Con
|
||||
if (arguments.size() != 1)
|
||||
throw Exception("Table function '" + getName() + "' requires 'structure'.", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
||||
|
||||
const auto * literal = arguments[0]->as<ASTLiteral>();
|
||||
if (!literal)
|
||||
throw Exception("Table function " + getName() + " requested literal argument.", ErrorCodes::LOGICAL_ERROR);
|
||||
auto structure = literal->value.safeGet<String>();
|
||||
auto structure = evaluateConstantExpressionOrIdentifierAsLiteral(arguments[0], context)->as<ASTLiteral>()->value.safeGet<String>();
|
||||
ColumnsDescription columns = parseColumnsListFromString(structure, context);
|
||||
|
||||
auto res = StorageNull::create(StorageID(getDatabaseName(), table_name), columns, ConstraintsDescription());
|
||||
|
@ -19,6 +19,7 @@ SRCS(
|
||||
TableFunctionInput.cpp
|
||||
TableFunctionMerge.cpp
|
||||
TableFunctionMySQL.cpp
|
||||
TableFunctionNull.cpp
|
||||
TableFunctionNumbers.cpp
|
||||
TableFunctionRemote.cpp
|
||||
TableFunctionURL.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user