-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GLUTEN-6590][CH] Support compact mergetree file on s3 #6591
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,7 +569,7 @@ std::vector<String> BackendInitializerUtil::wrapDiskPathConfig( | |
if (path_prefix.empty() && path_suffix.empty()) | ||
return changed_paths; | ||
Poco::Util::AbstractConfiguration::Keys disks; | ||
std::unordered_set<String> disk_types = {"s3", "hdfs_gluten", "cache"}; | ||
std::unordered_set<String> disk_types = {"s3_gluten", "hdfs_gluten", "cache"}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GlutenClickHouseWholeStageTransformerSuite configuration of disk type for UT should be changed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
config.keys("storage_configuration.disks", disks); | ||
|
||
std::ranges::for_each( | ||
|
@@ -590,7 +590,7 @@ std::vector<String> BackendInitializerUtil::wrapDiskPathConfig( | |
changed_paths.emplace_back(final_path); | ||
} | ||
} | ||
else if (disk_type == "s3" || disk_type == "hdfs_gluten") | ||
else if (disk_type == "s3_gluten" || disk_type == "hdfs_gluten") | ||
{ | ||
String metadata_path = config.getString(disk_prefix + ".metadata_path", ""); | ||
if (!metadata_path.empty()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
|
||
#include "GlutenDiskS3.h" | ||
#include <Disks/ObjectStorages/DiskObjectStorage.h> | ||
#include <Parser/SerializedPlanParser.h> | ||
#include "CompactObjectStorageDiskTransaction.h" | ||
|
||
#if USE_AWS_S3 | ||
namespace local_engine | ||
{ | ||
|
||
DB::DiskTransactionPtr GlutenDiskS3::createTransaction() | ||
{ | ||
return std::make_shared<CompactObjectStorageDiskTransaction>(*this, SerializedPlanParser::global_context->getTempDataOnDisk()->getVolume()->getDisk()); | ||
} | ||
|
||
std::unique_ptr<ReadBufferFromFileBase> GlutenDiskS3::readFile( | ||
const String & path, | ||
const ReadSettings & settings, | ||
std::optional<size_t> read_hint, | ||
std::optional<size_t> file_size) const | ||
{ | ||
ReadSettings copy_settings = settings; | ||
// Threadpool read is not supported for s3 compact version currently | ||
copy_settings.remote_fs_method = RemoteFSReadMethod::read; | ||
return DiskObjectStorage::readFile(path, copy_settings, read_hint, file_size); | ||
} | ||
|
||
DiskObjectStoragePtr GlutenDiskS3::createDiskObjectStorage() | ||
{ | ||
const auto config_prefix = "storage_configuration.disks." + name; | ||
return std::make_shared<GlutenDiskS3>( | ||
getName(), | ||
object_key_prefix, | ||
getMetadataStorage(), | ||
getObjectStorage(), | ||
SerializedPlanParser::global_context->getConfigRef(), | ||
config_prefix, | ||
object_storage_creator); | ||
} | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
|
||
#include <Disks/ObjectStorages/DiskObjectStorage.h> | ||
#include <Parser/SerializedPlanParser.h> | ||
#include "CompactObjectStorageDiskTransaction.h" | ||
|
||
#if USE_AWS_S3 | ||
namespace local_engine | ||
{ | ||
class GlutenDiskS3 : public DB::DiskObjectStorage | ||
{ | ||
public: | ||
GlutenDiskS3( | ||
const String & name_, | ||
const String & object_key_prefix_, | ||
DB::MetadataStoragePtr metadata_storage_, | ||
DB::ObjectStoragePtr object_storage_, | ||
const Poco::Util::AbstractConfiguration & config, | ||
const String & config_prefix, | ||
std::function<DB::ObjectStoragePtr(const Poco::Util::AbstractConfiguration & conf, DB::ContextPtr context)> creator) | ||
: DiskObjectStorage(name_, object_key_prefix_, metadata_storage_, object_storage_, config, config_prefix), | ||
object_storage_creator(creator) {} | ||
|
||
DB::DiskTransactionPtr createTransaction() override; | ||
|
||
std::unique_ptr<ReadBufferFromFileBase> readFile( | ||
const String & path, | ||
const ReadSettings & settings, | ||
std::optional<size_t> read_hint, | ||
std::optional<size_t> file_size) const override; | ||
|
||
DiskObjectStoragePtr createDiskObjectStorage() override; | ||
|
||
private: | ||
std::function<DB::ObjectStoragePtr(const Poco::Util::AbstractConfiguration & conf, DB::ContextPtr context)> object_storage_creator; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why add this config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test directly merge parts on s3. See this code branch