-
Notifications
You must be signed in to change notification settings - Fork 7
Distributed request to tables with Object Storage Engines #615
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
Changes from all commits
c22bf24
3a11374
dfd14d0
fb3e1b6
28d6c5c
78261d3
ac37da6
db44166
3fafe6f
cfc74ec
df462de
508e4ba
9dbd209
5b923c9
293ac83
5bc11ee
a4943e2
d5d3073
09321d3
17c53f4
e5dc250
14da835
0ccb6e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -363,11 +363,11 @@ void StorageS3Configuration::fromAST(ASTs & args, ContextPtr context, bool with_ | |
|
||
if (engine_args_to_idx.contains("format")) | ||
{ | ||
format = checkAndGetLiteralArgument<String>(args[engine_args_to_idx["format"]], "format"); | ||
auto format_ = checkAndGetLiteralArgument<String>(args[engine_args_to_idx["format"]], "format"); | ||
/// Set format to configuration only of it's not 'auto', | ||
/// because we can have default format set in configuration. | ||
if (format != "auto") | ||
format = format; | ||
arthurpassos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if (format_ != "auto") | ||
format = format_; | ||
} | ||
|
||
if (engine_args_to_idx.contains("structure")) | ||
|
@@ -585,6 +585,30 @@ void StorageS3Configuration::addStructureAndFormatToArgsIfNeeded( | |
} | ||
} | ||
|
||
ASTPtr StorageS3Configuration::createArgsWithAccessData() const | ||
{ | ||
auto arguments = std::make_shared<ASTExpressionList>(); | ||
|
||
arguments->children.push_back(std::make_shared<ASTLiteral>(url.uri_str)); | ||
if (auth_settings[S3AuthSetting::no_sign_request]) | ||
{ | ||
arguments->children.push_back(std::make_shared<ASTLiteral>("NOSIGN")); | ||
} | ||
else | ||
{ | ||
arguments->children.push_back(std::make_shared<ASTLiteral>(auth_settings[S3AuthSetting::access_key_id].value)); | ||
arguments->children.push_back(std::make_shared<ASTLiteral>(auth_settings[S3AuthSetting::secret_access_key].value)); | ||
if (!auth_settings[S3AuthSetting::session_token].value.empty()) | ||
arguments->children.push_back(std::make_shared<ASTLiteral>(auth_settings[S3AuthSetting::session_token].value)); | ||
if (format != "auto") | ||
arguments->children.push_back(std::make_shared<ASTLiteral>(format)); | ||
if (!compression_method.empty()) | ||
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. Is it ok not to add some other arguments like 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. Yes, this fields are already added in 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. Nitpick: perhaps add a comment saying this is already added somewhere else? 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. I think I rename method to |
||
arguments->children.push_back(std::make_shared<ASTLiteral>(compression_method)); | ||
} | ||
|
||
return arguments; | ||
} | ||
|
||
} | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,9 @@ String StorageObjectStorage::getPathSample(ContextPtr context) | |
if (context->getSettingsRef()[Setting::use_hive_partitioning]) | ||
local_distributed_processing = false; | ||
|
||
if (!configuration->isArchive() && !configuration->isPathWithGlobs() && !local_distributed_processing) | ||
return configuration->getPath(); | ||
|
||
auto file_iterator = StorageObjectStorageSource::createFileIterator( | ||
configuration, | ||
query_settings, | ||
|
@@ -72,9 +75,6 @@ String StorageObjectStorage::getPathSample(ContextPtr context) | |
{} // file_progress_callback | ||
); | ||
|
||
if (!configuration->isArchive() && !configuration->isPathWithGlobs() && !local_distributed_processing) | ||
return configuration->getPath(); | ||
|
||
if (auto file = file_iterator->next(0)) | ||
return file->getPath(); | ||
return ""; | ||
|
@@ -165,6 +165,13 @@ void StorageObjectStorage::Configuration::update(ObjectStoragePtr object_storage | |
{ | ||
IObjectStorage::ApplyNewSettingsOptions options{.allow_client_change = !isStaticConfiguration()}; | ||
object_storage_ptr->applyNewSettings(context->getConfigRef(), getTypeName() + ".", context, options); | ||
updated = true; | ||
} | ||
|
||
void StorageObjectStorage::Configuration::updateIfRequired(ObjectStoragePtr object_storage_ptr, ContextPtr local_context) | ||
{ | ||
if (!updated) | ||
Member
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. how critical is it to avoid updating settings multiple times? What happens if update is done concurrently? Thread sanitizer reports that there is a datarace on So we have two options here:
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. Nothing destructive, but if cache turned off it causes additional requests to remote storage. With cache it changes cache hit rate, also nothing except some tests based on calculation cache hits failed. 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. Yep. I added atomic it in upstream and forget to add for Antalya, it's my fault. |
||
update(object_storage_ptr, local_context); | ||
} | ||
|
||
bool StorageObjectStorage::hasExternalDynamicMetadata() const | ||
|
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 move the implementation to the header file?
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.
Single line implementation. In my opinion single-line implementation in header is more readable and simple to understanding than separate implementation in cpp-file, when declaration and implementation in two different places.