Схема:
CREATE TABLE test.data_types
(
`computer_group` Array(String),
`computer_id` UInt64,
`computer_name` String,
`dns_name` String,
`ip` IPv4,
`os` Nullable(String),
`last_report_time` Nullable(DateTime),
`first_report_time` Nullable(Date),
`cpu` Nullable(String),
`mac_address` Array(Nullable(String))
)
ENGINE = MergeTree
ORDER BY computer_id
Заливаю так:
cat data_types_test.tsv | clickhouse-client --query "INSERT INTO test.data_types FORMAT TSV" -u default --password pass
Ошибка:
Code: 130. DB::Exception: Array does not start with '[' character: (at row 1)
Row 1:
Column 0, name: computer_group, type: Array(String), parsed text: <EMPTY>ERROR
Code: 130. DB::Exception: Array does not start with '[' character. (CANNOT_READ_ARRAY_FROM_TEXT) (version 21.11.3.6 (official build))
. (CANNOT_READ_ARRAY_FROM_TEXT), Stack trace (when copying this message, always include the lines below):
0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0x9b63054 in /usr/bin/clickhouse
1. DB::SerializationArray::deserializeText(DB::IColumn&, DB::ReadBuffer&, DB::FormatSettings const&) const @ 0x11cdcf58 in /usr/bin/clickhouse
2. bool DB::SerializationNullable::deserializeTextEscapedImpl<bool>(DB::IColumn&, DB::ReadBuffer&, DB::FormatSettings const&, std::__1::shared_ptr<DB::ISerialization const> const&) @ 0x11cf77c8 in /usr/bin/clickhouse
3. DB::TabSeparatedRowInputFormat::readRow(std::__1::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::__1::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn> > >&, DB::RowReadExtension&) @ 0x132564a2 in /usr/bin/clickhouse
4. DB::IRowInputFormat::generate() @ 0x1317b328 in /usr/bin/clickhouse
5. DB::ISource::tryGenerate() @ 0x131156b5 in /usr/bin/clickhouse
6. DB::ISource::work() @ 0x1311527a in /usr/bin/clickhouse
7. DB::ParallelParsingInputFormat::InternalParser::getChunk() @ 0x131dc84c in /usr/bin/clickhouse
8. DB::ParallelParsingInputFormat::parserThreadFunction(std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) @ 0x131dbe0b in /usr/bin/clickhouse
9. ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::__1::__list_iterator<ThreadFromGlobalPool, void*>) @ 0x9ba7d0a in /usr/bin/clickhouse
10. ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&, void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()&&...)::'lambda'()::operator()() @ 0x9ba9b27 in /usr/bin/clickhouse
11. ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) @ 0x9ba5117 in /usr/bin/clickhouse
12. ? @ 0x9ba8b1d in /usr/bin/clickhouse
13. start_thread @ 0x9609 in /lib/x86_64-linux-gnu/libpthread-2.31.so
14. /build/glibc-eX1tMB/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97: __clone @ 0x122293 in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so
(version 21.11.3.6 (official build))
Code: 130. DB::Exception: Array does not start with '[' character: (at row 1)
это не TSV у вас на картинке, по крайней мере там " лишние select ['aaaa', 'bbbb'] format TSV ['aaaa','bbbb']
получилось, спасибо 🙂
Обсуждают сегодня