Skip to content

Conversation

@larron
Copy link

@larron larron commented Oct 3, 2025

This addresses issue #114.
This may also not be the way that the team wishes to move forward so I will do my best to explain what I think is going on and hopefully you guys can take it from here.

When running a clickhouse sink using an HTTP connection, the go driver will not be able to determine ColumnTypes() and simply responds with an empty set of data... hence the bug I created yesterday.

Ok, so why not just use a TCP connection and call it a day?
That doesn't work either because the query that fetches the tables IE: information_schema only works over HTTP and will also crash out.

There is one more caveat... with a localhost connection we currently switch to using HTTP by default in which compounds the issue.

This PR removes the localhost hack and patches the fetching of tables for clickhouse in as surgical of a manner as possible.

Having said that... this means that the only way moving forward to run a clickhouse sink will be with a TCP connection and perhaps some additional documentations and or warnings should be added in the case this is merged.

@maoueh
Copy link
Contributor

maoueh commented Oct 8, 2025

I've added recently integration test that makes real Clickhouse interaction, so it should be possible to replicate something there.

That doesn't work either because the query that fetches the tables IE: information_schema only works over HTTP and will also crash out.

So here, if I understand properly, information_schema does not work currently over anything? Or does it work over some of the transport accepted by Clickhouse?

@larron
Copy link
Author

larron commented Oct 8, 2025

information_schema seemed to work over HTTP, will fail with a TCP connection.
If you use an HTTP connection you will bypass the information_schema issue and then the ColumnTypes() will fail because those only work over TCP.

@maoueh
Copy link
Contributor

maoueh commented Oct 8, 2025

Ok thanks for the info, so to support both, we would need to know when it's TCP/HTTP and do something differently based on this information.

That's a bummer.

We have though on switching to use Clickhouse native driver directly, wondering if this would help here.

@larron
Copy link
Author

larron commented Oct 8, 2025

Exactly. Currently they are contradictory. I ran the build on this PR for a few days on a TCP connection and it seems fine.
Personally I think forcing TCP for now is probably the route I'd take it.

@maoueh
Copy link
Contributor

maoueh commented Nov 7, 2025

develop branch now contains code to reject Clickhouse HTTP driver, if you are able to test it, would be appreciated.

Aiming for a release next week or the week after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants