2019-07-29 13:50:13 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <TableFunctions/ITableFunction.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2019-07-31 14:12:05 +00:00
|
|
|
/* values(structure, values...) - creates a temporary storage filling columns with values
|
2022-02-28 00:15:37 +00:00
|
|
|
* values is case-insensitive table function.
|
2019-07-31 14:12:05 +00:00
|
|
|
*/
|
2019-07-29 13:50:13 +00:00
|
|
|
class TableFunctionValues : public ITableFunction
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "values";
|
|
|
|
std::string getName() const override { return name; }
|
2020-10-14 12:19:29 +00:00
|
|
|
bool hasStaticStructure() const override { return true; }
|
2019-07-29 13:50:13 +00:00
|
|
|
private:
|
2021-04-10 23:33:54 +00:00
|
|
|
StoragePtr executeImpl(const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription cached_columns) const override;
|
2020-04-06 05:19:40 +00:00
|
|
|
const char * getStorageTypeName() const override { return "Values"; }
|
2020-10-14 12:19:29 +00:00
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
ColumnsDescription getActualTableStructure(ContextPtr context) const override;
|
|
|
|
void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
|
2020-10-14 12:19:29 +00:00
|
|
|
|
2022-02-07 15:28:24 +00:00
|
|
|
static DataTypes getTypesFromArgument(const ASTPtr & arg, ContextPtr context);
|
2022-01-26 13:31:09 +00:00
|
|
|
|
2022-01-26 13:29:33 +00:00
|
|
|
ColumnsDescription structure;
|
|
|
|
bool has_structure_in_arguments;
|
2019-07-29 13:50:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|