blob: b682f4b055acb99de879ae5e02197e002576bd29 [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 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>QueryTestUtil (Drill : 1.20.0 API)</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="QueryTestUtil (Drill : 1.20.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete 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="class-use/QueryTestUtil.html">Use</a></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/drill/test/QueryRowSetReader.html" title="class in org.apache.drill.test"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/drill/test/RestClientFixture.html" title="class in org.apache.drill.test"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/drill/test/QueryTestUtil.html" target="_top">Frames</a></li>
<li><a href="QueryTestUtil.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.drill.test</div>
<h2 title="Class QueryTestUtil" class="title">Class QueryTestUtil</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.drill.test.QueryTestUtil</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">QueryTestUtil</span>
extends <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></pre>
<div class="block">Utilities useful for tests that issue SQL queries.</div>
</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete 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>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#ConvertDateToLong-java.lang.String-">ConvertDateToLong</a></span>(<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;dateString)</code>
<div class="block">When writing Drill unit tests, Drill will output strings for dates.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#createClient-org.apache.drill.common.config.DrillConfig-org.apache.drill.exec.server.RemoteServiceSet-int-java.util.Properties-">createClient</a></span>(<a href="../../../../org/apache/drill/common/config/DrillConfig.html" title="class in org.apache.drill.common.config">DrillConfig</a>&nbsp;drillConfig,
<a href="../../../../org/apache/drill/exec/server/RemoteServiceSet.html" title="class in org.apache.drill.exec.server">RemoteServiceSet</a>&nbsp;remoteServiceSet,
int&nbsp;maxWidth,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a>&nbsp;props)</code>
<div class="block">Create a DrillClient that can be used to query a drill cluster.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#generateCompressedFile-java.lang.String-java.lang.String-java.lang.String-">generateCompressedFile</a></span>(<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;fileName,
<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;codecName,
<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;outFileName)</code>
<div class="block">Generates a compressed version of the file for testing</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#getFreePortNumber-int-int-">getFreePortNumber</a></span>(int&nbsp;portNumber,
int&nbsp;numberOfAttempts)</code>
<div class="block">Checks that port with specified number is free and returns it.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static <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/drill/test/QueryTestUtil.html#normalizeQuery-java.lang.String-">normalizeQuery</a></span>(<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;query)</code>
<div class="block">Normalize the query relative to the test environment.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#restoreScalarReplacementOption-org.apache.drill.exec.server.Drillbit-java.lang.String-">restoreScalarReplacementOption</a></span>(<a href="../../../../org/apache/drill/exec/server/Drillbit.html" title="class in org.apache.drill.exec.server">Drillbit</a>&nbsp;drillbit,
<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;srOption)</code>
<div class="block">Restore the original scalar replacement option returned from
setupScalarReplacementOption().</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/drill/exec/server/options/OptionValue.html" title="class in org.apache.drill.exec.server.options">OptionValue</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#setupScalarReplacementOption-org.apache.drill.exec.server.Drillbit-org.apache.drill.exec.compile.ClassTransformer.ScalarReplacementOption-">setupScalarReplacementOption</a></span>(<a href="../../../../org/apache/drill/exec/server/Drillbit.html" title="class in org.apache.drill.exec.server">Drillbit</a>&nbsp;drillbit,
<a href="../../../../org/apache/drill/exec/compile/ClassTransformer.ScalarReplacementOption.html" title="enum in org.apache.drill.exec.compile">ClassTransformer.ScalarReplacementOption</a>&nbsp;srOption)</code>
<div class="block">Set up the options to test the scalar replacement retry option (see
ClassTransformer.java).</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#testRunAndLog-org.apache.drill.exec.client.DrillClient-java.lang.String-">testRunAndLog</a></span>(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;queryString)</code>
<div class="block">Execute one or more queries separated by semicolons, and log the results.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#testRunAndLog-org.apache.drill.exec.client.DrillClient-java.lang.String-java.lang.Object...-">testRunAndLog</a></span>(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;query,
<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;args)</code>
<div class="block">Execute one or more queries separated by semicolons, and log the results, with the option to
add formatted arguments to the query string.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#testRunAndLog-org.apache.drill.exec.client.DrillClient-org.apache.drill.exec.proto.UserBitShared.QueryType-java.lang.String-">testRunAndLog</a></span>(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<a href="../../../../org/apache/drill/exec/proto/UserBitShared.QueryType.html" title="enum in org.apache.drill.exec.proto">UserBitShared.QueryType</a>&nbsp;type,
<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;queryString)</code>
<div class="block">Execute a SQL query, and log the results.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#testRunAndOutput-org.apache.drill.exec.client.DrillClient-java.lang.String-boolean-">testRunAndOutput</a></span>(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;queryString,
boolean&nbsp;print)</code>
<div class="block">Execute one or more queries separated by semicolons, and output the results.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#testRunAndPrint-org.apache.drill.exec.client.DrillClient-java.lang.String-">testRunAndPrint</a></span>(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;queryString)</code>
<div class="block">Execute one or more queries separated by semicolons, and print the results.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#testRunAndPrint-org.apache.drill.exec.client.DrillClient-java.lang.String-java.lang.Object...-">testRunAndPrint</a></span>(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;query,
<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;args)</code>
<div class="block">Execute one or more queries separated by semicolons, and print the results, with the option to
add formatted arguments to the query string.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#testRunAndPrint-org.apache.drill.exec.client.DrillClient-org.apache.drill.exec.proto.UserBitShared.QueryType-java.lang.String-">testRunAndPrint</a></span>(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<a href="../../../../org/apache/drill/exec/proto/UserBitShared.QueryType.html" title="enum in org.apache.drill.exec.proto">UserBitShared.QueryType</a>&nbsp;type,
<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;queryString)</code>
<div class="block">Execute a SQL query, and print the results.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/drill/test/QueryTestUtil.html#testWithListener-org.apache.drill.exec.client.DrillClient-org.apache.drill.exec.proto.UserBitShared.QueryType-java.lang.String-org.apache.drill.exec.rpc.user.UserResultsListener-">testWithListener</a></span>(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<a href="../../../../org/apache/drill/exec/proto/UserBitShared.QueryType.html" title="enum in org.apache.drill.exec.proto">UserBitShared.QueryType</a>&nbsp;type,
<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;queryString,
<a href="../../../../org/apache/drill/exec/rpc/user/UserResultsListener.html" title="interface in org.apache.drill.exec.rpc.user">UserResultsListener</a>&nbsp;resultListener)</code>
<div class="block">Execute a single query with a user supplied result listener.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<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></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</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="createClient-org.apache.drill.common.config.DrillConfig-org.apache.drill.exec.server.RemoteServiceSet-int-java.util.Properties-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createClient</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;createClient(<a href="../../../../org/apache/drill/common/config/DrillConfig.html" title="class in org.apache.drill.common.config">DrillConfig</a>&nbsp;drillConfig,
<a href="../../../../org/apache/drill/exec/server/RemoteServiceSet.html" title="class in org.apache.drill.exec.server">RemoteServiceSet</a>&nbsp;remoteServiceSet,
int&nbsp;maxWidth,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</a>&nbsp;props)
throws <a href="../../../../org/apache/drill/exec/rpc/RpcException.html" title="class in org.apache.drill.exec.rpc">RpcException</a>,
<a href="../../../../org/apache/drill/exec/exception/OutOfMemoryException.html" title="class in org.apache.drill.exec.exception">OutOfMemoryException</a></pre>
<div class="block">Create a DrillClient that can be used to query a drill cluster.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillConfig</code> - </dd>
<dd><code>remoteServiceSet</code> - remote service set</dd>
<dd><code>maxWidth</code> - maximum width per node</dd>
<dd><code>props</code> - Connection properties contains properties such as "user", "password", "schema" etc</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created client</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/drill/exec/rpc/RpcException.html" title="class in org.apache.drill.exec.rpc">RpcException</a></code> - if there is a problem setting up the client</dd>
<dd><code><a href="../../../../org/apache/drill/exec/exception/OutOfMemoryException.html" title="class in org.apache.drill.exec.exception">OutOfMemoryException</a></code></dd>
</dl>
</li>
</ul>
<a name="normalizeQuery-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normalizeQuery</h4>
<pre>public static&nbsp;<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;normalizeQuery(<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;query)</pre>
<div class="block">Normalize the query relative to the test environment.
<p>Looks for "${WORKING_PATH}" in the query string, and replaces it the current
working patch obtained from <a href="../../../../org/apache/drill/test/TestTools.html#WORKING_PATH"><code>TestTools.WORKING_PATH</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>query</code> - the query string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the normalized query string</dd>
</dl>
</li>
</ul>
<a name="testRunAndOutput-org.apache.drill.exec.client.DrillClient-java.lang.String-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testRunAndOutput</h4>
<pre>public static&nbsp;void&nbsp;testRunAndOutput(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;queryString,
boolean&nbsp;print)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Execute one or more queries separated by semicolons, and output the results.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillClient</code> - drill client to use</dd>
<dd><code>queryString</code> - the query string</dd>
<dd><code>print</code> - True to output results to stdout. False to log results.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - An error while running the query.</dd>
</dl>
</li>
</ul>
<a name="testRunAndLog-org.apache.drill.exec.client.DrillClient-org.apache.drill.exec.proto.UserBitShared.QueryType-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testRunAndLog</h4>
<pre>public static&nbsp;int&nbsp;testRunAndLog(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<a href="../../../../org/apache/drill/exec/proto/UserBitShared.QueryType.html" title="enum in org.apache.drill.exec.proto">UserBitShared.QueryType</a>&nbsp;type,
<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;queryString)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Execute a SQL query, and log the results.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillClient</code> - drill client to use</dd>
<dd><code>type</code> - type of the query</dd>
<dd><code>queryString</code> - query string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>number of rows returned</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - An error while running the query.</dd>
</dl>
</li>
</ul>
<a name="testRunAndLog-org.apache.drill.exec.client.DrillClient-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testRunAndLog</h4>
<pre>public static&nbsp;void&nbsp;testRunAndLog(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;queryString)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Execute one or more queries separated by semicolons, and log the results.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillClient</code> - drill client to use</dd>
<dd><code>queryString</code> - the query string</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - An error while running the queries.</dd>
</dl>
</li>
</ul>
<a name="testRunAndLog-org.apache.drill.exec.client.DrillClient-java.lang.String-java.lang.Object...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testRunAndLog</h4>
<pre>public static&nbsp;void&nbsp;testRunAndLog(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;query,
<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;args)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Execute one or more queries separated by semicolons, and log the results, with the option to
add formatted arguments to the query string.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillClient</code> - drill client to use</dd>
<dd><code>query</code> - the query string; may contain formatting specifications to be used by
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#format-java.lang.String-java.lang.Object...-" title="class or interface in java.lang"><code>String.format(String, Object...)</code></a>.</dd>
<dd><code>args</code> - optional args to use in the formatting call for the query string</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - An error while running the query.</dd>
</dl>
</li>
</ul>
<a name="testRunAndPrint-org.apache.drill.exec.client.DrillClient-org.apache.drill.exec.proto.UserBitShared.QueryType-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testRunAndPrint</h4>
<pre>public static&nbsp;int&nbsp;testRunAndPrint(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<a href="../../../../org/apache/drill/exec/proto/UserBitShared.QueryType.html" title="enum in org.apache.drill.exec.proto">UserBitShared.QueryType</a>&nbsp;type,
<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;queryString)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Execute a SQL query, and print the results.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillClient</code> - drill client to use</dd>
<dd><code>type</code> - type of the query</dd>
<dd><code>queryString</code> - query string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>number of rows returned</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - An error while running the query.</dd>
</dl>
</li>
</ul>
<a name="testRunAndPrint-org.apache.drill.exec.client.DrillClient-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testRunAndPrint</h4>
<pre>public static&nbsp;void&nbsp;testRunAndPrint(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;queryString)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Execute one or more queries separated by semicolons, and print the results.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillClient</code> - drill client to use</dd>
<dd><code>queryString</code> - the query string</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - An error while running the queries.</dd>
</dl>
</li>
</ul>
<a name="testRunAndPrint-org.apache.drill.exec.client.DrillClient-java.lang.String-java.lang.Object...-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testRunAndPrint</h4>
<pre>public static&nbsp;void&nbsp;testRunAndPrint(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<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;query,
<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;args)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">Execute one or more queries separated by semicolons, and print the results, with the option to
add formatted arguments to the query string.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillClient</code> - drill client to use</dd>
<dd><code>query</code> - the query string; may contain formatting specifications to be used by
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#format-java.lang.String-java.lang.Object...-" title="class or interface in java.lang"><code>String.format(String, Object...)</code></a>.</dd>
<dd><code>args</code> - optional args to use in the formatting call for the query string</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code> - An error while running the query.</dd>
</dl>
</li>
</ul>
<a name="testWithListener-org.apache.drill.exec.client.DrillClient-org.apache.drill.exec.proto.UserBitShared.QueryType-java.lang.String-org.apache.drill.exec.rpc.user.UserResultsListener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testWithListener</h4>
<pre>public static&nbsp;void&nbsp;testWithListener(<a href="../../../../org/apache/drill/exec/client/DrillClient.html" title="class in org.apache.drill.exec.client">DrillClient</a>&nbsp;drillClient,
<a href="../../../../org/apache/drill/exec/proto/UserBitShared.QueryType.html" title="enum in org.apache.drill.exec.proto">UserBitShared.QueryType</a>&nbsp;type,
<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;queryString,
<a href="../../../../org/apache/drill/exec/rpc/user/UserResultsListener.html" title="interface in org.apache.drill.exec.rpc.user">UserResultsListener</a>&nbsp;resultListener)</pre>
<div class="block">Execute a single query with a user supplied result listener.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillClient</code> - drill client to use</dd>
<dd><code>type</code> - type of query</dd>
<dd><code>queryString</code> - the query string</dd>
<dd><code>resultListener</code> - the result listener</dd>
</dl>
</li>
</ul>
<a name="setupScalarReplacementOption-org.apache.drill.exec.server.Drillbit-org.apache.drill.exec.compile.ClassTransformer.ScalarReplacementOption-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setupScalarReplacementOption</h4>
<pre>public static&nbsp;<a href="../../../../org/apache/drill/exec/server/options/OptionValue.html" title="class in org.apache.drill.exec.server.options">OptionValue</a>&nbsp;setupScalarReplacementOption(<a href="../../../../org/apache/drill/exec/server/Drillbit.html" title="class in org.apache.drill.exec.server">Drillbit</a>&nbsp;drillbit,
<a href="../../../../org/apache/drill/exec/compile/ClassTransformer.ScalarReplacementOption.html" title="enum in org.apache.drill.exec.compile">ClassTransformer.ScalarReplacementOption</a>&nbsp;srOption)</pre>
<div class="block">Set up the options to test the scalar replacement retry option (see
ClassTransformer.java). Scalar replacement rewrites bytecode to replace
value holders (essentially boxed values) with their member variables as
locals. There is still one pattern that doesn't work, and occasionally new
ones are introduced. This can be used in tests that exercise failing patterns.
<p>This also flushes the compiled code cache.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillbit</code> - the drillbit</dd>
<dd><code>srOption</code> - the scalar replacement option value to use</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the original scalar replacement option setting (so it can be restored)</dd>
</dl>
</li>
</ul>
<a name="restoreScalarReplacementOption-org.apache.drill.exec.server.Drillbit-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>restoreScalarReplacementOption</h4>
<pre>public static&nbsp;void&nbsp;restoreScalarReplacementOption(<a href="../../../../org/apache/drill/exec/server/Drillbit.html" title="class in org.apache.drill.exec.server">Drillbit</a>&nbsp;drillbit,
<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;srOption)</pre>
<div class="block">Restore the original scalar replacement option returned from
setupScalarReplacementOption().
<p>This also flushes the compiled code cache.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>drillbit</code> - the drillbit</dd>
<dd><code>srOption</code> - the scalar replacement option value to use</dd>
</dl>
</li>
</ul>
<a name="getFreePortNumber-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFreePortNumber</h4>
<pre>public static&nbsp;int&nbsp;getFreePortNumber(int&nbsp;portNumber,
int&nbsp;numberOfAttempts)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Checks that port with specified number is free and returns it.
Otherwise, increases port number and checks until free port is found
or the number of attempts is reached specified numberOfAttempts</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>portNumber</code> - initial port number</dd>
<dd><code>numberOfAttempts</code> - max number of attempts to find port with greater number</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>free port number</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/net/BindException.html?is-external=true" title="class or interface in java.net">BindException</a></code> - if free port was not found and all attempts were used.</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
</dl>
</li>
</ul>
<a name="generateCompressedFile-java.lang.String-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>generateCompressedFile</h4>
<pre>public static&nbsp;void&nbsp;generateCompressedFile(<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;fileName,
<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;codecName,
<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;outFileName)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Generates a compressed version of the file for testing</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fileName</code> - Name of the input file</dd>
<dd><code>codecName</code> - The desired CODEC to be used.</dd>
<dd><code>outFileName</code> - Name of generated compressed file</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If function cannot generate file, throws IOException</dd>
</dl>
</li>
</ul>
<a name="ConvertDateToLong-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ConvertDateToLong</h4>
<pre>public static&nbsp;long&nbsp;ConvertDateToLong(<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;dateString)</pre>
<div class="block">When writing Drill unit tests, Drill will output strings for dates. However,
these strings must be converted into timestamps (long) for use in unit tests. This method
provides a convenient way to do so.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dateString</code> - An input date string from Drill output</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The datestring in epoch/millis.</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="class-use/QueryTestUtil.html">Use</a></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/drill/test/QueryRowSetReader.html" title="class in org.apache.drill.test"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/drill/test/RestClientFixture.html" title="class in org.apache.drill.test"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/drill/test/QueryTestUtil.html" target="_top">Frames</a></li>
<li><a href="QueryTestUtil.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 ======= -->
<p class="legalCopy"><small>Copyright &#169; 2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>