ClickHouse/src/Storages/StorageHudi.h

61 lines
1.2 KiB
C++
Raw Normal View History

2022-08-08 14:10:50 +00:00
#pragma once
#include "config_core.h"
2022-09-07 07:16:32 +00:00
#if USE_AWS_S3
2022-09-28 11:21:32 +00:00
# include <Storages/IStorage.h>
# include <Storages/StorageS3.h>
2022-08-22 09:37:20 +00:00
2022-08-26 18:17:32 +00:00
namespace Poco
{
class Logger;
2022-08-22 09:37:20 +00:00
}
namespace Aws::S3
{
2022-08-26 18:17:32 +00:00
class S3Client;
2022-08-22 09:37:20 +00:00
}
2022-08-08 14:10:50 +00:00
namespace DB
{
2022-08-26 18:17:32 +00:00
class StorageHudi : public IStorage
{
2022-08-08 14:10:50 +00:00
public:
StorageHudi(
2022-08-26 18:17:32 +00:00
const S3::URI & uri_,
const String & access_key_,
const String & secret_access_key_,
2022-08-08 14:10:50 +00:00
const StorageID & table_id_,
const String & format_,
2022-08-26 18:17:32 +00:00
ColumnsDescription columns_,
2022-08-24 15:07:37 +00:00
const ConstraintsDescription & constraints_,
2022-08-22 09:37:20 +00:00
const String & comment,
2022-08-26 18:17:32 +00:00
ContextPtr context_);
2022-08-08 14:10:50 +00:00
String getName() const override { return "Hudi"; }
2022-08-22 09:37:20 +00:00
2022-08-24 15:07:37 +00:00
Pipe read(
const Names & column_names,
const StorageSnapshotPtr & storage_snapshot,
SelectQueryInfo & query_info,
ContextPtr context,
QueryProcessingStage::Enum processed_stage,
size_t max_block_size,
unsigned num_streams) override;
private:
std::vector<std::string> getKeysFromS3();
static std::string generateQueryFromKeys(std::vector<std::string> && keys, String format);
2022-08-24 15:07:37 +00:00
2022-08-25 08:48:49 +00:00
StorageS3::S3Configuration base_configuration;
std::shared_ptr<StorageS3> s3engine;
2022-08-22 09:37:20 +00:00
Poco::Logger * log;
2022-08-30 17:38:02 +00:00
String table_path;
2022-08-08 14:10:50 +00:00
};
}
2022-09-07 07:16:32 +00:00
#endif