Skip to content

Exceptions with arrayJoin and FixedString #1063

@sidh

Description

@sidh

Execute the following:

  1. CREATE TABLE foo(event Date, bar Array(FixedString(16))) ENGINE = MergeTree(event, (event), 8192);
  2. INSERT INTO foo(event, bar) VALUES(now(), array(toFixedString('a', 16)))
  3. SELECT notEmpty(bar) ? arrayJoin(bar) : toFixedString('', 16) FROM foo

Execution of select results in server-side exception:
executeQuery: Code: 368, e.displayText() = DB::Exception: Bad cast from type N2DB12ColumnStringE to N2DB17ColumnFixedStringE, e.what() = DB::Exception (from 172.17.0.2:59670) (in query: SELECT notEmpty(bar) ? arrayJoin(bar) : toFixedString('', 16) FROM foo), Stack trace:

  1. /usr/bin/clickhouse-server(StackTrace::StackTrace()+0x16) [0x29b2626]
  2. /usr/bin/clickhouse-server(DB::Exception::Exception(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)+0x1f) [0x10b079f]
  3. /usr/bin/clickhouse-server(std::enable_if<std::is_referenceDB::ColumnFixedString&::value, DB::ColumnFixedString&>::type typeid_cast<DB::ColumnFixedString&, DB::IColumn>(DB::IColumn&)+0xef) [0x1bab39f]
  4. /usr/bin/clickhouse-server(DB::DataTypeFixedString::serializeBinaryBulk(DB::IColumn const&, DB::WriteBuffer&, unsigned long, unsigned long) const+0x25) [0x237f355]
  5. /usr/bin/clickhouse-server(DB::NativeBlockOutputStream::writeData(DB::IDataType const&, std::shared_ptrDB::IColumn const&, DB::WriteBuffer&, unsigned long, unsigned long)+0x2d4) [0x23549c4]
  6. /usr/bin/clickhouse-server(DB::NativeBlockOutputStream::write(DB::Block const&)+0xd60) [0x2355950]
  7. /usr/bin/clickhouse-server(DB::TCPHandler::sendData(DB::Block&)+0x52) [0x10c83c2]
  8. /usr/bin/clickhouse-server(DB::TCPHandler::processOrdinaryQuery()+0x46f) [0x10c885f]
  9. /usr/bin/clickhouse-server(DB::TCPHandler::runImpl()+0x7c5) [0x10ca505]
  10. /usr/bin/clickhouse-server(DB::TCPHandler::run()+0x2b) [0x10caf6b]
  11. /usr/bin/clickhouse-server(Poco::Net::TCPServerConnection::start()+0xf) [0x32b47af]
  12. /usr/bin/clickhouse-server(Poco::Net::TCPServerDispatcher::run()+0x13b) [0x32babeb]
  13. /usr/bin/clickhouse-server(Poco::PooledThread::run()+0xb7) [0x3525be7]
  14. /usr/bin/clickhouse-server(Poco::ThreadImpl::runnableEntry(void*)+0xa5) [0x34f1c25]
  15. /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f1c47bf96ba]
  16. /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f1c4721a3dd]

and in client-side exception:
Exception on client:
Code: 89. DB::Exception: Unknown compression method: 105: while receiving packet from clickhouse-server:9000, 172.17.0.3

If you format output as JSON, it produces fields description correctly but fails on data in the same way.

Version of both client and server is 1.1.54245

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions