ClickHouse/src/TableFunctions/TableFunctionHDFSCluster.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.6 KiB
C++
Raw Normal View History

2021-12-03 05:25:14 +00:00
#pragma once
#include "config.h"
2021-12-03 05:25:14 +00:00
#if USE_HDFS
#include <TableFunctions/ITableFunctionFileLike.h>
#include <TableFunctions/TableFunctionHDFS.h>
#include <TableFunctions/ITableFunctionCluster.h>
2021-12-03 05:25:14 +00:00
namespace DB
{
class Context;
/**
* hdfsCluster(cluster, URI, format, structure, compression_method)
* A table function, which allows to process many files from HDFS on a specific cluster
* On initiator it creates a connection to _all_ nodes in cluster, discloses asterisks
2021-12-03 05:25:14 +00:00
* in HDFS file path and dispatch each file dynamically.
* On worker node it asks initiator about next task to process, processes it.
* This is repeated until the tasks are finished.
*/
class TableFunctionHDFSCluster : public ITableFunctionCluster<TableFunctionHDFS>
2021-12-03 05:25:14 +00:00
{
public:
static constexpr auto name = "hdfsCluster";
static constexpr auto signature = " - cluster_name, uri\n"
" - cluster_name, uri, format\n"
" - cluster_name, uri, format, structure\n"
" - cluster_name, uri, format, structure, compression_method\n";
String getName() const override
2021-12-03 05:25:14 +00:00
{
return name;
}
String getSignature() const override
{
return signature;
}
2021-12-03 05:25:14 +00:00
protected:
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;
2021-12-03 05:25:14 +00:00
const char * getStorageTypeName() const override { return "HDFSCluster"; }
};
}
#endif