Skip to content

How to use ClientV2 and ExternalTable #2397

Description

@den-crane

I need an example how to use ClientV2 and ExternalTable

For example I have a simple query select * from numbers(10) where number in ExternalTable;

        final Client client = new Client.Builder().setUsername("default").setPassword("").addEndpoint("http://localhost:8123/")
                .build();

        final String sql = "select * from numbers(10) where number in ExternalTable";
        QueryResponse response = client.query(sql).get(3, TimeUnit.SECONDS);
        ClickHouseBinaryFormatReader reader = client.newBinaryFormatReader(response);
        while (reader.hasNext()) {
            reader.next();
            System.out.println(reader.getLong("number"));
        }

And I need to pass 1\n\2\n3 as ExternalTable.

Like here

Or here #891

https://clickhouse.com/docs/engines/table-engines/special/external-data

I need it because I want to pass a list with 200k values and a query size (SQL length) without using the external data is bigger than 1Mb.

Activity

  1. self-assigned this
    on Jun 5, 2025
  2. chernser commented on Jun 5, 2025

    @chernser
    Contributor

    @den-crane
    This is not supported in v2 currently. Will look into it short this week.

  3. added this to the 0.10.0 milestone on Apr 15, 2026
  4. olegbonar commented on May 26, 2026

    @olegbonar

    Hello, is this implemented in v2 currently?

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions