-
Notifications
You must be signed in to change notification settings - Fork 614
Closed
Description
Describe your feedback
I found that I couldn't write to Clickhouse use v2-client with RowBinary:
Log in client:
Code: 32. DB::Exception: Attempt to read after eof: While executing BinaryRowInputFormat. (ATTEMPT_TO_READ_AFTER_EOF) (version 24.8.7.41 (official build))
Log in server:
2025.04.15 10:01:13.957589 [ 66 ] {b0b5fe64-fdf8-45af-b8af-528c03a196a6} <Debug> executeQuery: (from 192.168.215.1:29879, user: root) INSERT INTO astra_abbeabcd.t1 FORMAT RowBinary (stage: Complete)
2025.04.15 10:01:13.957985 [ 66 ] {b0b5fe64-fdf8-45af-b8af-528c03a196a6} <Error> executeQuery: Code: 32. DB::Exception: Attempt to read after eof: While executing BinaryRowInputFormat. (ATTEMPT_TO_READ_AFTER_EOF) (version 24.8.7.41 (official build)) (from 192.168.215.1:29879) (in query: INSERT INTO astra_abbeabcd.t1 FORMAT RowBinary ), Stack trace (when copying this message, always include the lines below):
0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000bc535e4
1. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000759765c
2. DB::Exception::Exception<>(int, FormatStringHelperImpl<>) @ 0x00000000075adcf4
3. DB::throwReadAfterEOF() @ 0x000000000bcc9474
4. DB::SerializationString::deserializeBinary(DB::IColumn&, DB::ReadBuffer&, DB::FormatSettings const&) const @ 0x000000000ec356a4
5. DB::BinaryFormatReader<false>::readField(DB::IColumn&, std::shared_ptr<DB::IDataType const> const&, std::shared_ptr<DB::ISerialization const> const&, bool, String const&) @ 0x00000000106986a4
6. DB::RowInputFormatWithNamesAndTypes::readRow(std::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn>>>&, DB::RowReadExtension&) @ 0x000000001069cea0
7. DB::IRowInputFormat::read() @ 0x0000000010680cf0
8. DB::IInputFormat::generate() @ 0x000000001062e620
9. DB::ISource::tryGenerate() @ 0x000000001061184c
10. DB::ISource::work() @ 0x0000000010611534
11. DB::ExecutionThreadContext::executeTask() @ 0x0000000010625d70
12. DB::PipelineExecutor::executeStepImpl(unsigned long, std::atomic<bool>*) @ 0x000000001061c5b0
13. DB::PipelineExecutor::execute(unsigned long, bool) @ 0x000000001061bc88
14. DB::CompletedPipelineExecutor::execute() @ 0x000000001061a76c
15. DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::shared_ptr<DB::Context>, std::function<void (DB::QueryResultDetails const&)>, DB::QueryFlags, std::optional<DB::FormatSettings> const&, std::function<void (DB::IOutputFormat&, String const&, std::shared_ptr<DB::Context const> const&, std::optional<DB::FormatSettings> const&)>) @ 0x000000000f695830
16. DB::HTTPHandler::processQuery(DB::HTTPServerRequest&, DB::HTMLForm&, DB::HTTPServerResponse&, DB::HTTPHandler::Output&, std::optional<DB::CurrentThread::QueryScope>&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x000000001053d714
17. DB::HTTPHandler::handleRequest(DB::HTTPServerRequest&, DB::HTTPServerResponse&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x00000000105409f4
18. DB::HTTPServerConnection::run() @ 0x00000000105c78b4
19. Poco::Net::TCPServerConnection::start() @ 0x0000000012d390d8
20. Poco::Net::TCPServerDispatcher::run() @ 0x0000000012d395b4
21. Poco::PooledThread::run() @ 0x0000000012d045f4
22. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000012d02a30
23. start_thread @ 0x0000000000007624
24. ? @ 0x00000000000d162c
2025.04.15 10:01:13.958068 [ 66 ] {b0b5fe64-fdf8-45af-b8af-528c03a196a6} <Error> DynamicQueryHandler: Code: 32. DB::Exception: Attempt to read after eof: While executing BinaryRowInputFormat. (ATTEMPT_TO_READ_AFTER_EOF), Stack trace (when copying this message, always include the lines below):
0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000bc535e4
1. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000759765c
2. DB::Exception::Exception<>(int, FormatStringHelperImpl<>) @ 0x00000000075adcf4
3. DB::throwReadAfterEOF() @ 0x000000000bcc9474
4. DB::SerializationString::deserializeBinary(DB::IColumn&, DB::ReadBuffer&, DB::FormatSettings const&) const @ 0x000000000ec356a4
5. DB::BinaryFormatReader<false>::readField(DB::IColumn&, std::shared_ptr<DB::IDataType const> const&, std::shared_ptr<DB::ISerialization const> const&, bool, String const&) @ 0x00000000106986a4
6. DB::RowInputFormatWithNamesAndTypes::readRow(std::vector<COW<DB::IColumn>::mutable_ptr<DB::IColumn>, std::allocator<COW<DB::IColumn>::mutable_ptr<DB::IColumn>>>&, DB::RowReadExtension&) @ 0x000000001069cea0
7. DB::IRowInputFormat::read() @ 0x0000000010680cf0
8. DB::IInputFormat::generate() @ 0x000000001062e620
9. DB::ISource::tryGenerate() @ 0x000000001061184c
10. DB::ISource::work() @ 0x0000000010611534
11. DB::ExecutionThreadContext::executeTask() @ 0x0000000010625d70
12. DB::PipelineExecutor::executeStepImpl(unsigned long, std::atomic<bool>*) @ 0x000000001061c5b0
13. DB::PipelineExecutor::execute(unsigned long, bool) @ 0x000000001061bc88
14. DB::CompletedPipelineExecutor::execute() @ 0x000000001061a76c
15. DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::shared_ptr<DB::Context>, std::function<void (DB::QueryResultDetails const&)>, DB::QueryFlags, std::optional<DB::FormatSettings> const&, std::function<void (DB::IOutputFormat&, String const&, std::shared_ptr<DB::Context const> const&, std::optional<DB::FormatSettings> const&)>) @ 0x000000000f695830
16. DB::HTTPHandler::processQuery(DB::HTTPServerRequest&, DB::HTMLForm&, DB::HTTPServerResponse&, DB::HTTPHandler::Output&, std::optional<DB::CurrentThread::QueryScope>&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x000000001053d714
17. DB::HTTPHandler::handleRequest(DB::HTTPServerRequest&, DB::HTTPServerResponse&, StrongTypedef<unsigned long, ProfileEvents::EventTag> const&) @ 0x00000000105409f4
18. DB::HTTPServerConnection::run() @ 0x00000000105c78b4
19. Poco::Net::TCPServerConnection::start() @ 0x0000000012d390d8
20. Poco::Net::TCPServerDispatcher::run() @ 0x0000000012d395b4
21. Poco::PooledThread::run() @ 0x0000000012d045f4
22. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000012d02a30
23. start_thread @ 0x0000000000007624
24. ? @ 0x00000000000d162c
(version 24.8.7.41 (official build))
My clickhouse is booted via docker and I don't know if that has any effect. But I can read the data in it via v2-client. It is also possible to write through v1-client.
Code example
final TableSchema tableSchema = clientAgent.getTableSchema("astra_abbeabcd", "t1");
clientAgent.insert("astra_abbeabcd" + ".t1", new DataStreamWriter() {
@Override
public void onOutput(final OutputStream out) throws IOException {
final RowBinaryFormatWriter rowBinaryFormatWriter = new RowBinaryFormatWriter(out, tableSchema, ClickHouseFormat.RowBinary);
rowBinaryFormatWriter.setInteger(1, 1);
rowBinaryFormatWriter.setString(2, "zs");
rowBinaryFormatWriter.commitRow();
}
});DDL:
create table astra_abbeabcd.t1 (
id int,
name String
)
engine = MergeTree
order by id;