2018-11-19 08:17:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-12-05 13:24:45 +00:00
|
|
|
#include <Common/config.h>
|
|
|
|
|
|
|
|
#if USE_HDFS
|
|
|
|
|
2018-11-19 08:17:09 +00:00
|
|
|
#include <TableFunctions/ITableFunctionFileLike.h>
|
|
|
|
#include <Interpreters/Context.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
/* hdfs(name_node_ip:name_node_port, format, structure) - creates a temporary storage from hdfs file
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class TableFunctionHDFS : public ITableFunctionFileLike
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static constexpr auto name = "hdfs";
|
|
|
|
std::string getName() const override
|
|
|
|
{
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
StoragePtr getStorage(
|
2019-11-19 12:46:07 +00:00
|
|
|
const String & source, const String & format, const ColumnsDescription & columns, Context & global_context, const std::string & table_name, const String & compression_method) const override;
|
2020-01-24 16:20:36 +00:00
|
|
|
AccessType getRequiredAccessType() const override;
|
2018-11-19 08:17:09 +00:00
|
|
|
};
|
|
|
|
}
|
2018-12-05 13:24:45 +00:00
|
|
|
|
|
|
|
#endif
|