ClickHouse/src/Storages/StorageHudi.h

60 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-08-08 14:10:50 +00:00
#include <Storages/IStorage.h>
2022-08-22 09:37:20 +00:00
#include <Storages/StorageS3.h>
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_,
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();
2022-09-19 15:23:07 +00:00
static std::string generateQueryFromKeys(std::vector<std::string> && keys);
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