blob: c0feeb0aed88eb757eabc58e9a13659181125f7d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Query (Apache Geode 1.15.1)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Query (Apache Geode 1.15.1)";
}
}
catch(err) {
}
//-->
var methods = {"i0":38,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":38};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/geode/cache/query/ParameterCountInvalidException.html" title="class in org.apache.geode.cache.query"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/geode/cache/query/QueryException.html" title="class in org.apache.geode.cache.query"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/geode/cache/query/Query.html" target="_top">Frames</a></li>
<li><a href="Query.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.geode.cache.query</div>
<h2 title="Interface Query" class="title">Interface Query</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Query</span></pre>
<div class="block">Interface for query objects. Supports execution of queries with optional parameters.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>GemFire 4.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/Query.html#compile--">compile</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">as of 6.5</span></div>
</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/Query.html#execute--">execute</a></span>()</code>
<div class="block">Executes this query and returns an object that represent its result.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/Query.html#execute-java.lang.Object...-">execute</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;params)</code>
<div class="block">Executes this query with the given parameters and returns an object that represent its result.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/Query.html#execute-org.apache.geode.cache.execute.RegionFunctionContext-">execute</a></span>(<a href="../../../../../org/apache/geode/cache/execute/RegionFunctionContext.html" title="interface in org.apache.geode.cache.execute">RegionFunctionContext</a>&nbsp;context)</code>
<div class="block">Executes this query on the partitioned data-store associated with the given
RegionFunctionContext and returns an object that represents its result.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/Query.html#execute-org.apache.geode.cache.execute.RegionFunctionContext-java.lang.Object:A-">execute</a></span>(<a href="../../../../../org/apache/geode/cache/execute/RegionFunctionContext.html" title="interface in org.apache.geode.cache.execute">RegionFunctionContext</a>&nbsp;context,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>[]&nbsp;params)</code>
<div class="block">Executes this query on the partitioned data-store associated with the given
RegionFunctionContext and parameters and returns an object that represents its result.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/Query.html#getQueryString--">getQueryString</a></span>()</code>
<div class="block">Return the original query string that was specified in the constructor.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/geode/cache/query/QueryStatistics.html" title="interface in org.apache.geode.cache.query">QueryStatistics</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/Query.html#getStatistics--">getStatistics</a></span>()</code>
<div class="block">Get statistics information for this query.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/geode/cache/query/Query.html#isCompiled--">isCompiled</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">as of 6.5</span></div>
</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getQueryString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQueryString</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getQueryString()</pre>
<div class="block">Return the original query string that was specified in the constructor.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the original query string</dd>
</dl>
</li>
</ul>
<a name="execute--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>execute</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;execute()
throws <a href="../../../../../org/apache/geode/cache/query/FunctionDomainException.html" title="class in org.apache.geode.cache.query">FunctionDomainException</a>,
<a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a>,
<a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a>,
<a href="../../../../../org/apache/geode/cache/query/QueryInvocationTargetException.html" title="class in org.apache.geode.cache.query">QueryInvocationTargetException</a></pre>
<div class="block">Executes this query and returns an object that represent its result. If the query resolves to a
primitive type, an instance of the corresponding wrapper type (<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang"><code>Integer</code></a>, etc.)
is returned. If the query resolves to more than one object, a <a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="interface in org.apache.geode.cache.query"><code>SelectResults</code></a> is
returned.
Query execution can potentially take a long time depending on data size and query complexity.
The system property "gemfire.Cache.MAX_QUERY_EXECUTION_TIME" can be set to define the maximum
time allowed for a query to complete its execution. If query execution time exceeds
"gemfire.Cache.MAX_QUERY_EXECUTION_TIME", then the query is canceled and
QueryExecutionTimeoutException is thrown back to the caller, if the execution is local to the
VM. If the canceled query was initiated by a GemFire client, then a QueryException is thrown on
the client with its cause set to QueryExecutionTimeoutException. This timeout does not account
for the time taken to construct the results after execution completes and the results returned
to the caller.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The object that represents the result of the query. Note that if a query is just a
select statement then it will return a result that is an instance of
<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="interface in org.apache.geode.cache.query"><code>SelectResults</code></a>. However, since a query is not necessarily just a select
statement, the return type of this method is <code>Object</code>. For example, the
query <code><b>(select distinct * from /rgn).size</b></code> returns an instance of
<code>java.lang.Integer</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/geode/cache/query/FunctionDomainException.html" title="class in org.apache.geode.cache.query">FunctionDomainException</a></code> - A function was applied to a parameter that is improper for that
function. For example, the ELEMENT function was applied to a collection of more than
one element</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a></code> - If a bound parameter is not of the expected type.</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a></code> - If a name in the query cannot be resolved.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - The number of bound parameters does not match the number of
placeholders</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - If the query is not permitted on this type of region</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryExecutionTimeoutException.html" title="class in org.apache.geode.cache.query">QueryExecutionTimeoutException</a></code> - If the query gets canceled due to setting system
variable "gemfire.Cache.MAX_QUERY_EXECUTION_TIME". This is a thrown when query is
executed on the local regions (embedded mode).</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryInvocationTargetException.html" title="class in org.apache.geode.cache.query">QueryInvocationTargetException</a></code> - If the data referenced in from clause is not available
for querying.</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryExecutionLowMemoryException.html" title="class in org.apache.geode.cache.query">QueryExecutionLowMemoryException</a></code> - If the query gets canceled due to low memory
conditions and the resource manager critical heap percentage has been set</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/persistence/PartitionOfflineException.html" title="class in org.apache.geode.cache.persistence">PartitionOfflineException</a></code> - If persistent data recovery is not complete for a partitioned
region referred to in the query.</dd>
</dl>
</li>
</ul>
<a name="execute-java.lang.Object...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>execute</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;execute(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>...&nbsp;params)
throws <a href="../../../../../org/apache/geode/cache/query/FunctionDomainException.html" title="class in org.apache.geode.cache.query">FunctionDomainException</a>,
<a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a>,
<a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a>,
<a href="../../../../../org/apache/geode/cache/query/QueryInvocationTargetException.html" title="class in org.apache.geode.cache.query">QueryInvocationTargetException</a></pre>
<div class="block">Executes this query with the given parameters and returns an object that represent its result.
If the query resolves to a primitive type, an instance of the corresponding wrapper type
(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang"><code>Integer</code></a>, etc.) is returned. If the query resolves to more than one object, a
<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="interface in org.apache.geode.cache.query"><code>SelectResults</code></a> is returned.
Query execution can potentially take a long time depending on data size and query complexity.
The system property "gemfire.Cache.MAX_QUERY_EXECUTION_TIME" can be set to define the maximum
time allowed for a query to complete its execution. If query execution time exceeds
"gemfire.Cache.MAX_QUERY_EXECUTION_TIME", then the query is canceled and
QueryExecutionTimeoutException is thrown back to the caller, if the execution is local to the
VM. If the canceled query was initiated by a GemFire client, then a QueryException is thrown on
the client with its cause set to QueryExecutionTimeoutException. This timeout does not account
for the time taken to construct the results after execution completes and the results returned
to the caller.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>params</code> - Values that are bound to parameters (such as <code>$1</code>) in this query.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The object that represents the result of the query. Note that if a query is just a
select statement then it will return a result that is an instance of
<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="interface in org.apache.geode.cache.query"><code>SelectResults</code></a>. However, since a query is not necessarily just a select
statement, the return type of this method is <code>Object</code>. For example, the
query <code><b>(select distinct * from /rgn).size</b></code> returns an instance of
<code>java.lang.Integer</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/geode/cache/query/FunctionDomainException.html" title="class in org.apache.geode.cache.query">FunctionDomainException</a></code> - A function was applied to a parameter that is improper for that
function. For example, the ELEMENT function was applied to a collection of more than
one element</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a></code> - If a bound parameter is not of the expected type.</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a></code> - If a name in the query cannot be resolved.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - The number of bound parameters does not match the number of
placeholders</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - If the query is not permitted on this type of region</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryExecutionTimeoutException.html" title="class in org.apache.geode.cache.query">QueryExecutionTimeoutException</a></code> - If the query gets canceled due to setting system
variable "gemfire.Cache.MAX_QUERY_EXECUTION_TIME". This is a thrown when query is
executed on the local regions (embedded mode).</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryInvocationTargetException.html" title="class in org.apache.geode.cache.query">QueryInvocationTargetException</a></code> - If the data referenced in from clause is not available
for querying.</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryExecutionLowMemoryException.html" title="class in org.apache.geode.cache.query">QueryExecutionLowMemoryException</a></code> - If the query gets canceled due to low memory
conditions and the resource manager critical heap percentage has been set</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/persistence/PartitionOfflineException.html" title="class in org.apache.geode.cache.persistence">PartitionOfflineException</a></code> - If persistent data recovery is not complete for a partitioned
region referred to in the query.</dd>
</dl>
</li>
</ul>
<a name="execute-org.apache.geode.cache.execute.RegionFunctionContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>execute</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;execute(<a href="../../../../../org/apache/geode/cache/execute/RegionFunctionContext.html" title="interface in org.apache.geode.cache.execute">RegionFunctionContext</a>&nbsp;context)
throws <a href="../../../../../org/apache/geode/cache/query/FunctionDomainException.html" title="class in org.apache.geode.cache.query">FunctionDomainException</a>,
<a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a>,
<a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a>,
<a href="../../../../../org/apache/geode/cache/query/QueryInvocationTargetException.html" title="class in org.apache.geode.cache.query">QueryInvocationTargetException</a></pre>
<div class="block">Executes this query on the partitioned data-store associated with the given
RegionFunctionContext and returns an object that represents its result. An Exception is thrown
when data-set associated with the <a href="../../../../../org/apache/geode/cache/execute/RegionFunctionContext.html" title="interface in org.apache.geode.cache.execute"><code>RegionFunctionContext</code></a> gets moved or destroyed from
the local node.
The RegionFunctionContext defines the execution context of a data dependent <a href="../../../../../org/apache/geode/cache/execute/Function.html" title="interface in org.apache.geode.cache.execute"><code>Function</code></a>.
And is obtained when the function is executed using <a href="../../../../../org/apache/geode/cache/execute/FunctionService.html#onRegion-org.apache.geode.cache.Region-"><code>FunctionService.onRegion(Region)</code></a>,
the <a href="../../../../../org/apache/geode/cache/execute/Function.html#execute-org.apache.geode.cache.execute.FunctionContext-"><code>FunctionContext</code></a>
E.g.: // Function service execute() method:
public void execute(FunctionContext context) { RegionFunctionContext regionContext =
(RegionFunctionContext)context; Query query = cache.getQueryService().newQuery("Select * from
/MyRegion"); SelectResults results = (SelectResults)query.execute(regionContext); }
Using this method a join query query can be executed between two co-located PartitionRegion
data-set referenced through <a href="../../../../../org/apache/geode/cache/execute/RegionFunctionContext.html" title="interface in org.apache.geode.cache.execute"><code>RegionFunctionContext</code></a>.
This method should NOT be used for multiple partitioned regions based join queries. We support
equi-join queries only on co-located PartitionedRegions if the the co-located columns ACTUALLY
EXIST IN WHERE CLAUSE and in case of multi-column partitioning , should have "AND" clause.
E.g.: // Equi-join query:
Select * from /partitionRegion1 p1, /PartitionRegion2 p2 where p1.field = p2.field [AND .....]</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - RegionFunctionContext which will target the query on subset of data if executed
on PartitionedRegion.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The object that represents the result of the query. Note that if a query is just a
select statement then it will return a result that is an instance of
<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="interface in org.apache.geode.cache.query"><code>SelectResults</code></a>. However, since a query is not necessarily just a select
statement, the return type of this method is <code>Object</code>. For example, the
query <code><b>(select distinct * from /rgn).size</b></code> returns an instance of
<code>java.lang.Integer</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/geode/cache/query/FunctionDomainException.html" title="class in org.apache.geode.cache.query">FunctionDomainException</a></code> - A function was applied to a parameter that is improper for that
function. For example, the ELEMENT function was applied to a collection of more than
one element</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a></code> - If a bound parameter is not of the expected type.</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a></code> - If a name in the query cannot be resolved.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - The number of bound parameters does not match the number of
place holders</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - If the query is not permitted on this type of region</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryExecutionTimeoutException.html" title="class in org.apache.geode.cache.query">QueryExecutionTimeoutException</a></code> - If the query gets canceled due to setting system
variable "gemfire.Cache.MAX_QUERY_EXECUTION_TIME". This is a thrown when query is
executed on the local regions (embedded mode).</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryInvocationTargetException.html" title="class in org.apache.geode.cache.query">QueryInvocationTargetException</a></code> - If the data referenced in from clause is not available
for querying.</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryExecutionLowMemoryException.html" title="class in org.apache.geode.cache.query">QueryExecutionLowMemoryException</a></code> - If the query gets canceled due to low memory
conditions and the resource manager critical heap percentage has been set</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/persistence/PartitionOfflineException.html" title="class in org.apache.geode.cache.persistence">PartitionOfflineException</a></code> - If persistent data recovery is not complete for a partitioned
region referred to in the query.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>GemFire 6.2.2</dd>
</dl>
</li>
</ul>
<a name="execute-org.apache.geode.cache.execute.RegionFunctionContext-java.lang.Object:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>execute</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;execute(<a href="../../../../../org/apache/geode/cache/execute/RegionFunctionContext.html" title="interface in org.apache.geode.cache.execute">RegionFunctionContext</a>&nbsp;context,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>[]&nbsp;params)
throws <a href="../../../../../org/apache/geode/cache/query/FunctionDomainException.html" title="class in org.apache.geode.cache.query">FunctionDomainException</a>,
<a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a>,
<a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a>,
<a href="../../../../../org/apache/geode/cache/query/QueryInvocationTargetException.html" title="class in org.apache.geode.cache.query">QueryInvocationTargetException</a></pre>
<div class="block">Executes this query on the partitioned data-store associated with the given
RegionFunctionContext and parameters and returns an object that represents its result. An
Exception is thrown if data moving across nodes (Like, partitioned data-store rebalancing)
coincides with data to be queried.
The RegionFunctionContext defines the execution context of a data dependent <a href="../../../../../org/apache/geode/cache/execute/Function.html" title="interface in org.apache.geode.cache.execute"><code>Function</code></a>.
And is obtained when the function is executed using <a href="../../../../../org/apache/geode/cache/execute/FunctionService.html#onRegion-org.apache.geode.cache.Region-"><code>FunctionService.onRegion(Region)</code></a>,
the <a href="../../../../../org/apache/geode/cache/execute/Function.html#execute-org.apache.geode.cache.execute.FunctionContext-"><code>FunctionContext</code></a>
E.g.: // Function service execute() method:
public void execute(FunctionContext context) { RegionFunctionContext regionContext =
(RegionFunctionContext)context; Query query = cache.getQueryService().newQuery("Select * from
/MyRegion"); SelectResults results = (SelectResults)query.execute(regionContext); }
Using this method a join query query can be executed between two co-located PartitionRegion
data-set referenced through <a href="../../../../../org/apache/geode/cache/execute/RegionFunctionContext.html" title="interface in org.apache.geode.cache.execute"><code>RegionFunctionContext</code></a>.
This method should NOT be used for multiple partitioned regions based join queries. We support
equi-join queries only on co-located PartitionedRegions if the the co-located columns ACTUALLY
EXIST IN WHERE CLAUSE and in case of multi-column partitioning , should have "AND" clause.
E.g.: // Equi-join query:
Select * from /partitionRegion1 p1, /PartitionRegion2 p2 where p1.field = p2.field [AND .....]</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>context</code> - RegionFunctionContext which will target the query on subset of data if executed
on PartitionedRegion.</dd>
<dd><code>params</code> - Values that are bound to parameters (such as <code>$1</code>) in this query.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The object that represents the result of the query. Note that if a query is just a
select statement then it will return a result that is an instance of
<a href="../../../../../org/apache/geode/cache/query/SelectResults.html" title="interface in org.apache.geode.cache.query"><code>SelectResults</code></a>. However, since a query is not necessarily just a select
statement, the return type of this method is <code>Object</code>. For example, the
query <code><b>(select distinct * from /rgn).size</b></code> returns an instance of
<code>java.lang.Integer</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/geode/cache/query/FunctionDomainException.html" title="class in org.apache.geode.cache.query">FunctionDomainException</a></code> - A function was applied to a parameter that is improper for that
function. For example, the ELEMENT function was applied to a collection of more than
one element</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a></code> - If a bound parameter is not of the expected type.</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a></code> - If a name in the query cannot be resolved.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - The number of bound parameters does not match the number of
place holders</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - If the query is not permitted on this type of region</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryExecutionTimeoutException.html" title="class in org.apache.geode.cache.query">QueryExecutionTimeoutException</a></code> - If the query gets canceled due to setting system
variable "gemfire.Cache.MAX_QUERY_EXECUTION_TIME". This is a thrown when query is
executed on the local regions (embedded mode).</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryInvocationTargetException.html" title="class in org.apache.geode.cache.query">QueryInvocationTargetException</a></code> - If the data referenced in from clause is not available
for querying.</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/QueryExecutionLowMemoryException.html" title="class in org.apache.geode.cache.query">QueryExecutionLowMemoryException</a></code> - If the query gets canceled due to low memory
conditions and the resource manager critical heap percentage has been set</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/persistence/PartitionOfflineException.html" title="class in org.apache.geode.cache.persistence">PartitionOfflineException</a></code> - If persistent data recovery is not complete for a partitioned
region referred to in the query.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>GemFire 6.2.2</dd>
</dl>
</li>
</ul>
<a name="compile--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compile</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
void&nbsp;compile()
throws <a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a>,
<a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a></pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">as of 6.5</span></div>
<div class="block">Compiles this <code>Query</code> to achieve higher performance execution.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/geode/cache/query/TypeMismatchException.html" title="class in org.apache.geode.cache.query">TypeMismatchException</a></code> - If the compile-time type of a name, parameter, or expression is
not the expected type</dd>
<dd><code><a href="../../../../../org/apache/geode/cache/query/NameResolutionException.html" title="class in org.apache.geode.cache.query">NameResolutionException</a></code> - If a name in the query cannot be resolved.</dd>
</dl>
</li>
</ul>
<a name="isCompiled--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isCompiled</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
boolean&nbsp;isCompiled()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">as of 6.5</span></div>
<div class="block">Return whether this query has been compiled into VM bytecodes.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if this query has been compiled into bytecodes</dd>
</dl>
</li>
</ul>
<a name="getStatistics--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getStatistics</h4>
<pre><a href="../../../../../org/apache/geode/cache/query/QueryStatistics.html" title="interface in org.apache.geode.cache.query">QueryStatistics</a>&nbsp;getStatistics()</pre>
<div class="block">Get statistics information for this query.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>statistics information for this query</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/geode/cache/query/ParameterCountInvalidException.html" title="class in org.apache.geode.cache.query"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/geode/cache/query/QueryException.html" title="class in org.apache.geode.cache.query"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/geode/cache/query/Query.html" target="_top">Frames</a></li>
<li><a href="Query.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>