Skip to content

clickhouse-format not working for nested variable #8730

@chhetripradeep

Description

@chhetripradeep

(you don't have to strictly follow this form)

Describe the bug or unexpected behaviour

ClickHouse client version 19.16.10.44 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 19.16.10 revision 54427.

be22fd9abd2a :) CREATE TABLE test
:-] (
:-]     foobar Nested(
:-]         name String,
:-]         value String
:-]     )
:-] )
:-] ENGINE = Null

CREATE TABLE test
(
    `foobar` Nested(
    name String,
    value String)
)
ENGINE = Null

Ok.

0 rows in set. Elapsed: 0.008 sec.

be22fd9abd2a :) SHOW CREATE TABLE test

SHOW CREATE TABLE test

┌─statement───────────────────────────────────────────────────────────────────────────────────────────┐
│ CREATE TABLE default.test (`foobar.name` Array(String), `foobar.value` Array(String)) ENGINE = Null │
└─────────────────────────────────────────────────────────────────────────────────────────────────────┘

1 rows in set. Elapsed: 0.003 sec.

be22fd9abd2a :) Bye.
root@be22fd9abd2a:/# clickhouse-format <<< clickhouse-format <<< "CREATE TABLE default.test (foobar.name Array(String), foobar.value Array(String)) ENGINE = Null"
Code: 62, e.displayText() = DB::Exception: Syntax error (query): failed at position 34: .name Array(String), foobar.value Array(String)) ENGINE = Null
. Expected one of: identifier with optional parameters, DEFAULT, MATERIALIZED, ALIAS, function, COMMENT, CODEC, identifier, nested table, identifier with parameters, Stack trace:

0. 0x5617816a6a00 StackTrace::StackTrace() /usr/bin/clickhouse
1. 0x5617816a67d5 DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int) /usr/bin/clickhouse
2. 0x5617814fda8f ? /usr/bin/clickhouse
3. 0x561781810918 mainEntryClickHouseFormat(int, char**) /usr/bin/clickhouse
4. 0x5617815e310d main /usr/bin/clickhouse
5. 0x7fce5dabfb97 __libc_start_main /lib/x86_64-linux-gnu/libc-2.27.so
6. 0x56178164c53a _start /usr/bin/clickhouse
 (version 19.16.10.44 (official build))
root@be22fd9abd2a:/#

How to reproduce

  • Which ClickHouse server version to use
    yandex/clickhouse-server:19.16.10.44

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed user-visible misbehaviour in official releaseinvalid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions