| Apache Ignite C++

Public Member Functions | List of all members
ignite::cache::query::SqlFieldsQuery Class Reference

Sql fields query. More...

`#include <query_sql_fields.h>`

## Public Member Functions
| SqlFieldsQuery (const std::string &sql)
| Constructor. More...
| SqlFieldsQuery (const std::string &sql, bool loc)
| Constructor. More...
| SqlFieldsQuery (const SqlFieldsQuery &other)
| Copy constructor. More...
SqlFieldsQuery & | operator= (const SqlFieldsQuery &other)
| Assignment operator. More...
| ~SqlFieldsQuery ()
| Destructor.
void | Swap (SqlFieldsQuery &other)
| Efficiently swaps contents with another SqlQuery instance. More...
const std::string & | GetSql () const
| Get SQL string. More...
void | SetSql (const std::string &sql)
| Set SQL string. More...
int32_t | GetPageSize () const
| Get page size. More...
void | SetPageSize (int32_t pageSize)
| Set page size. More...
bool | IsLocal () const
| Get local flag. More...
void | SetLocal (bool loc)
| Set local flag. More...
bool | IsLazy () const
| Gets lazy query execution flag. More...
void | SetLazy (bool lazy)
| Sets lazy query execution flag. More...
bool | IsEnforceJoinOrder () const
| Checks if join order of tables if enforced. More...
void | SetEnforceJoinOrder (bool enforce)
| Sets flag to enforce join order of tables in the query. More...
bool | IsDistributedJoins () const
| Check if distributed joins are enabled for this query. More...
void | SetDistributedJoins (bool enabled)
| Specify if distributed joins are enabled for this query. More...
template<typename T >
void | AddArgument (const T &arg)
| Add argument. More...
void | AddInt8ArrayArgument (const int8_t *src, int32_t len)
| Add array of bytes as an argument. More...
void | ClearArguments ()
| Remove all added arguments.
void | SetSchema (const std::string &schema)
| Set schema name for the query. More...
const std::string & | GetSchema () const
| Get schema name for the query. More...
void | Write (binary::BinaryRawWriter &writer) const
| Write query info to the stream. More...

## Detailed Description

Sql fields query.

## Constructor & Destructor Documentation

## ◆ SqlFieldsQuery() [1/3]

ignite::cache::query::SqlFieldsQuery::SqlFieldsQuery | ( | const std::string & | sql | ) |
| inline

Constructor.

Parameters

  sql | SQL string.

## ◆ SqlFieldsQuery() [2/3]

ignite::cache::query::SqlFieldsQuery::SqlFieldsQuery | ( | const std::string & | sql,
|  | bool | loc
| ) |  |
| inline

Constructor.

Parameters

  sql | SQL string.
  loc | Whether query should be executed locally.

## ◆ SqlFieldsQuery() [3/3]

ignite::cache::query::SqlFieldsQuery::SqlFieldsQuery | ( | const SqlFieldsQuery & | other | ) |
| inline

Copy constructor.

Parameters

  other | Other instance.

## Member Function Documentation

## ◆ AddArgument()

template<typename T >

void ignite::cache::query::SqlFieldsQuery::AddArgument | ( | const T & | arg | ) |
| inline

Add argument.

Template argument type should be copy-constructable and assignable. Also BinaryType class template should be specialized for this type.

Parameters

  arg | Argument.

## ◆ AddInt8ArrayArgument()

void ignite::cache::query::SqlFieldsQuery::AddInt8ArrayArgument | ( | const int8_t * | src,
|  | int32_t | len
| ) |  |
| inline

Add array of bytes as an argument.

Parameters

  src | Array pointer.
  len | Array length in bytes.

## ◆ GetPageSize()

int32_t ignite::cache::query::SqlFieldsQuery::GetPageSize | ( |  | ) | const
| inline

Get page size.

Returns
  Page size.

## ◆ GetSchema()

const std::string& ignite::cache::query::SqlFieldsQuery::GetSchema | ( |  | ) | const
| inline

Get schema name for the query.

If not set, current cache name is used, which means you can omit schema name for tables within the current cache.

Returns
  Schema. Empty string if not set.

## ◆ GetSql()

