Class SqlFieldsQueryEx

    • Constructor Detail

      • SqlFieldsQueryEx

        public SqlFieldsQueryEx​(String sql,
                                Boolean isQry)
        Parameters:
        sql - SQL query.
        isQry - Flag indicating whether this object denotes a query or an update operation.
    • Method Detail

      • isQuery

        public Boolean isQuery()
        Returns:
        Flag indicating whether this object denotes a query or an update operation.
      • setTimeout

        public SqlFieldsQueryEx setTimeout​(int timeout,
                                           TimeUnit timeUnit)
        Sets the query execution timeout. Query will be automatically cancelled if the execution timeout is exceeded.
        Overrides:
        setTimeout in class SqlFieldsQuery
        Parameters:
        timeout - Timeout value. Zero value disables timeout.
        timeUnit - Time unit.
        Returns:
        this For chaining.
      • setCollocated

        public SqlFieldsQueryEx setCollocated​(boolean collocated)
        Sets flag defining if this query is collocated. Collocation flag is used for optimization purposes of queries with GROUP BY statements. Whenever Ignite executes a distributed query, it sends sub-queries to individual cluster members. If you know in advance that the elements of your query selection are collocated together on the same node and you group by collocated key (primary or affinity key), then Ignite can make significant performance and network optimizations by grouping data on remote nodes.
        Overrides:
        setCollocated in class SqlFieldsQuery
        Parameters:
        collocated - Flag value.
        Returns:
        this For chaining.
      • setEnforceJoinOrder

        public SqlFieldsQueryEx setEnforceJoinOrder​(boolean enforceJoinOrder)
        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 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.

        Overrides:
        setEnforceJoinOrder in class SqlFieldsQuery
        Parameters:
        enforceJoinOrder - Flag value.
        Returns:
        this For chaining.
      • setDistributedJoins

        public SqlFieldsQueryEx setDistributedJoins​(boolean distributedJoins)
        Specify if distributed joins are enabled for this query.
        Overrides:
        setDistributedJoins in class SqlFieldsQuery
        Parameters:
        distributedJoins - Distributed joins enabled.
        Returns:
        this For chaining.
      • setPageSize

        public SqlFieldsQueryEx setPageSize​(int pageSize)
        Sets optional page size, if 0, then default is used.
        Overrides:
        setPageSize in class SqlFieldsQuery
        Parameters:
        pageSize - Optional page size.
        Returns:
        this for chaining.
      • setLocal

        public SqlFieldsQueryEx setLocal​(boolean loc)
        Sets whether this query should be executed on local node only.
        Overrides:
        setLocal in class SqlFieldsQuery
        Parameters:
        loc - Local flag.
        Returns:
        this for chaining.
      • setSkipReducerOnUpdate

        public SqlFieldsQuery setSkipReducerOnUpdate​(boolean skipReducerOnUpdate)
        Sets server side update flag.

        By default, when processing DML command, Ignite first fetches all affected intermediate rows for analysis to the node which initiated the query and only then forms batches of updated values to be sent to remote nodes. For simple DML commands (that however affect great deal of rows) such approach may be an overkill in terms of network delays and memory usage on initiating node. Use this flag as hint for Ignite to do all intermediate rows analysis and updates in place on corresponding remote data nodes.

        There are limitations to what DML command can be optimized this way. The command containing LIMIT, OFFSET, DISTINCT, ORDER BY, GROUP BY, sub-query or UNION will be processed the usual way despite this flag setting.

        Defaults to false, meaning that intermediate results will be fetched to initiating node first. Only affects DML commands. Ignored when Query.isLocal() is true. Note that when set to true, the query may fail in the case of even single node failure.

        Parameters:
        skipReducerOnUpdate - Server side update flag.
        Returns:
        this For chaining.
      • isSkipReducerOnUpdate

        public boolean isSkipReducerOnUpdate()
        Gets server side update flag.

        See setSkipReducerOnUpdate(boolean) for more information.

        Returns:
        Server side update flag.
      • isAutoCommit

        public boolean isAutoCommit()
        Returns:
        Auto commit flag.
      • setAutoCommit

        public void setAutoCommit​(boolean autoCommit)
        Parameters:
        autoCommit - Auto commit flag.
      • addBatchedArgs

        public void addBatchedArgs​(Object[] args)
        Adds batched arguments.
        Parameters:
        args - Batched arguments.
      • clearBatchedArgs

        public void clearBatchedArgs()
        Clears batched arguments.
      • batchedArguments

        public List<Object[]> batchedArguments()
        Returns batched arguments.
        Returns:
        Batched arguments.
      • isBatched

        public boolean isBatched()
        Checks if query is batched.
        Returns:
        True if batched.