ClickHouse/dbms/Storages/StorageHDFS.h

51 lines
1.3 KiB
C++
Raw Normal View History

2018-11-19 08:17:09 +00:00
#pragma once
#include <Common/config.h>
#if USE_HDFS
2018-11-19 08:17:09 +00:00
#include <Storages/IStorage.h>
#include <Poco/URI.h>
#include <common/logger_useful.h>
#include <ext/shared_ptr_helper.h>
namespace DB
{
/**
* This class represents table engine for external hdfs files.
* Read method is supported for now.
*/
class StorageHDFS final : public ext::shared_ptr_helper<StorageHDFS>, public IStorage
2018-11-19 08:17:09 +00:00
{
2019-08-26 19:07:29 +00:00
friend struct ext::shared_ptr_helper<StorageHDFS>;
2018-11-19 08:17:09 +00:00
public:
String getName() const override { return "HDFS"; }
2018-11-19 08:17:09 +00:00
Pipes read(const Names & column_names,
2018-11-19 08:17:09 +00:00
const SelectQueryInfo & query_info,
const Context & context,
QueryProcessingStage::Enum processed_stage,
size_t max_block_size,
2018-11-19 08:17:09 +00:00
unsigned num_streams) override;
BlockOutputStreamPtr write(const ASTPtr & query, const Context & context) override;
2018-11-19 08:17:09 +00:00
protected:
StorageHDFS(const String & uri_,
2019-12-04 16:06:55 +00:00
const StorageID & table_id_,
2018-11-19 08:17:09 +00:00
const String & format_name_,
const ColumnsDescription & columns_,
2019-08-24 21:20:20 +00:00
const ConstraintsDescription & constraints_,
Context & context_,
const String & compression_method_);
2018-11-19 08:17:09 +00:00
private:
String uri;
String format_name;
Context & context;
String compression_method;
2018-11-19 08:17:09 +00:00
Logger * log = &Logger::get("StorageHDFS");
};
}
#endif