mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fix tests
This commit is contained in:
parent
a8f83a387c
commit
5353981500
@ -86,19 +86,20 @@ void TableFunctionS3::parseArguments(const ASTPtr & ast_function, ContextPtr con
|
|||||||
/// We can distinguish them by looking at the 2-nd argument: check if it's a format name or not.
|
/// We can distinguish them by looking at the 2-nd argument: check if it's a format name or not.
|
||||||
if (args.size() == 4)
|
if (args.size() == 4)
|
||||||
{
|
{
|
||||||
auto last_arg = args[1]->as<ASTLiteral &>().value.safeGet<String>();
|
auto second_arg = args[1]->as<ASTLiteral &>().value.safeGet<String>();
|
||||||
if (FormatFactory::instance().getAllFormats().contains(last_arg))
|
if (FormatFactory::instance().getAllFormats().contains(second_arg))
|
||||||
args_to_idx = {{"access_key_id", 1}, {"secret_access_key", 2}, {"format", 3}};
|
|
||||||
else
|
|
||||||
args_to_idx = {{"format", 1}, {"structure", 2}, {"compression_method", 3}};
|
args_to_idx = {{"format", 1}, {"structure", 2}, {"compression_method", 3}};
|
||||||
|
|
||||||
|
else
|
||||||
|
args_to_idx = {{"access_key_id", 1}, {"secret_access_key", 2}, {"format", 3}};
|
||||||
}
|
}
|
||||||
/// For 3 arguments we support 2 possible variants:
|
/// For 3 arguments we support 2 possible variants:
|
||||||
/// s3(source, format, structure) and s3(source, access_key_id, access_key_id)
|
/// s3(source, format, structure) and s3(source, access_key_id, access_key_id)
|
||||||
/// We can distinguish them by looking at the 2-nd argument: check if it's a format name or not.
|
/// We can distinguish them by looking at the 2-nd argument: check if it's a format name or not.
|
||||||
else if (args.size() == 3)
|
else if (args.size() == 3)
|
||||||
{
|
{
|
||||||
auto third_arg = args[1]->as<ASTLiteral &>().value.safeGet<String>();
|
auto second_arg = args[1]->as<ASTLiteral &>().value.safeGet<String>();
|
||||||
if (FormatFactory::instance().getAllFormats().contains(third_arg))
|
if (FormatFactory::instance().getAllFormats().contains(second_arg))
|
||||||
args_to_idx = {{"format", 1}, {"structure", 2}};
|
args_to_idx = {{"format", 1}, {"structure", 2}};
|
||||||
else
|
else
|
||||||
args_to_idx = {{"access_key_id", 1}, {"secret_access_key", 2}};
|
args_to_idx = {{"access_key_id", 1}, {"secret_access_key", 2}};
|
||||||
|
Loading…
Reference in New Issue
Block a user