Class QuerySettings

java.lang.Object
com.clickhouse.client.api.query.QuerySettings
Direct Known Subclasses:
CommandSettings

public class QuerySettings extends Object

Query settings class represents a set of settings that can be used to customize query execution.

  • Field Details

    • MINIMAL_READ_BUFFER_SIZE

      public static final int MINIMAL_READ_BUFFER_SIZE
      See Also:
  • Constructor Details

    • QuerySettings

      public QuerySettings()
  • Method Details

    • setOption

      public QuerySettings setOption(String option, Object value)
      Sets a configuration option. This method can be used to set any configuration option. There is no specific validation is done on the key or value.
      Parameters:
      option - - configuration option name
      value - - configuration option value
    • getOption

      public Object getOption(String option)
      Gets a configuration option.
      Parameters:
      option - - configuration option name
      Returns:
      configuration option value
    • getAllSettings

      public Map<String,Object> getAllSettings()
      Get raw settings. Returns reference to internal map, so any changes will affect this object.
      Returns:
      all settings map
    • setQueryId

      public QuerySettings setQueryId(String queryId)
      Sets the query id. This id will be sent to the server and can be used to identify the query.
    • getQueryId

      public String getQueryId()
    • setReadBufferSize

      public QuerySettings setReadBufferSize(Integer size)
      Read buffer is used for reading data from a server. Size is in bytes. Minimal value is 8192 bytes.
    • getReadBufferSize

      public Integer getReadBufferSize()
    • setFormat

      public QuerySettings setFormat(com.clickhouse.data.ClickHouseFormat format)
      Sets output format for a server response.
    • getFormat

      public com.clickhouse.data.ClickHouseFormat getFormat()
    • setMaxExecutionTime

      public QuerySettings setMaxExecutionTime(Integer maxExecutionTime)
      Maximum query execution time in seconds on server. 0 means no limit. If query is not finished in this time then server will send an exception.
    • getMaxExecutionTime

      public Integer getMaxExecutionTime()
    • setDatabase

      public QuerySettings setDatabase(String database)
      Sets database to be used for a request.
    • getDatabase

      public String getDatabase()
    • waitEndOfQuery

      public QuerySettings waitEndOfQuery(Boolean waitEndOfQuery)
      Requests the server to wait for the and of the query before sending response. Useful for getting accurate summary.
    • setUseServerTimeZone

      public QuerySettings setUseServerTimeZone(Boolean useServerTimeZone)
    • getUseServerTimeZone

      public Boolean getUseServerTimeZone()
    • setUseTimeZone

      public QuerySettings setUseTimeZone(String timeZone)
    • getServerTimeZone

      public TimeZone getServerTimeZone()