mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
fix conversion function to literal
This commit is contained in:
parent
3567e18f6e
commit
6cbcfd706f
@ -32,7 +32,7 @@ void ASTFunction::appendColumnNameImpl(WriteBuffer & ostr) const
|
||||
if (name == "view")
|
||||
throw Exception("Table function view cannot be used as an expression", ErrorCodes::UNEXPECTED_EXPRESSION);
|
||||
|
||||
/// If function can be converted to literal it will be parsed as literal after formating.
|
||||
/// If function can be converted to literal it will be parsed as literal after formatting.
|
||||
/// In distributed query it may lead to mismathed column names.
|
||||
/// To avoid it we check whether we can convert function to literal.
|
||||
if (auto literal = toLiteral())
|
||||
@ -135,6 +135,8 @@ static ASTPtr createLiteral(const ASTs & arguments)
|
||||
{
|
||||
if (auto func_literal = func->toLiteral())
|
||||
container.push_back(func_literal->as<ASTLiteral>()->value);
|
||||
else
|
||||
return {};
|
||||
}
|
||||
else
|
||||
/// Some of the Array or Tuple arguments is not literal
|
||||
|
@ -8,3 +8,4 @@
|
||||
(0,1)
|
||||
[[0,1],[2,3]]
|
||||
[[0,1],[0,0]]
|
||||
[[[0]],[[1],[2,3]]]
|
||||
|
@ -8,3 +8,4 @@ SELECT any(array(number, 1)) AS k FROM remote('127.0.0.{1,2}', numbers(10));
|
||||
SELECT any(tuple(number, 1)) AS k FROM remote('127.0.0.{1,2}', numbers(10));
|
||||
SELECT any(array(array(0, 1), [2, 3])) AS k FROM remote('127.0.0.{1,2}', numbers(10));
|
||||
SELECT any(array(array(0, 1), [number, number])) AS k FROM remote('127.0.0.{1,2}', numbers(10));
|
||||
SELECT any([[[number]],[[number + 1], [number + 2, number + 3]]]) AS k FROM remote('127.0.0.{1,2}', numbers(10));
|
||||
|
Loading…
Reference in New Issue
Block a user