-
Notifications
You must be signed in to change notification settings - Fork 3
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
Distributed request to tables with Object Storage Engines #615
base: antalya
Are you sure you want to change the base?
Changes from 4 commits
c22bf24
3a11374
dfd14d0
fb3e1b6
28d6c5c
78261d3
ac37da6
db44166
3fafe6f
cfc74ec
df462de
508e4ba
9dbd209
5b923c9
293ac83
5bc11ee
a4943e2
d5d3073
09321d3
17c53f4
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 |
---|---|---|
|
@@ -154,6 +154,14 @@ void StorageAzureConfiguration::fromNamedCollection(const NamedCollection & coll | |
compression_method = collection.getOrDefault<String>("compression_method", collection.getOrDefault<String>("compression", "auto")); | ||
|
||
blobs_paths = {blob_path}; | ||
if (account_name && account_key) | ||
{ | ||
if (saved_params.empty()) | ||
{ | ||
saved_params.push_back(*account_name); | ||
saved_params.push_back(*account_key); | ||
} | ||
} | ||
connection_params = getConnectionParams(connection_url, container_name, account_name, account_key, context); | ||
} | ||
|
||
|
@@ -173,7 +181,6 @@ void StorageAzureConfiguration::fromAST(ASTs & engine_args, ContextPtr context, | |
|
||
std::unordered_map<std::string_view, size_t> engine_args_to_idx; | ||
|
||
|
||
String connection_url = checkAndGetLiteralArgument<String>(engine_args[0], "connection_string/storage_account_url"); | ||
String container_name = checkAndGetLiteralArgument<String>(engine_args[1], "container"); | ||
blob_path = checkAndGetLiteralArgument<String>(engine_args[2], "blobpath"); | ||
|
@@ -279,6 +286,14 @@ void StorageAzureConfiguration::fromAST(ASTs & engine_args, ContextPtr context, | |
} | ||
|
||
blobs_paths = {blob_path}; | ||
if (account_name && account_key) | ||
arthurpassos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
if (saved_params.empty()) | ||
{ | ||
saved_params.push_back(*account_name); | ||
saved_params.push_back(*account_key); | ||
} | ||
} | ||
connection_params = getConnectionParams(connection_url, container_name, account_name, account_key, context); | ||
} | ||
|
||
|
@@ -444,6 +459,22 @@ void StorageAzureConfiguration::addStructureAndFormatToArgsIfNeeded( | |
} | ||
} | ||
|
||
void StorageAzureConfiguration::getTableFunctionArguments(ASTs & args) const | ||
{ | ||
if (!args.empty()) | ||
{ /// Just check | ||
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 would just remove this comment 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. Actually, if you implement this function in the way I suggested in #615 (comment), perhaps this whole if statement is no longer necessary? |
||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Arguments are not empty"); | ||
} | ||
|
||
args.push_back(std::make_shared<ASTLiteral>(connection_params.endpoint.storage_account_url)); | ||
args.push_back(std::make_shared<ASTIdentifier>(connection_params.endpoint.container_name)); | ||
args.push_back(std::make_shared<ASTLiteral>(blob_path)); | ||
for (const auto & arg : saved_params) | ||
{ | ||
args.push_back(std::make_shared<ASTLiteral>(arg)); | ||
} | ||
} | ||
|
||
} | ||
|
||
#endif |
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,31 @@ void StorageS3Configuration::addStructureAndFormatToArgsIfNeeded( | |
} | ||
} | ||
|
||
void StorageS3Configuration::getTableFunctionArguments(ASTs & args) const | ||
{ | ||
if (!args.empty()) | ||
{ /// Just check | ||
throw Exception(ErrorCodes::LOGICAL_ERROR, "Arguments are not empty"); | ||
} | ||
|
||
args.push_back(std::make_shared<ASTLiteral>(url.uri_str)); | ||
if (auth_settings[S3AuthSetting::no_sign_request]) | ||
{ | ||
args.push_back(std::make_shared<ASTLiteral>("NOSIGN")); | ||
} | ||
else | ||
{ | ||
args.push_back(std::make_shared<ASTLiteral>(auth_settings[S3AuthSetting::access_key_id].value)); | ||
args.push_back(std::make_shared<ASTLiteral>(auth_settings[S3AuthSetting::secret_access_key].value)); | ||
if (!auth_settings[S3AuthSetting::session_token].value.empty()) | ||
args.push_back(std::make_shared<ASTLiteral>(auth_settings[S3AuthSetting::session_token].value)); | ||
if (format != "auto") | ||
args.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 |
||
args.push_back(std::make_shared<ASTLiteral>(compression_method)); | ||
} | ||
} | ||
|
||
} | ||
|
||
#endif |
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.
Oh, one more thing. I believe you added this because of a CI/CD failure. @Enmk has merged a PR that fixes this. Perhaps you want to update your branch?