Package com.clickhouse.client
Class ClickHouseRequest.Mutation
- java.lang.Object
-
- com.clickhouse.client.ClickHouseRequest<ClickHouseRequest.Mutation>
-
- com.clickhouse.client.ClickHouseRequest.Mutation
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- ClickHouseRequest<SelfT extends ClickHouseRequest<SelfT>>
public static class ClickHouseRequest.Mutation extends ClickHouseRequest<ClickHouseRequest.Mutation>
Mutation request.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.clickhouse.client.ClickHouseRequest
ClickHouseRequest.Mutation
-
-
Field Summary
-
Fields inherited from class com.clickhouse.client.ClickHouseRequest
changeListener, config, externalTables, input, managerRef, namedParameters, options, output, preparedQuery, queryId, server, serverListener, serverRef, settings, sql, statements, txRef
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMutation(ClickHouseRequest<?> request, boolean sealed)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ClickHouseRequest.Mutationdata(ClickHouseDeferredValue<ClickHouseInputStream> input)Loads data from input stream.ClickHouseRequest.Mutationdata(ClickHouseFile file)Loads data from given file which may or may not be compressed.ClickHouseRequest.Mutationdata(ClickHouseInputStream input)Loads data from input stream.ClickHouseRequest.Mutationdata(ClickHouseWriter writer)Sets custom writer for streaming.ClickHouseRequest.Mutationdata(InputStream input)Loads data from input stream.ClickHouseRequest.Mutationdata(String file)Loads data from given file which may or may not be compressed.ClickHouseRequest.Mutationdata(String file, ClickHouseCompression compression)Loads compressed data from given file.CompletableFuture<ClickHouseResponse>execute()Executes the request.ClickHouseResponseexecuteAndWait()Synchronous version ofClickHouseRequest.execute().ClickHouseRequest.Mutationformat(ClickHouseFormat format)Sets format to be used for communication between server and client.protected StringgetQuery()Gets query, either set byquery()ortable().ClickHouseRequest.Mutationseal()Creates a sealed request, which is an immutable copy of the current request.CompletableFuture<ClickHouseResponse>send()Deprecated.will be removed in v0.3.3, please useexecute()insteadClickHouseResponsesendAndWait()Deprecated.will be removed in v0.3.3, please useexecuteAndWait()insteadClickHouseRequest.Mutationtable(String table, String queryId)Sets target table and optionally query id.-
Methods inherited from class com.clickhouse.client.ClickHouseRequest
addExternal, changeProperty, changeServer, checkSealed, clearSession, compressServerResponse, compressServerResponse, compressServerResponse, compressServerResponse, copy, decompressClientRequest, decompressClientRequest, decompressClientRequest, decompressClientRequest, executeWithinTransaction, executeWithinTransaction, external, external, getChangeListener, getClient, getConfig, getExternalTables, getFormat, getInputFormat, getInputStream, getManager, getOutputStream, getPreparedQuery, getQueryId, getServer, getServerListener, getSessionId, getSettings, getStatements, getStatements, getTransaction, hasInputStream, hasOutputStream, isSealed, isTransactional, manager, option, options, options, output, output, output, output, output, output, params, params, params, params, params, params, params, params, query, query, query, query, removeExternal, removeExternal, removeOption, removeSetting, reset, resetCache, session, session, session, session, set, set, setChangeListener, setServerListener, settings, table, transaction, transaction, transaction, use, write
-
-
-
-
Constructor Detail
-
Mutation
protected Mutation(ClickHouseRequest<?> request, boolean sealed)
-
-
Method Detail
-
getQuery
protected String getQuery()
Description copied from class:ClickHouseRequestGets query, either set byquery()ortable().- Overrides:
getQueryin classClickHouseRequest<ClickHouseRequest.Mutation>- Returns:
- sql query
-
format
public ClickHouseRequest.Mutation format(ClickHouseFormat format)
Description copied from class:ClickHouseRequestSets format to be used for communication between server and client.- Overrides:
formatin classClickHouseRequest<ClickHouseRequest.Mutation>- Parameters:
format- preferred format,nullmeans reset to default- Returns:
- the request itself
-
data
public ClickHouseRequest.Mutation data(ClickHouseWriter writer)
Sets custom writer for streaming. This will create a piped stream between the writer and ClickHouse server.- Parameters:
writer- writer- Returns:
- mutation request
-
data
public ClickHouseRequest.Mutation data(ClickHouseFile file)
Loads data from given file which may or may not be compressed.- Parameters:
file- absolute or relative path of the file, file extension will be used to determine if it's compressed or not- Returns:
- mutation request
-
data
public ClickHouseRequest.Mutation data(String file)
Loads data from given file which may or may not be compressed.- Parameters:
file- absolute or relative path of the file, file extension will be used to determine if it's compressed or not- Returns:
- mutation request
-
data
public ClickHouseRequest.Mutation data(String file, ClickHouseCompression compression)
Loads compressed data from given file.- Parameters:
file- absolute or relative path of the filecompression- compression algorithm,ClickHouseCompression.NONEmeans no compression- Returns:
- mutation request
-
data
public ClickHouseRequest.Mutation data(InputStream input)
Loads data from input stream.- Parameters:
input- input stream- Returns:
- mutation request
-
data
public ClickHouseRequest.Mutation data(ClickHouseInputStream input)
Loads data from input stream.- Parameters:
input- input stream- Returns:
- mutation request
-
data
public ClickHouseRequest.Mutation data(ClickHouseDeferredValue<ClickHouseInputStream> input)
Loads data from input stream.- Parameters:
input- input stream- Returns:
- mutation request
-
execute
public CompletableFuture<ClickHouseResponse> execute()
Description copied from class:ClickHouseRequestExecutes the request. Same asclient.execute(request.seal()).- Overrides:
executein classClickHouseRequest<ClickHouseRequest.Mutation>- Returns:
- non-null future to get response
-
executeAndWait
public ClickHouseResponse executeAndWait() throws ClickHouseException
Description copied from class:ClickHouseRequestSynchronous version ofClickHouseRequest.execute().- Overrides:
executeAndWaitin classClickHouseRequest<ClickHouseRequest.Mutation>- Returns:
- non-null response
- Throws:
ClickHouseException- when error occurred during execution
-
send
@Deprecated public CompletableFuture<ClickHouseResponse> send()
Deprecated.will be removed in v0.3.3, please useexecute()insteadSends mutation request for execution. Same asclient.execute(request.seal()).- Returns:
- non-null future to get response
- Throws:
CompletionException- when error occurred
-
sendAndWait
public ClickHouseResponse sendAndWait() throws ClickHouseException
Deprecated.will be removed in v0.3.3, please useexecuteAndWait()insteadSynchronous version ofsend().- Returns:
- non-null response
- Throws:
ClickHouseException- when error occurred during execution
-
table
public ClickHouseRequest.Mutation table(String table, String queryId)
Description copied from class:ClickHouseRequestSets target table and optionally query id. This will generate a query likeSELECT * FROM [table]and override the one set byClickHouseRequest.query(String, String).- Overrides:
tablein classClickHouseRequest<ClickHouseRequest.Mutation>- Parameters:
table- non-empty table namequeryId- query id, null means no query id- Returns:
- the request itself
-
seal
public ClickHouseRequest.Mutation seal()
Description copied from class:ClickHouseRequestCreates 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.- Overrides:
sealin classClickHouseRequest<ClickHouseRequest.Mutation>- Returns:
- sealed request, an immutable copy of the current request
-
-