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
clientConfig, config, externalTables, input, namedParameters, options, preparedQuery, queryId, server, sessionId, settings, sql, statements
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMutation(ClickHouseRequest<?> request, boolean sealed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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()Sends mutation requets for execution.ClickHouseRequest.Mutationtable(String table, String queryId)Sets target table and optionally query id.-
Methods inherited from class com.clickhouse.client.ClickHouseRequest
addExternal, checkSealed, clearSession, compressServerResponse, compressServerResponse, compressServerResponse, copy, decompressClientRequest, decompressClientRequest, decompressClientRequest, execute, external, external, getClient, getConfig, getExternalTables, getFormat, getInputStream, getPreparedQuery, getQueryId, getServer, getSessionId, getSettings, getStatements, getStatements, hasInputStream, isSealed, option, options, options, params, params, params, params, params, params, params, params, query, query, query, query, removeExternal, removeExternal, removeOption, removeSetting, reset, resetCache, session, session, session, session, set, set, table, 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- non-null format- Returns:
- the request itself
-
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 requets
-
send
public CompletableFuture<ClickHouseResponse> send()
Sends mutation requets for execution. Same asclient.execute(request.seal()).- Returns:
- future to get response
- Throws:
CompletionException- when error occurred
-
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.- Overrides:
sealin classClickHouseRequest<ClickHouseRequest.Mutation>- Returns:
- sealed request, an immutable copy of the current request
-
-