Package com.clickhouse.client.api.query
Class QuerySettings
java.lang.Object
com.clickhouse.client.api.query.QuerySettings
- Direct Known Subclasses:
CommandSettings
Query settings class represents a set of settings that can be used to customize query execution.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet raw settings.Gets DB roles for an operation.Gets a configuration option.httpHeader(String key, String value) Defines list of headers that should be sent with current request.httpHeader(String key, Collection<String> values) but for multiple values.httpHeaders(Map<String, String> headers) but for multiple headers.logComment(String logComment) Sets the comment that will be added to the query log record associated with the query.static QuerySettingsmerge(QuerySettings source, QuerySettings override) serverSetting(String name, String value) Defines list of server settings that should be sent with each request.serverSetting(String name, Collection<String> values) but for multiple values.setDatabase(String database) Sets database to be used for a request.setDBRoles(Collection<String> dbRoles) Sets DB roles for an operation.setFormat(ClickHouseFormat format) Sets output format for a server response.setMaxExecutionTime(Integer maxExecutionTime) Maximum query execution time in seconds on server.Sets a configuration option.setQueryId(String queryId) Sets the query id.setReadBufferSize(Integer size) Read buffer is used for reading data from a server.setUseServerTimeZone(Boolean useServerTimeZone) setUseTimeZone(String timeZone) waitEndOfQuery(Boolean waitEndOfQuery) Requests the server to wait for the and of the query before sending response.
-
Field Details
-
MINIMAL_READ_BUFFER_SIZE
public static final int MINIMAL_READ_BUFFER_SIZE- See Also:
-
-
Constructor Details
-
QuerySettings
public QuerySettings()
-
-
Method Details
-
setOption
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 namevalue- - configuration option value
-
getOption
Gets a configuration option.- Parameters:
option- - configuration option name- Returns:
- configuration option value
-
getAllSettings
Get raw settings. Returns reference to internal map, so any changes will affect this object.- Returns:
- all settings map
-
setQueryId
Sets the query id. This id will be sent to the server and can be used to identify the query. -
getQueryId
-
setReadBufferSize
Read buffer is used for reading data from a server. Size is in bytes. Minimal value is 8192 bytes. -
getReadBufferSize
-
setFormat
Sets output format for a server response. -
getFormat
-
setMaxExecutionTime
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
-
setDatabase
Sets database to be used for a request. -
getDatabase
-
waitEndOfQuery
Requests the server to wait for the and of the query before sending response. Useful for getting accurate summary. -
setUseServerTimeZone
-
getUseServerTimeZone
-
setUseTimeZone
-
getServerTimeZone
-
httpHeader
Defines list of headers that should be sent with current request. The Client will use a header value defined inheadersinstead of any other.- Parameters:
key- - header name.value- - header value.- Returns:
- same instance of the builder
- See Also:
-
httpHeader
but for multiple values.- Parameters:
key- - name of the headervalues- - collection of values- Returns:
- same instance of the builder
-
httpHeaders
but for multiple headers.- Parameters:
headers- - map of headers- Returns:
- same instance of the builder
-
serverSetting
Defines list of server settings that should be sent with each request. The Client will use a setting value defined insettingsinstead of any other. Operation settings may override these values.- Parameters:
name- - name of the settingvalue- - value of the setting- Returns:
- same instance of the builder
- See Also:
-
serverSetting
but for multiple values.- Parameters:
name- - name of the setting without special prefixvalues- - collection of values- Returns:
- same instance of the builder
-
setDBRoles
Sets DB roles for an operation. Roles that were set byClient.setDBRoles(Collection)will be overridden.- Parameters:
dbRoles-
-
getDBRoles
Gets DB roles for an operation.- Returns:
- list of DB roles
-
logComment
Sets the comment that will be added to the query log record associated with the query.- Parameters:
logComment- - comment to be added to the log- Returns:
- same instance of the builder
-
getLogComment
-
merge
-