2018-06-11 12:13:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <TableFunctions/ITableFunctionFileLike.h>
|
2021-10-26 09:31:01 +00:00
|
|
|
#include <Storages/ExternalDataSourceConfiguration.h>
|
2018-06-11 12:13:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-05-20 20:16:32 +00:00
|
|
|
|
|
|
|
class Context;
|
|
|
|
|
2018-06-11 12:13:00 +00:00
|
|
|
/* url(source, format, structure) - creates a temporary storage from url
|
|
|
|
*/
|
|
|
|
class TableFunctionURL : public ITableFunctionFileLike
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "url";
|
|
|
|
std::string getName() const override
|
|
|
|
{
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2021-09-08 19:28:22 +00:00
|
|
|
protected:
|
|
|
|
void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
|
|
|
|
|
2018-06-11 12:13:00 +00:00
|
|
|
private:
|
|
|
|
StoragePtr getStorage(
|
2021-04-10 23:33:54 +00:00
|
|
|
const String & source, const String & format_, const ColumnsDescription & columns, ContextPtr global_context,
|
2020-10-14 12:19:29 +00:00
|
|
|
const std::string & table_name, const String & compression_method_) const override;
|
2020-04-06 05:19:40 +00:00
|
|
|
const char * getStorageTypeName() const override { return "URL"; }
|
2021-10-26 09:31:01 +00:00
|
|
|
|
|
|
|
URLBasedDataSourceConfiguration configuration;
|
2018-06-11 12:13:00 +00:00
|
|
|
};
|
2020-05-20 20:16:32 +00:00
|
|
|
|
2018-06-11 12:13:00 +00:00
|
|
|
}
|