const std::string& ignite::cache::query::SqlFieldsQuery::GetSql | ( |  | ) | const
| inline

Get SQL string.

Returns
  SQL string.

## ◆ IsDistributedJoins()

bool ignite::cache::query::SqlFieldsQuery::IsDistributedJoins | ( |  | ) | const
| inline

Check if distributed joins are enabled for this query.

Returns
  True If distributed joind enabled.

## ◆ IsEnforceJoinOrder()

bool ignite::cache::query::SqlFieldsQuery::IsEnforceJoinOrder | ( |  | ) | const
| inline

Checks if join order of tables if enforced.

Returns
  Flag value.

## ◆ IsLazy()

bool ignite::cache::query::SqlFieldsQuery::IsLazy | ( |  | ) | const
| inline

Gets lazy query execution flag.

See SetLazy(bool) for more information.

Returns
  Lazy flag.

## ◆ IsLocal()

bool ignite::cache::query::SqlFieldsQuery::IsLocal | ( |  | ) | const
| inline

Get local flag.

Returns
  Local flag.

## ◆ operator=()

SqlFieldsQuery& ignite::cache::query::SqlFieldsQuery::operator= | ( | const SqlFieldsQuery & | other | ) |
| inline

Assignment operator.

Parameters

  other | Other instance.

## ◆ SetDistributedJoins()

void ignite::cache::query::SqlFieldsQuery::SetDistributedJoins | ( | bool | enabled | ) |
| inline

Specify if distributed joins are enabled for this query.

When disabled, join results will only contain colocated data (joins work locally). When enabled, joins work as expected, no matter how the data is distributed.

Parameters

  enabled | Distributed joins enabled.

## ◆ SetEnforceJoinOrder()

void ignite::cache::query::SqlFieldsQuery::SetEnforceJoinOrder | ( | bool | enforce | ) |
| inline

Sets flag to enforce join order of tables in the query.

If set to true query optimizer will not reorder tables in join. By default is false.

It is not recommended to enable this property unless 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.

Parameters

  enforce | Flag value.

## ◆ SetLazy()

void ignite::cache::query::SqlFieldsQuery::SetLazy | ( | bool | lazy | ) |
| inline

Sets lazy query execution flag.

By default Ignite attempts to fetch the whole query result set to memory and send it to the client. For small and medium result sets this provides optimal performance and minimize duration of internal database locks, thus increasing concurrency.

If result set is too big to fit in available memory this could lead to excessive GC pauses and even OutOfMemoryError. Use this flag as a hint for Ignite to fetch result set lazily, thus minimizing memory consumption at the cost of moderate performance hit.

Defaults to `false`, meaning that the whole result set is fetched to memory eagerly.

Parameters

  lazy | Lazy query execution flag.

## ◆ SetLocal()

void ignite::cache::query::SqlFieldsQuery::SetLocal | ( | bool | loc | ) |
| inline

Set local flag.

Parameters

  val | Value of the flag. If true, query will be executed only on local node, so only local entries will be returned as query result.

## ◆ SetPageSize()

void ignite::cache::query::SqlFieldsQuery::SetPageSize | ( | int32_t | pageSize | ) |
| inline

Set page size.

Parameters

  pageSize | Page size.

## ◆ SetSchema()

void ignite::cache::query::SqlFieldsQuery::SetSchema | ( | const std::string & | schema | ) |
| inline

Set schema name for the query.

If not set, current cache name is used, which means you can omit schema name for tables within the current cache.

Parameters

  schema | Schema. Empty string to unset.

## ◆ SetSql()

void ignite::cache::query::SqlFieldsQuery::SetSql | ( | const std::string & | sql | ) |
| inline

Set SQL string.

Parameters

  sql | SQL string.

## ◆ Swap()

void ignite::cache::query::SqlFieldsQuery::Swap | ( | SqlFieldsQuery & | other | ) |
| inline

Efficiently swaps contents with another SqlQuery instance.

Parameters

  other | Other instance.

## ◆ Write()

void ignite::cache::query::SqlFieldsQuery::Write | ( | binary::BinaryRawWriter & | writer | ) | const
| inline

Write query info to the stream.

Parameters

  writer | Writer.

The documentation for this class was generated from the following file:

- core/include/ignite/cache/query/query_sql_fields.h