mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 21:51:57 +00:00
Fix engine bug
This commit is contained in:
parent
3e87fd0ee4
commit
2abe284859
@ -33,6 +33,7 @@ StorageHudi::StorageHudi(
|
||||
: IStorage(table_id_)
|
||||
, base_configuration({uri_, access_key_, secret_access_key_, {}, {}, {}})
|
||||
, log(&Poco::Logger::get("StorageHudi (" + table_id_.table_name + ")"))
|
||||
, table_path(uri_.key)
|
||||
{
|
||||
StorageInMemoryMetadata storage_metadata;
|
||||
updateS3Configuration(context_, base_configuration);
|
||||
@ -42,7 +43,7 @@ StorageHudi::StorageHudi(
|
||||
auto new_uri = base_configuration.uri.uri.toString() + generateQueryFromKeys(std::move(keys));
|
||||
|
||||
LOG_DEBUG(log, "New uri: {}", new_uri);
|
||||
|
||||
LOG_DEBUG(log, "Table path: {}", table_path);
|
||||
auto s3_uri = S3::URI(Poco::URI(new_uri));
|
||||
|
||||
if (columns_.empty())
|
||||
@ -143,9 +144,9 @@ std::vector<std::string> StorageHudi::getKeysFromS3()
|
||||
|
||||
bool is_finished{false};
|
||||
const auto bucket{base_configuration.uri.bucket};
|
||||
const std::string key = "";
|
||||
|
||||
request.SetBucket(bucket);
|
||||
request.SetPrefix(table_path);
|
||||
|
||||
while (!is_finished)
|
||||
{
|
||||
@ -155,16 +156,16 @@ std::vector<std::string> StorageHudi::getKeysFromS3()
|
||||
ErrorCodes::S3_ERROR,
|
||||
"Could not list objects in bucket {} with key {}, S3 exception: {}, message: {}",
|
||||
quoteString(bucket),
|
||||
quoteString(key),
|
||||
quoteString(table_path),
|
||||
backQuote(outcome.GetError().GetExceptionName()),
|
||||
quoteString(outcome.GetError().GetMessage()));
|
||||
|
||||
const auto & result_batch = outcome.GetResult().GetContents();
|
||||
for (const auto & obj : result_batch)
|
||||
{
|
||||
const auto & filename = obj.GetKey();
|
||||
const auto & filename = obj.GetKey().substr(table_path.size()); // object name without tablepath prefix
|
||||
keys.push_back(filename);
|
||||
//LOG_DEBUG(log, "Found file: {}", filename);
|
||||
LOG_DEBUG(log, "Found file: {}", filename);
|
||||
}
|
||||
|
||||
request.SetContinuationToken(outcome.GetResult().GetNextContinuationToken());
|
||||
|
@ -53,6 +53,7 @@ private:
|
||||
StorageS3::S3Configuration base_configuration;
|
||||
std::shared_ptr<StorageS3> s3engine;
|
||||
Poco::Logger * log;
|
||||
String table_path;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user