mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 04:12:19 +00:00
Merge pull request #68504 from ClickHouse/miscellaneous-3
Miscellaneous
This commit is contained in:
commit
7fd2207626
@ -2564,8 +2564,8 @@ void checkFunctionNodeHasEmptyNullsAction(FunctionNode const & node)
|
|||||||
if (node.getNullsAction() != NullsAction::EMPTY)
|
if (node.getNullsAction() != NullsAction::EMPTY)
|
||||||
throw Exception(
|
throw Exception(
|
||||||
ErrorCodes::SYNTAX_ERROR,
|
ErrorCodes::SYNTAX_ERROR,
|
||||||
"Function with name '{}' cannot use {} NULLS",
|
"Function with name {} cannot use {} NULLS",
|
||||||
node.getFunctionName(),
|
backQuote(node.getFunctionName()),
|
||||||
node.getNullsAction() == NullsAction::IGNORE_NULLS ? "IGNORE" : "RESPECT");
|
node.getNullsAction() == NullsAction::IGNORE_NULLS ? "IGNORE" : "RESPECT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3228,16 +3228,16 @@ ProjectionNames QueryAnalyzer::resolveFunction(QueryTreeNodePtr & node, Identifi
|
|||||||
auto hints = NamePrompter<2>::getHints(function_name, possible_function_names);
|
auto hints = NamePrompter<2>::getHints(function_name, possible_function_names);
|
||||||
|
|
||||||
throw Exception(ErrorCodes::UNKNOWN_FUNCTION,
|
throw Exception(ErrorCodes::UNKNOWN_FUNCTION,
|
||||||
"Function with name '{}' does not exist. In scope {}{}",
|
"Function with name {} does not exist. In scope {}{}",
|
||||||
function_name,
|
backQuote(function_name),
|
||||||
scope.scope_node->formatASTForErrorMessage(),
|
scope.scope_node->formatASTForErrorMessage(),
|
||||||
getHintsErrorMessageSuffix(hints));
|
getHintsErrorMessageSuffix(hints));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_lambda_arguments_indexes.empty())
|
if (!function_lambda_arguments_indexes.empty())
|
||||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD,
|
throw Exception(ErrorCodes::UNSUPPORTED_METHOD,
|
||||||
"Aggregate function '{}' does not support lambda arguments",
|
"Aggregate function {} does not support lambda arguments",
|
||||||
function_name);
|
backQuote(function_name));
|
||||||
|
|
||||||
auto action = function_node_ptr->getNullsAction();
|
auto action = function_node_ptr->getNullsAction();
|
||||||
std::string aggregate_function_name = rewriteAggregateFunctionNameIfNeeded(function_name, action, scope.context);
|
std::string aggregate_function_name = rewriteAggregateFunctionNameIfNeeded(function_name, action, scope.context);
|
||||||
@ -3679,10 +3679,10 @@ ProjectionNames QueryAnalyzer::resolveExpressionNode(
|
|||||||
|
|
||||||
auto hints = IdentifierResolver::collectIdentifierTypoHints(unresolved_identifier, valid_identifiers);
|
auto hints = IdentifierResolver::collectIdentifierTypoHints(unresolved_identifier, valid_identifiers);
|
||||||
|
|
||||||
throw Exception(ErrorCodes::UNKNOWN_IDENTIFIER, "Unknown {}{} identifier '{}' in scope {}{}",
|
throw Exception(ErrorCodes::UNKNOWN_IDENTIFIER, "Unknown {}{} identifier {} in scope {}{}",
|
||||||
toStringLowercase(IdentifierLookupContext::EXPRESSION),
|
toStringLowercase(IdentifierLookupContext::EXPRESSION),
|
||||||
message_clarification,
|
message_clarification,
|
||||||
unresolved_identifier.getFullName(),
|
backQuote(unresolved_identifier.getFullName()),
|
||||||
scope.scope_node->formatASTForErrorMessage(),
|
scope.scope_node->formatASTForErrorMessage(),
|
||||||
getHintsErrorMessageSuffix(hints));
|
getHintsErrorMessageSuffix(hints));
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ def test_access_rights_for_function():
|
|||||||
function_resolution_error = instance.query_and_get_error("SELECT MySum(1, 2)")
|
function_resolution_error = instance.query_and_get_error("SELECT MySum(1, 2)")
|
||||||
assert (
|
assert (
|
||||||
"Unknown function MySum" in function_resolution_error
|
"Unknown function MySum" in function_resolution_error
|
||||||
or "Function with name 'MySum' does not exist." in function_resolution_error
|
or "Function with name `MySum` does not exist." in function_resolution_error
|
||||||
)
|
)
|
||||||
|
|
||||||
instance.query("REVOKE CREATE FUNCTION ON *.* FROM A")
|
instance.query("REVOKE CREATE FUNCTION ON *.* FROM A")
|
||||||
|
@ -28,7 +28,7 @@ def test_sql_user_defined_functions_on_cluster():
|
|||||||
error_message = node.query_and_get_error("SELECT test_function(1);")
|
error_message = node.query_and_get_error("SELECT test_function(1);")
|
||||||
assert (
|
assert (
|
||||||
"Unknown function test_function" in error_message
|
"Unknown function test_function" in error_message
|
||||||
or "Function with name 'test_function' does not exist. In scope SELECT test_function(1)"
|
or "Function with name `test_function` does not exist. In scope SELECT test_function(1)"
|
||||||
in error_message
|
in error_message
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1587,7 +1587,7 @@ def test_hive_partitioning_without_setting(cluster):
|
|||||||
f"blob_path='{path}', format='CSVWithNames', structure='{table_format}');"
|
f"blob_path='{path}', format='CSVWithNames', structure='{table_format}');"
|
||||||
)
|
)
|
||||||
pattern = re.compile(
|
pattern = re.compile(
|
||||||
r"DB::Exception: Unknown expression identifier '.*' in scope.*", re.DOTALL
|
r"DB::Exception: Unknown expression identifier `.*` in scope.*", re.DOTALL
|
||||||
)
|
)
|
||||||
|
|
||||||
with pytest.raises(Exception, match=pattern):
|
with pytest.raises(Exception, match=pattern):
|
||||||
|
@ -1284,7 +1284,7 @@ def test_hive_partitioning_without_setting(started_cluster):
|
|||||||
== f"Elizabeth\tGordon\n"
|
== f"Elizabeth\tGordon\n"
|
||||||
)
|
)
|
||||||
pattern = re.compile(
|
pattern = re.compile(
|
||||||
r"DB::Exception: Unknown expression identifier '.*' in scope.*", re.DOTALL
|
r"DB::Exception: Unknown expression identifier `.*` in scope.*", re.DOTALL
|
||||||
)
|
)
|
||||||
|
|
||||||
with pytest.raises(QueryRuntimeException, match=pattern):
|
with pytest.raises(QueryRuntimeException, match=pattern):
|
||||||
|
@ -43,20 +43,20 @@ def test_persistence():
|
|||||||
error_message = instance.query_and_get_error("SELECT MySum1(1, 2)")
|
error_message = instance.query_and_get_error("SELECT MySum1(1, 2)")
|
||||||
assert (
|
assert (
|
||||||
"Unknown function MySum1" in error_message
|
"Unknown function MySum1" in error_message
|
||||||
or "Function with name 'MySum1' does not exist. In scope SELECT MySum1(1, 2)"
|
or "Function with name `MySum1` does not exist. In scope SELECT MySum1(1, 2)"
|
||||||
in error_message
|
in error_message
|
||||||
)
|
)
|
||||||
|
|
||||||
error_message = instance.query_and_get_error("SELECT MySum2(1, 2)")
|
error_message = instance.query_and_get_error("SELECT MySum2(1, 2)")
|
||||||
assert (
|
assert (
|
||||||
"Unknown function MySum2" in error_message
|
"Unknown function MySum2" in error_message
|
||||||
or "Function with name 'MySum2' does not exist. In scope SELECT MySum2(1, 2)"
|
or "Function with name `MySum2` does not exist. In scope SELECT MySum2(1, 2)"
|
||||||
in error_message
|
in error_message
|
||||||
)
|
)
|
||||||
|
|
||||||
error_message = instance.query_and_get_error("SELECT MyUnion()")
|
error_message = instance.query_and_get_error("SELECT MyUnion()")
|
||||||
assert (
|
assert (
|
||||||
"Unknown function MyUnion" in error_message
|
"Unknown function MyUnion" in error_message
|
||||||
or "Function with name 'MyUnion' does not exist. In scope SELECT MyUnion"
|
or "Function with name `MyUnion` does not exist. In scope SELECT MyUnion"
|
||||||
in error_message
|
in error_message
|
||||||
)
|
)
|
||||||
|
@ -8,6 +8,6 @@ system flush logs;
|
|||||||
|
|
||||||
select count() > 0 from system.text_log where message_format_string = 'Peak memory usage{}: {}.' and value1 is not null and value2 like '% MiB';
|
select count() > 0 from system.text_log where message_format_string = 'Peak memory usage{}: {}.' and value1 is not null and value2 like '% MiB';
|
||||||
|
|
||||||
select count() > 0 from system.text_log where level = 'Error' and message_format_string = 'Unknown {}{} identifier \'{}\' in scope {}{}' and value1 = 'expression' and value3 = 'count' and value4 = 'SELECT count';
|
select count() > 0 from system.text_log where level = 'Error' and message_format_string = 'Unknown {}{} identifier {} in scope {}{}' and value1 = 'expression' and value3 = '`count`' and value4 = 'SELECT count';
|
||||||
|
|
||||||
select count() > 0 from system.text_log where level = 'Error' and message_format_string = 'Function with name \'{}\' does not exist. In scope {}{}' and value1 = 'conut' and value2 = 'SELECT conut()' and value3 ilike '%\'count\'%';
|
select count() > 0 from system.text_log where level = 'Error' and message_format_string = 'Function with name {} does not exist. In scope {}{}' and value1 = '`conut`' and value2 = 'SELECT conut()' and value3 ilike '%\'count\'%';
|
||||||
|
Loading…
Reference in New Issue
Block a user