Merge pull request #22588 from foolchi/fix_dist_map_select

fix dist map type select
This commit is contained in:
Ilya Yatsishin 2021-04-07 11:53:23 +03:00 committed by GitHub
commit ed2d82603e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -491,14 +491,14 @@ void ASTFunction::formatImplWithoutAlias(const FormatSettings & settings, Format
if (!written && 0 == strcmp(name.c_str(), "map")) if (!written && 0 == strcmp(name.c_str(), "map"))
{ {
settings.ostr << (settings.hilite ? hilite_operator : "") << '{' << (settings.hilite ? hilite_none : ""); settings.ostr << (settings.hilite ? hilite_operator : "") << "map(" << (settings.hilite ? hilite_none : "");
for (size_t i = 0; i < arguments->children.size(); ++i) for (size_t i = 0; i < arguments->children.size(); ++i)
{ {
if (i != 0) if (i != 0)
settings.ostr << ", "; settings.ostr << ", ";
arguments->children[i]->formatImpl(settings, state, nested_dont_need_parens); arguments->children[i]->formatImpl(settings, state, nested_dont_need_parens);
} }
settings.ostr << (settings.hilite ? hilite_operator : "") << '}' << (settings.hilite ? hilite_none : ""); settings.ostr << (settings.hilite ? hilite_operator : "") << ')' << (settings.hilite ? hilite_none : "");
written = true; written = true;
} }
} }

View File

@ -0,0 +1,2 @@
{'a':1,'b':2}
{'a':1,'b':2}

View File

@ -0,0 +1 @@
SELECT map('a', 1, 'b', 2) FROM remote('127.0.0.{1,2}', system, one);