public class SqlFieldsQuery extends Query<List<?>>
'select' clause, as opposed to SqlQuery, which always returns
the whole key and value objects back.
For example, in case of Word-Count example, we know that all identical words
are processed on the same cluster member, because we use the word itself
as affinity key. This allows Ignite to execute the 'limit' clause on
the remote nodes and bring back only the small data set specified within the 'limit' clause,
instead of the whole query result as would happen in a non-collocated execution.
IgniteCache.query(Query),
Serialized FormDFLT_PAGE_SIZE| Constructor and Description |
|---|
SqlFieldsQuery(String sql)
Constructs SQL fields query.
|
SqlFieldsQuery(String sql,
boolean collocated)
Constructs SQL fields query.
|
| Modifier and Type | Method and Description |
|---|---|
Object[] |
getArgs()
Gets SQL arguments.
|
int[] |
getPartitions()
Gets partitions for query, in ascending order.
|
String |
getSchema()
Get schema for the query.
|
String |
getSql()
Gets SQL clause.
|
int |
getTimeout()
Gets the query execution timeout in milliseconds.
|
boolean |
isCollocated()
Checks if this query is collocated.
|
boolean |
isDistributedJoins()
Check if distributed joins are enabled for this query.
|
boolean |
isEnforceJoinOrder()
Checks if join order of tables if enforced.
|
boolean |
isReplicatedOnly()
Check is the query contains only replicated tables.
|
SqlFieldsQuery |
setArgs(Object... args)
Sets SQL arguments.
|
SqlFieldsQuery |
setCollocated(boolean collocated)
Sets flag defining if this query is collocated.
|
SqlFieldsQuery |
setDistributedJoins(boolean distributedJoins)
Specify if distributed joins are enabled for this query.
|
SqlFieldsQuery |
setEnforceJoinOrder(boolean enforceJoinOrder)
Sets flag to enforce join order of tables in the query.
|
SqlFieldsQuery |
setLocal(boolean loc)
Sets whether this query should be executed on local node only.
|
SqlFieldsQuery |
setPageSize(int pageSize)
Sets optional page size, if
0, then default is used. |
SqlFieldsQuery |
setPartitions(int... parts)
Sets partitions for a query.
|
SqlFieldsQuery |
setReplicatedOnly(boolean replicatedOnly)
Specify if the query contains only replicated tables.
|
SqlFieldsQuery |
setSchema(String schema)
Set schema for the query.
|
SqlFieldsQuery |
setSql(String sql)
Sets SQL clause.
|
SqlFieldsQuery |
setTimeout(int timeout,
TimeUnit timeUnit)
Sets the query execution timeout.
|
String |
toString() |
getPageSize, isLocal, preparepublic SqlFieldsQuery(String sql)
sql - SQL query.public SqlFieldsQuery(String sql, boolean collocated)
sql - SQL query.collocated - Collocated flag.public String getSql()
public SqlFieldsQuery setSql(String sql)
sql - SQL clause.this For chaining.public Object[] getArgs()
public SqlFieldsQuery setArgs(Object... args)
args - SQL arguments.this For chaining.public int getTimeout()
public SqlFieldsQuery setTimeout(int timeout, TimeUnit timeUnit)
timeout - Timeout value. Zero value disables timeout.timeUnit - Time unit.this For chaining.public boolean isCollocated()
true If the query is collocated.public SqlFieldsQuery setCollocated(boolean collocated)
collocated - Flag value.this For chaining.public boolean isEnforceJoinOrder()
public SqlFieldsQuery setEnforceJoinOrder(boolean enforceJoinOrder)
true
query optimizer will not reorder tables in join. By default is false.
It is not recommended to enable this property until you are sure that your indexes and the query itself are correct and tuned as much as possible but query optimizer still produces wrong join order.
enforceJoinOrder - Flag value.this For chaining.public SqlFieldsQuery setDistributedJoins(boolean distributedJoins)
distributedJoins - Distributed joins enabled.this For chaining.public boolean isDistributedJoins()
true If distributed joind enabled.public SqlFieldsQuery setPageSize(int pageSize)
0, then default is used.setPageSize in class Query<List<?>>pageSize - Optional page size.this for chaining.public SqlFieldsQuery setLocal(boolean loc)
public SqlFieldsQuery setReplicatedOnly(boolean replicatedOnly)
replicatedOnly - The query contains only replicated tables.this For chaining.public boolean isReplicatedOnly()
true If the query contains only replicated tables.@Nullable public int[] getPartitions()
public SqlFieldsQuery setPartitions(@Nullable int... parts)
Note what passed array'll be sorted in place for performance reasons, if it wasn't sorted yet.
parts - Partitions.this for chaining.@Nullable public String getSchema()
public SqlFieldsQuery setSchema(@Nullable String schema)
schema - Schema. Null to unset schema.this for chaining.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.2.0 Release Date : September 15 2017