Package com.clickhouse.client
Class ClickHouseRequest<SelfT extends ClickHouseRequest<SelfT>>
java.lang.Object
com.clickhouse.client.ClickHouseRequest<SelfT>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClickHouseRequest.Mutation
@Deprecated
public class ClickHouseRequest<SelfT extends ClickHouseRequest<SelfT>>
extends Object
implements Serializable
Deprecated.
Request object holding references to
ClickHouseClient,
ClickHouseNode, format, sql, options and settings etc. for execution.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.Mutation request. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClickHouseConfigChangeListener<ClickHouseRequest<?>>Deprecated.protected ClickHouseConfigDeprecated.protected final List<ClickHouseExternalTable>Deprecated.protected ClickHouseDeferredValue<ClickHouseInputStream>Deprecated.protected final AtomicReference<ClickHouseRequestManager>Deprecated.Deprecated.protected final ClickHouseFreezableMap<ClickHouseOption,Serializable> Deprecated.protected ClickHouseDeferredValue<ClickHouseOutputStream>Deprecated.protected ClickHouseParameterizedQueryDeprecated.protected StringDeprecated.protected final Function<ClickHouseNodeSelector,ClickHouseNode> Deprecated.protected BiConsumer<ClickHouseNode,ClickHouseNode> Deprecated.protected final AtomicReference<ClickHouseNode>Deprecated.protected final ClickHouseFreezableMap<String,Serializable> Deprecated.protected StringDeprecated.Deprecated.protected final AtomicReference<ClickHouseTransaction>Deprecated.protected ClickHouseWriterDeprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClickHouseRequest(ClickHouseClient client, Function<ClickHouseNodeSelector, ClickHouseNode> server, AtomicReference<ClickHouseNode> ref, Map<ClickHouseOption, Serializable> options, boolean sealed) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Adds an external table.protected <T> TchangeProperty(String property, T oldValue, T newValue) Deprecated.protected ClickHouseNodechangeServer(ClickHouseNode currentServer, ClickHouseNode newServer) Deprecated.protected voidDeprecated.Deprecated.Clears session configuration including session id, session check(whether to validate the id), and session timeout.Deprecated.Clears server settings.compressServerResponse(boolean enable) Deprecated.Enable or disable compression of server response.compressServerResponse(boolean enable, ClickHouseCompression compressAlgorithm) Deprecated.Enable or disable compression of server response.compressServerResponse(boolean enable, ClickHouseCompression compressAlgorithm, int compressLevel) Deprecated.Enable or disable compression of server response.compressServerResponse(ClickHouseCompression compressAlgorithm) Deprecated.Enable or disable compression of server response.copy()Deprecated.Creates a copy of this request including listeners.decompressClientRequest(boolean enable) Deprecated.Enable or disable compression of client request.decompressClientRequest(boolean enable, ClickHouseCompression compressAlgorithm) Deprecated.Enable or disable compression of client request.decompressClientRequest(boolean enable, ClickHouseCompression compressAlgorithm, int compressLevel) Deprecated.Enable or disable compression of client request.decompressClientRequest(ClickHouseCompression compressAlgorithm) Deprecated.Enable or disable compression of client request.execute()Deprecated.Executes the request.Deprecated.Synchronous version ofexecute().Deprecated.Executes the request within an implicit transaction.executeWithinTransaction(boolean useImplicitTransaction) Deprecated.will be removed in the future, once the minimum supported version of ClickHouse is 22.7 or aboveexternal(ClickHouseExternalTable table, ClickHouseExternalTable... more) Deprecated.Sets one or more external tables.external(Collection<ClickHouseExternalTable> tables) Deprecated.Sets external tables.format(ClickHouseFormat format) Deprecated.Sets format to be used for communication between server and client.Deprecated.Freezes options to discard future changes.Deprecated.Freezes settings to discard future changes.Deprecated.protected ClickHouseClientDeprecated.Gets client associated with the request.Deprecated.Gets request configuration.Deprecated.Gets immutable list of external tables.Deprecated.Gets data format used for communication between server and client.Deprecated.Gets input stream.Deprecated.Gets manager for the request, which defaults toClickHouseRequestManager.getInstance().Deprecated.Gets output stream.Deprecated.Gets prepared query, which is a loosely parsed query with the origianl query and list of parameters.protected StringgetQuery()Deprecated.Gets query, either set byquery()ortable().Deprecated.Gets query id.final ClickHouseNodeDeprecated.Gets the server currently connected to.Deprecated.Deprecated.Gets session id.<T extends Serializable>
TgetSetting(String setting, Class<T> valueType) Deprecated.Gets typed setting value.<T extends Serializable>
TgetSetting(String setting, T defaultValue) Deprecated.Gets typed setting value.Deprecated.Gets immutable settings.Deprecated.Gets list of SQL statements.getStatements(boolean withSettings) Deprecated.Gets list of SQL statements.Deprecated.Deprecated.Gets custom writer for writing raw request.booleanDeprecated.Checks if the request contains any input stream or custom writer.booleanhasOption(ClickHouseOption option) Deprecated.Checks if a option has been defined or not.booleanDeprecated.Checks if a option has been defined or not.booleanDeprecated.Checks if the response should be redirected to an output stream, which was defined by one ofoutput(*)methods.booleanhasSetting(String setting) Deprecated.Checks if a setting has been defined or not.booleanisSealed()Deprecated.Checks if the request is sealed(immutable).booleanDeprecated.Checks if the request is bounded with a transaction.manager(ClickHouseRequestManager manager) Deprecated.Sets request manager which is responsible for generating query ID and session ID, as well as transaction creation.option(ClickHouseOption option, Serializable value) Deprecated.Sets an option.options(Map<ClickHouseOption, Serializable> options) Deprecated.Sets all options.options(Properties options) Deprecated.Sets all options.Deprecated.Sets output stream, to which response will be redirected.output(ClickHouseOutputStream output) Deprecated.Sets output stream, to which response will be redirected.output(ClickHousePassThruStream stream) Deprecated.Sets pass-thru stream, to which response will be redirected.output(OutputStream output) Deprecated.Sets output stream, to which response will be redirected.Deprecated.Sets output file, to which response will be redirected.output(String file, ClickHouseCompression compression) Deprecated.Sets compressed output file, to which response will be redirected.output(String file, ClickHouseCompression compression, int compressionLevel) Deprecated.Sets compressed output file, to which response will be redirected.params(ClickHouseValue[] values) Deprecated.Sets parameters wrapped byClickHouseValue.params(ClickHouseValue value, ClickHouseValue... more) Deprecated.Sets parameters wrapped byClickHouseValue.Deprecated.Set raw parameters, which will later be stringified usingClickHouseValues.convertToSqlExpression(Object).Deprecated.Set raw parameters, which will later be stringified usingClickHouseValues.convertToSqlExpression(Object).Deprecated.Sets stringified parameters which are used to substitude named parameters in SQL query without further transformation and validation.Deprecated.Sets stringified parameters which are used to substitude named parameters in SQL query without further transformation and validation.params(Collection<String> values) Deprecated.Sets stringified parameters.Deprecated.Sets named parameters.Deprecated.Sets parameterized query.query(ClickHouseParameterizedQuery query, String queryId) Deprecated.Sets parameterized query and optionally query id.Deprecated.Sets query.Deprecated.Sets query and optionally query id.removeExternal(ClickHouseExternalTable external) Deprecated.Removes an external table.removeExternal(String name) Deprecated.Removes an external table by name.removeOption(ClickHouseOption option) Deprecated.Removes an option.removeSetting(String setting) Deprecated.Removes a setting.reset()Deprecated.Resets the request to start all over.protected voidDeprecated.seal()Deprecated.Creates a sealed request, which is an immutable copy of the current request.Deprecated.Sets current session using custom id.Deprecated.Sets session.Deprecated.Sets current session.Deprecated.Sets current session.set(String setting, Serializable value) Deprecated.Sets a setting.Deprecated.Sets a setting.final SelfTsetChangeListener(ClickHouseConfigChangeListener<ClickHouseRequest<?>> listener) Deprecated.Sets thread-safe change listener.final SelfTsetServerListener(BiConsumer<ClickHouseNode, ClickHouseNode> listener) Deprecated.Sets thread-safe server change listener.settings(Map<String, Serializable> settings) Deprecated.Sets all server settings.Deprecated.Sets target table.Deprecated.Sets target table and optionally query id.Deprecated.Creates and starts a transaction.transaction(int timeout) Deprecated.Creates and starts a transaction immediately.transaction(ClickHouseTransaction transaction) Deprecated.Sets transaction.Deprecated.Unfreezes options to accept future changes.Deprecated.Unfreezes settings to accept future changes.Deprecated.Changes current database.write()Deprecated.Creates a new request for mutation.
-
Field Details
-
managerRef
Deprecated. -
server
Deprecated. -
serverRef
Deprecated. -
txRef
Deprecated. -
externalTables
Deprecated. -
options
Deprecated. -
settings
Deprecated. -
namedParameters
Deprecated. -
writer
Deprecated. -
input
Deprecated. -
output
Deprecated. -
queryId
Deprecated. -
sql
Deprecated. -
preparedQuery
Deprecated. -
changeListener
Deprecated. -
serverListener
Deprecated. -
config
Deprecated. -
statements
Deprecated.
-
-
Constructor Details
-
ClickHouseRequest
protected ClickHouseRequest(ClickHouseClient client, Function<ClickHouseNodeSelector, ClickHouseNode> server, AtomicReference<ClickHouseNode> ref, Map<ClickHouseOption, Serializable> options, boolean sealed) Deprecated.
-
-
Method Details
-
changeProperty
Deprecated. -
changeServer
Deprecated. -
checkSealed
protected void checkSealed()Deprecated. -
getClient
Deprecated.Gets client associated with the request.- Returns:
- non-null client
-
getQuery
Deprecated.Gets query, either set byquery()ortable().- Returns:
- sql query
-
resetCache
protected void resetCache()Deprecated. -
copy
Deprecated.Creates a copy of this request including listeners. Please pay attention that the same node reference (returned fromgetServer()) will be copied to the new request as well, meaning failover will change node for both requests.- Returns:
- copy of this request
-
getManager
Deprecated.Gets manager for the request, which defaults toClickHouseRequestManager.getInstance().- Returns:
- non-null request manager
-
isSealed
public boolean isSealed()Deprecated.Checks if the request is sealed(immutable).- Returns:
- true if the request is sealed; false otherwise
-
isTransactional
public boolean isTransactional()Deprecated.Checks if the request is bounded with a transaction.- Returns:
- true if the request is bounded with a transaction; false otherwise
-
hasInputStream
public boolean hasInputStream()Deprecated.Checks if the request contains any input stream or custom writer.- Returns:
- true if there's input stream or customer writer; false otherwise
-
hasOutputStream
public boolean hasOutputStream()Deprecated.Checks if the response should be redirected to an output stream, which was defined by one ofoutput(*)methods.- Returns:
- true if response should be redirected to an output stream; false otherwise
-
getServer
Deprecated.Gets the server currently connected to. The initial value was determined by theFunctionpassed to constructor, and it may be changed over time when failover is enabled.- Returns:
- non-null node
-
getConfig
Deprecated.Gets request configuration.- Returns:
- request configuration
-
getTransaction
Deprecated. -
getChangeListener
Deprecated. -
getServerListener
Deprecated. -
getInputStream
Deprecated.Gets input stream.- Returns:
- input stream
-
getWriter
Deprecated.Gets custom writer for writing raw request.- Returns:
- custom writer
-
getOutputStream
Deprecated.Gets output stream.- Returns:
- output stream
-
getExternalTables
Deprecated.Gets immutable list of external tables.- Returns:
- immutable list of external tables
-
getFormat
Deprecated.Gets data format used for communication between server and client.- Returns:
- data format used for communication between server and client
-
getQueryId
Deprecated.Gets query id.- Returns:
- query id
-
getPreparedQuery
Deprecated.Gets prepared query, which is a loosely parsed query with the origianl query and list of parameters.- Returns:
- prepared query
-
freezeSettings
Deprecated.Freezes settings to discard future changes.- Returns:
- the request itself
-
unfreezeSettings
Deprecated.Unfreezes settings to accept future changes.- Returns:
- the request itself
-
getSetting
Deprecated.Gets typed setting value.- Type Parameters:
T- type of the setting value- Parameters:
setting- non-null setting keyvalueType- non-null value type- Returns:
- non-null value
-
getSetting
Deprecated.Gets typed setting value.- Type Parameters:
T- type of the setting value- Parameters:
setting- non-null setting keydefaultValue- non-null default value- Returns:
- non-null value
-
hasSetting
Deprecated.Checks if a setting has been defined or not.- Parameters:
setting- setting- Returns:
- true if the setting has been defined; false otherwise
-
getSettings
Deprecated.Gets immutable settings.- Returns:
- immutable settings
-
getSessionId
Deprecated.Gets session id.- Returns:
- session id
-
getStatements
Deprecated.Gets list of SQL statements. Same asgetStatements(true).- Returns:
- list of SQL statements
-
getStatements
Deprecated.Gets list of SQL statements.- Parameters:
withSettings- true to treat settings as SQL statement; false otherwise- Returns:
- list of SQL statements
-
compressServerResponse
Deprecated.Enable or disable compression of server response. Pay attention thatClickHouseClientOption.COMPRESS_ALGORITHMandClickHouseClientOption.COMPRESS_LEVELwill be used.- Parameters:
enable- true to enable compression of server response; false otherwise- Returns:
- the request itself
-
compressServerResponse
Deprecated.Enable or disable compression of server response. Pay attention thatClickHouseClientOption.COMPRESS_ALGORITHMandClickHouseClientOption.COMPRESS_LEVELwill be used.- Parameters:
compressAlgorithm- compression algorihtm, null orClickHouseCompression.NONEmeans no compression- Returns:
- the request itself
-
compressServerResponse
Deprecated.Enable or disable compression of server response. Pay attention thatClickHouseClientOption.COMPRESS_LEVELwill be used.- Parameters:
enable- true to enable compression of server response; false otherwisecompressAlgorithm- compression algorithm, null is treated asClickHouseCompression.NONEorClickHouseClientOption.COMPRESS_ALGORITHMdepending on whether enabled- Returns:
- the request itself
-
compressServerResponse
public SelfT compressServerResponse(boolean enable, ClickHouseCompression compressAlgorithm, int compressLevel) Deprecated.Enable or disable compression of server response.- Parameters:
enable- true to enable compression of server response; false otherwisecompressAlgorithm- compression algorithm, null is treated asClickHouseCompression.NONEorClickHouseClientOption.COMPRESS_ALGORITHMdepending on whether enabledcompressLevel- compression level- Returns:
- the request itself
-
decompressClientRequest
Deprecated.Enable or disable compression of client request. Pay attention thatClickHouseClientOption.DECOMPRESS_ALGORITHMandClickHouseClientOption.DECOMPRESS_LEVELwill be used.- Parameters:
enable- true to enable compression of client request; false otherwise- Returns:
- the request itself
-
decompressClientRequest
Deprecated.Enable or disable compression of client request. Pay attention thatClickHouseClientOption.DECOMPRESS_LEVELwill be used.- Parameters:
compressAlgorithm- compression algorithm, null is treated asClickHouseCompression.NONEorClickHouseClientOption.DECOMPRESS_ALGORITHMdepending on whether enabled- Returns:
- the request itself
-
decompressClientRequest
Deprecated.Enable or disable compression of client request. Pay attention thatClickHouseClientOption.DECOMPRESS_LEVELwill be used.- Parameters:
enable- true to enable compression of client request; false otherwisecompressAlgorithm- compression algorithm, null is treated asClickHouseCompression.NONEorClickHouseClientOption.DECOMPRESS_ALGORITHMdepending on whether enabled- Returns:
- the request itself
-
decompressClientRequest
public SelfT decompressClientRequest(boolean enable, ClickHouseCompression compressAlgorithm, int compressLevel) Deprecated.Enable or disable compression of client request.- Parameters:
enable- true to enable compression of client request; false otherwisecompressAlgorithm- compression algorithm, null is treated asClickHouseCompression.NONEcompressLevel- compression level- Returns:
- the request itself
-
addExternal
Deprecated.Adds an external table.- Parameters:
table- non-null external table- Returns:
- the request itself
-
external
Deprecated.Sets one or more external tables.- Parameters:
table- non-null external tablemore- more external tables- Returns:
- the request itself
-
external
Deprecated.Sets external tables.- Parameters:
tables- non-null external tables- Returns:
- the request itself
-
format
Deprecated.Sets format to be used for communication between server and client.- Parameters:
format- preferred format,nullmeans reset to default- Returns:
- the request itself
-
manager
Deprecated.Sets request manager which is responsible for generating query ID and session ID, as well as transaction creation.- Parameters:
manager- request manager- Returns:
- the request itself
-
freezeOptions
Deprecated.Freezes options to discard future changes.- Returns:
- the request itself
-
unfreezeOptions
Deprecated.Unfreezes options to accept future changes.- Returns:
- the request itself
-
option
Deprecated.Sets an option.optionis for configuring client's behaviour, whilesettingis for server.- Parameters:
option- optionvalue- value- Returns:
- the request itself
-
options
Deprecated.Sets all options.optionis for configuring client's behaviour, whilesettingis for server.- Parameters:
options- options- Returns:
- the request itself
-
options
Deprecated.Sets all options.optionis for configuring client's behaviour, whilesettingis for server.- Parameters:
options- options- Returns:
- the request itself
-
hasOption
Deprecated.Checks if a option has been defined or not.- Parameters:
option- option- Returns:
- true if the option has been defined; false otherwise
-
hasOption
Deprecated.Checks if a option has been defined or not.- Parameters:
key- key of the option- Returns:
- true if the option has been defined; false otherwise
-
output
Deprecated.Sets pass-thru stream, to which response will be redirected.- Parameters:
stream- non-null pass-thru stream- Returns:
- the request itself
-
output
Deprecated.Sets output file, to which response will be redirected.- Parameters:
file- non-empty path to the file- Returns:
- the request itself
-
output
Deprecated.Sets compressed output file, to which response will be redirected.- Parameters:
file- non-empty path to the filecompression- compression algorithm,nullorClickHouseCompression.NONEmeans no compression- Returns:
- the request itself
-
output
Deprecated.Sets compressed output file, to which response will be redirected.- Parameters:
file- non-empty path to the filecompression- compression algorithm,nullorClickHouseCompression.NONEmeans no compressioncompressionLevel- compression level- Returns:
- the request itself
-
output
Deprecated.Sets output stream, to which response will be redirected.- Parameters:
output- non-null output stream- Returns:
- the request itself
-
output
Deprecated.Sets output stream, to which response will be redirected.- Parameters:
output- non-null output stream- Returns:
- the request itself
-
output
Deprecated.Sets output stream, to which response will be redirected.- Parameters:
output- non-null output stream- Returns:
- the request itself
-
params
Deprecated.Sets stringified parameters. Be aware of SQL injection risk as mentioned inparams(String, String...).- Parameters:
values- stringified parameters- Returns:
- the request itself
-
params
Deprecated.Sets parameters wrapped byClickHouseValue. Safer but a bit slower thanparams(String, String...). Consider to reuse ClickHouseValue object and its update methods for less overhead in batch processing.- Parameters:
value- parametermore- more parameters- Returns:
- the request itself
-
params
Deprecated.Sets parameters wrapped byClickHouseValue. Safer but a bit slower thanparams(String, String...). Consider to reuse ClickHouseValue object and its update methods for less overhead in batch processing.- Parameters:
values- parameters- Returns:
- the request itself
-
params
Deprecated.Sets stringified parameters which are used to substitude named parameters in SQL query without further transformation and validation. Keep in mind that stringified parameter is a SQL expression, meaning it could be a sub-query(SQL injection) in addition to value like number and string.- Parameters:
value- stringified parametermore- more stringified parameters- Returns:
- the request itself
-
params
Deprecated.Sets stringified parameters which are used to substitude named parameters in SQL query without further transformation and validation. Keep in mind that stringified parameter is a SQL expression, meaning it could be a sub-query(SQL injection) in addition to value like number and string.- Parameters:
values- stringified parameters- Returns:
- the request itself
-
params
Deprecated.Set raw parameters, which will later be stringified usingClickHouseValues.convertToSqlExpression(Object). Although it is convenient to use, it's NOT recommended in most cases except for a few parameters and/or testing.- Parameters:
value- raw parametermore- more raw parameters- Returns:
- the request itself
-
params
Deprecated.Set raw parameters, which will later be stringified usingClickHouseValues.convertToSqlExpression(Object). Although it is convenient to use, it's NOT recommended in most cases except for a few parameters and/or testing.- Parameters:
values- raw parameters- Returns:
- the request itself
-
params
Deprecated.Sets named parameters. Be aware of SQL injection risk as mentioned inparams(String, String...).- Parameters:
namedParams- named parameters- Returns:
- the request itself
-
query
Deprecated.Sets parameterized query. Same asquery(query, null).- Parameters:
query- non-null parameterized query- Returns:
- the request itself
-
query
Deprecated.Sets query. Same asquery(sql, null).- Parameters:
sql- non-empty query- Returns:
- the request itself
-
query
Deprecated.Sets parameterized query and optionally query id.- Parameters:
query- non-null parameterized queryqueryId- query id, null means no query id- Returns:
- the request itself
-
query
Deprecated.Sets query and optionally query id.- Parameters:
query- non-empty queryqueryId- query id, null means no query id- Returns:
- the request itself
-
settings
Deprecated.Sets all server settings. Whensettingsis null or empty, it's same asclearSettings().- Parameters:
settings- settings- Returns:
- the request itself
-
clearSettings
Deprecated.Clears server settings.- Returns:
- the request itself
-
clearSession
Deprecated.Clears session configuration including session id, session check(whether to validate the id), and session timeout. Transaction will be removed as well.- Returns:
- the request itself
-
session
Deprecated.Sets current session using custom id. Same assession(sessionId, null, null).- Parameters:
sessionId- session id, null means no session- Returns:
- the request itself
-
session
Deprecated.Sets session. Same assession(sessionId, check, null).- Parameters:
sessionId- session id, null means no sessioncheck- whether the server should check if the session id exists or not- Returns:
- the request itself
-
session
Deprecated.Sets current session. Same assession(sessionId, null, timeout).- Parameters:
sessionId- session id, null means no sessiontimeout- timeout in seconds- Returns:
- the request itself
-
session
Deprecated.Sets current session.- Parameters:
sessionId- session id, null means no sessioncheck- whether the server should check if the session id exists or nottimeout- timeout in seconds- Returns:
- the request itself
-
set
Deprecated.Sets a setting. See https://clickhouse.tech/docs/en/operations/settings/settings/ for more information.- Parameters:
setting- non-empty setting to setvalue- value of the setting- Returns:
- the request itself
-
set
Deprecated.Sets a setting. See https://clickhouse.tech/docs/en/operations/settings/settings/ for more information.- Parameters:
setting- non-empty setting to setvalue- value of the setting- Returns:
- the request itself
-
setChangeListener
Deprecated.Sets thread-safe change listener. Please keep in mind that the same listener might be shared by multiple requests.- Parameters:
listener- thread-safe change listener which may or may not be null- Returns:
- the request itself
-
setServerListener
Deprecated.Sets thread-safe server change listener. Please keep in mind that the same listener might be shared by multiple requests.- Parameters:
listener- thread-safe server listener which may or may not be null- Returns:
- the request itself
-
table
Deprecated.Sets target table. Same astable(table, null).- Parameters:
table- non-empty table name- Returns:
- the request itself
-
table
Deprecated.Sets target table and optionally query id. This will generate a query likeSELECT * FROM [table]and override the one set byquery(String, String).- Parameters:
table- non-empty table namequeryId- query id, null means no query id- Returns:
- the request itself
-
transaction
Deprecated.Creates and starts a transaction. Same astransaction(0).- Returns:
- the request itself
- Throws:
ClickHouseException- when failed to start or reuse transaction
-
transaction
Deprecated.Creates and starts a transaction immediately. Please pay attention that unlike other methods in this class, it will connect to ClickHouse server, allocate session and start transaction right away.- Parameters:
timeout- transaction timeout in seconds, zero or negative means same as session timeout- Returns:
- the request itself
- Throws:
ClickHouseException- when failed to start or reuse transaction
-
transaction
Deprecated.Sets transaction. Any existing transaction, regardless its state, will be replaced by the given one.- Parameters:
transaction- transaction- Returns:
- the request itself
- Throws:
ClickHouseException- when failed to set transaction
-
use
Deprecated.Changes current database.- Parameters:
database- database name,nullmeans reset to default- Returns:
- the request itself
-
removeExternal
Deprecated.Removes an external table.- Parameters:
external- non-null external table- Returns:
- the request itself
-
removeExternal
Deprecated.Removes an external table by name.- Parameters:
name- non-empty external table name- Returns:
- the request itself
-
removeOption
Deprecated.Removes an option.- Parameters:
option- option to be removed- Returns:
- the request itself
-
removeSetting
Deprecated.Removes a setting.- Parameters:
setting- name of the setting- Returns:
- the request itself
-
reset
Deprecated.Resets the request to start all over.- Returns:
- the request itself
-
seal
Deprecated.Creates a sealed request, which is an immutable copy of the current request. Listeners won't be copied to the sealed instance, because it's immutable.- Returns:
- sealed request, an immutable copy of the current request
-
write
Deprecated.Creates a new request for mutation.- Returns:
- request for mutation
-
execute
Deprecated.Executes the request. Same asclient.execute(request.seal()).- Returns:
- non-null future to get response
- Throws:
CompletionException- when error occurred during execution
-
executeAndWait
Deprecated.Synchronous version ofexecute().- Returns:
- non-null response
- Throws:
ClickHouseException- when error occurred during execution
-
executeWithinTransaction
Deprecated.Executes the request within an implicit transaction. New transaction will be always created and started right before the query, and it will be committed or rolled back afterwards automatically.- Returns:
- non-null response
- Throws:
ClickHouseException- when error occurred during execution
-
executeWithinTransaction
@Deprecated public ClickHouseResponse executeWithinTransaction(boolean useImplicitTransaction) throws ClickHouseException Deprecated.will be removed in the future, once the minimum supported version of ClickHouse is 22.7 or aboveExecutes the request within an implicit transaction. WhenuseImplicitTransactionis set totrue, it enforces the client to useimplicit_transactionsetting which is only available in ClickHouse 22.7+. Otherwise, new transaction will be always created and started right before the query, and it will be committed or rolled back afterwards automatically.- Parameters:
useImplicitTransaction-trueto use native implicit transaction requiring ClickHouse 22.7+ with minimum overhead(no session on server side and no additional objects on client side); false to use auto-commit transaction- Returns:
- non-null response
- Throws:
ClickHouseException- when error occurred during execution
-