Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[client-v2] Allow QuerySettings in POJO queryAll overloads

Aperta
#3,112 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
clickhouse, java
Ambito
api

Direzione di ricerca

Individua gli overload queryAll sperimentali di POJO di client-v2 e l’overload queryAll esistente di GenericRecord che accetta QuerySettings. Leggi prima questi entry point, quindi esamina i test queryAll circostanti. Il lavoro è completato quando entrambi gli overload POJO proposti accettano impostazioni copiate continuando a imporre RowBinaryWithNamesAndTypes, con copertura delle impostazioni supportate e del comportamento di deserializzazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi! This is my first issue in this repository, so apologies if I did not formulate the idea perfectly.

I'm also not completely sure whether this API change is technically appropriate or possible. There may be a reason why QuerySettings cannot or should not be passed to the POJO queryAll overloads. If so, I would be happy to understand the reasoning.

Description

The experimental POJO queryAll API currently does not provide an overload that accepts QuerySettings.

Current overloads:

queryAll(String sqlQuery, Class<T> clazz, TableSchema schema)

queryAll(
    String sqlQuery,
    Class<T> clazz,
    TableSchema schema,
    Supplier<T> allocator
)

Internally, the method creates its own QuerySettings:

QuerySettings settings =
    new QuerySettings()
        .setFormat(ClickHouseFormat.RowBinaryWithNamesAndTypes);

Because of that, callers cannot provide query/server settings such as:

  • limit
  • page
  • max_execution_time
  • query id
  • database
  • other operation-level server settings

At the same time, queryAll for GenericRecord already accepts QuerySettings and copies the supplied settings while forcing the response format to RowBinaryWithNamesAndTypes.

It would be useful if the POJO overloads supported the same behavior.

Proposed API

For example:


public <T> List<T> queryAll(
    String sqlQuery,
    Class<T> clazz,
    TableSchema schema,
    QuerySettings settings
)

public <T> List<T> queryAll(
    String sqlQuery,
    Class<T> clazz,
    TableSchema schema,
    QuerySettings settings,
    Supplier<T> allocator
)

The response format should still be controlled internally by queryAll, since POJO deserialization depends on RowBinaryWithNamesAndTypes.

In other words, the provided settings could be copied and then:

requestSettings.setFormat(
    ClickHouseFormat.RowBinaryWithNamesAndTypes
);

This would keep POJO deserialization safe while allowing callers to use settings such as pagination, execution limits, query id, database, etc.

Why

This would make the POJO queryAll API consistent with the existing GenericRecord queryAll API and would avoid forcing callers to reimplement the POJO deserialization path only to pass custom QuerySettings.

Lingua principale
Java
Stelle
1.6k
Fork
638
Merge medio
2g 46m
PR unite (30g)
46

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ClickHouse/clickhouse-java

Tutte le issue di ClickHouse/clickhouse-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.