mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 01:12:12 +00:00
44 lines
971 B
C++
44 lines
971 B
C++
#pragma once
|
|
|
|
#include "config.h"
|
|
|
|
#if USE_HDFS
|
|
|
|
#include <TableFunctions/ITableFunctionFileLike.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class Context;
|
|
|
|
/* hdfs(URI, format[, structure, compression]) - creates a temporary storage from hdfs files
|
|
*
|
|
*/
|
|
class TableFunctionHDFS : public ITableFunctionFileLike
|
|
{
|
|
public:
|
|
static constexpr auto name = "hdfs";
|
|
std::string getName() const override
|
|
{
|
|
return name;
|
|
}
|
|
|
|
ColumnsDescription getActualTableStructure(ContextPtr context) const override;
|
|
|
|
std::unordered_set<String> getVirtualsToCheckBeforeUsingStructureHint() const override
|
|
{
|
|
return {"_path", "_file"};
|
|
}
|
|
|
|
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 "HDFS"; }
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|