Merge pull request #16586 from kitaisreal/create-query-nested-type-column-formatting-intendation-fix

CreateQuery nested type column formatting fix
This commit is contained in:
alexey-milovidov 2020-11-07 13:42:20 +03:00 committed by GitHub
commit 59ea3e7db0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 6 deletions

View File

@ -55,7 +55,11 @@ void ASTColumnDeclaration::formatImpl(const FormatSettings & settings, FormatSta
if (type)
{
settings.ostr << ' ';
type->formatImpl(settings, state, frame);
FormatStateStacked type_frame = frame;
type_frame.indent = 0;
type->formatImpl(settings, state, type_frame);
}
if (null_modifier)

View File

@ -1,12 +1,12 @@
CREATE TABLE default.tuple
(
`j` Tuple( a Int8, b String)
`j` Tuple(a Int8, b String)
)
ENGINE = Memory
j Tuple(a Int8, b String)
CREATE TABLE default.tuple
(
`j` Tuple( a Int8, b String)
`j` Tuple(a Int8, b String)
)
ENGINE = Memory
j Tuple(a Int8, b String)

View File

@ -10,9 +10,7 @@ SHOW CREATE TABLE tuple FORMAT TSVRaw;
DESC tuple;
DROP TABLE tuple;
CREATE TABLE tuple
ENGINE = Memory AS
SELECT CAST((1, 'Test'), 'Tuple(a Int8, b String)') AS j;
CREATE TABLE tuple ENGINE = Memory AS SELECT CAST((1, 'Test'), 'Tuple(a Int8, b String)') AS j;
SHOW CREATE TABLE tuple FORMAT TSVRaw;
DESC tuple;

View File

@ -0,0 +1,12 @@
CREATE TABLE test
(
`a` Int64,
`b` NESTED(a Int64)
)
ENGINE = TinyLog
CREATE TABLE test
(
`a` Int64,
`b` TUPLE(a Int64)
)
ENGINE = TinyLog

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. "$CURDIR"/../shell_config.sh
echo "CREATE TABLE test(a Int64, b NESTED(a Int64)) ENGINE=TinyLog" | $CLICKHOUSE_FORMAT
echo "CREATE TABLE test(a Int64, b TUPLE(a Int64)) ENGINE=TinyLog" | $CLICKHOUSE_FORMAT