mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 01:41:59 +00:00
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <TableFunctions/ITableFunctionFileLike.h>
|
|
#include <Storages/ExternalDataSourceConfiguration.h>
|
|
#include <IO/ReadWriteBufferFromHTTP.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class Context;
|
|
|
|
/* url(source, format[, structure, compression]) - creates a temporary storage from url.
|
|
*/
|
|
class TableFunctionURL : public ITableFunctionFileLike
|
|
{
|
|
public:
|
|
static constexpr auto name = "url";
|
|
std::string getName() const override
|
|
{
|
|
return name;
|
|
}
|
|
|
|
ColumnsDescription getActualTableStructure(ContextPtr context) const override;
|
|
|
|
protected:
|
|
void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
|
|
|
|
private:
|
|
StoragePtr getStorage(
|
|
const String & source, const String & format_, const ColumnsDescription & columns, ContextPtr global_context,
|
|
const std::string & table_name, const String & compression_method_) const override;
|
|
const char * getStorageTypeName() const override { return "URL"; }
|
|
|
|
ReadWriteBufferFromHTTP::HTTPHeaderEntries getHeaders() const;
|
|
|
|
URLBasedDataSourceConfiguration configuration;
|
|
};
|
|
|
|
}
|