public class BaseTestQuery extends ExecTest
ClusterTest instead.
But, not marked as deprecated because it is still widely used.| Modifier and Type | Class and Description |
|---|---|
static class |
BaseTestQuery.ClassicTestServices |
static class |
BaseTestQuery.SilentListener |
class |
BaseTestQuery.TestResultSet |
| Modifier and Type | Field and Description |
|---|---|
protected static BufferAllocator |
allocator |
protected static Drillbit[] |
bits |
protected static DrillClient |
client |
protected static DrillConfig |
config |
protected static RemoteServiceSet |
serviceSet |
c, dirTestWatcher, optionManager| Constructor and Description |
|---|
BaseTestQuery() |
| Modifier and Type | Method and Description |
|---|---|
static void |
alterSession(String option,
Object value) |
protected static Properties |
cloneDefaultTestConfigProperties() |
static void |
closeClient() |
protected static void |
errorMsgTestHelper(String testSqlQuery,
String expectedErrorMsg)
Utility method which tests given query produces a
UserException and the exception message contains
the given message. |
protected static BufferAllocator |
getAllocator() |
protected static DrillbitContext |
getDrillbitContext()
Useful for tests that require a DrillbitContext to get/add storage plugins, options etc.
|
static String |
getFile(String resource) |
static String |
getPhysicalFileFromResource(String resource)
Copy the resource (ex.
|
protected static String |
getResultString(List<QueryDataBatch> results,
String delimiter) |
static int |
getUserPort() |
protected int |
logResult(List<QueryDataBatch> results) |
static TestBuilder |
newTest() |
protected static void |
parseErrorHelper(String testSqlQuery)
Utility method which tests given query produces a
UserException
with UserBitShared.DrillPBError.ErrorType being DrillPBError.ErrorType.PARSE
the given message. |
protected int |
printResult(List<QueryDataBatch> results) |
static void |
resetAllSessionOptions() |
static void |
resetDrillbitCount() |
static void |
resetSessionOption(String option) |
protected static void |
runSQL(String sql) |
protected void |
setColumnWidth(int columnWidth) |
protected void |
setColumnWidths(int[] columnWidths) |
protected static void |
setSessionOption(String option,
boolean value) |
protected static void |
setSessionOption(String option,
double value) |
protected static void |
setSessionOption(String option,
long value) |
protected static void |
setSessionOption(String option,
String value) |
static void |
setupDefaultTestCluster() |
static void |
test(String query) |
static void |
test(String query,
Object... args) |
static TestBuilder |
testBuilder() |
protected static List<QueryDataBatch> |
testLogicalWithResults(String logical) |
protected static void |
testNoResult(int interation,
String query,
Object... args) |
static void |
testNoResult(String query,
Object... args) |
protected static int |
testPhysical(String query) |
protected static void |
testPhysicalFromFile(String file) |
protected static List<QueryDataBatch> |
testPhysicalWithResults(String physical) |
static List<QueryDataBatch> |
testPreparedStatement(UserProtos.PreparedStatementHandle handle) |
static int |
testRunAndPrint(UserBitShared.QueryType type,
String query) |
static List<QueryDataBatch> |
testRunAndReturn(UserBitShared.QueryType type,
Object query) |
protected static int |
testSql(String query) |
protected static List<QueryDataBatch> |
testSqlWithResults(String sql) |
protected static void |
testWithListener(UserBitShared.QueryType type,
String query,
UserResultsListener resultListener) |
static void |
updateClient(Properties properties)
Close the current client and open a new client using the given properties.
|
static void |
updateClient(String user) |
static void |
updateClient(String user,
String password) |
protected static void |
updateTestCluster(int newDrillbitCount,
DrillConfig newConfig) |
protected static void |
updateTestCluster(int newDrillbitCount,
DrillConfig newConfig,
Properties properties) |
clear, getLocalFileSystem, mockDrillbitContext, mockUsDateFormatSymbols, mockUtcDateTimeZone, parseExpr, setupOptionManagerprotected static DrillClient client
protected static Drillbit[] bits
protected static RemoteServiceSet serviceSet
protected static DrillConfig config
protected static BufferAllocator allocator
public static void setupDefaultTestCluster()
throws Exception
Exceptionprotected static void updateTestCluster(int newDrillbitCount,
DrillConfig newConfig)
protected static void updateTestCluster(int newDrillbitCount,
DrillConfig newConfig,
Properties properties)
protected static DrillbitContext getDrillbitContext()
protected static Properties cloneDefaultTestConfigProperties()
public static void updateClient(Properties properties) throws Exception
properties - Exceptionpublic static void updateClient(String user, String password) throws Exception
Exceptionprotected static BufferAllocator getAllocator()
public static int getUserPort()
public static TestBuilder newTest()
public static TestBuilder testBuilder()
public static void resetDrillbitCount()
protected static List<QueryDataBatch> testSqlWithResults(String sql) throws Exception
Exceptionprotected static List<QueryDataBatch> testLogicalWithResults(String logical) throws Exception
Exceptionprotected static List<QueryDataBatch> testPhysicalWithResults(String physical) throws Exception
Exceptionpublic static List<QueryDataBatch> testRunAndReturn(UserBitShared.QueryType type, Object query) throws Exception
Exceptionpublic static List<QueryDataBatch> testPreparedStatement(UserProtos.PreparedStatementHandle handle) throws Exception
Exceptionpublic static int testRunAndPrint(UserBitShared.QueryType type, String query) throws Exception
Exceptionprotected static void testWithListener(UserBitShared.QueryType type, String query, UserResultsListener resultListener)
public static void testNoResult(String query, Object... args) throws Exception
Exceptionpublic static void resetSessionOption(String option)
public static void resetAllSessionOptions()
protected static void testNoResult(int interation,
String query,
Object... args)
throws Exception
Exceptionprotected static void testPhysicalFromFile(String file) throws Exception
Exceptionprotected static void errorMsgTestHelper(String testSqlQuery, String expectedErrorMsg) throws Exception
UserException and the exception message contains
the given message.testSqlQuery - Test queryexpectedErrorMsg - Expected error message.Exceptionprotected static void parseErrorHelper(String testSqlQuery) throws Exception
UserException
with UserBitShared.DrillPBError.ErrorType being DrillPBError.ErrorType.PARSE
the given message.testSqlQuery - Test queryExceptionpublic static String getFile(String resource) throws IOException
IOExceptionpublic static String getPhysicalFileFromResource(String resource) throws IOException
resource - IOExceptionprotected static void setSessionOption(String option, boolean value)
protected static void setSessionOption(String option, long value)
protected static void setSessionOption(String option, double value)
protected void setColumnWidth(int columnWidth)
protected void setColumnWidths(int[] columnWidths)
protected int logResult(List<QueryDataBatch> results)
protected int printResult(List<QueryDataBatch> results) throws SchemaChangeException
SchemaChangeExceptionprotected static String getResultString(List<QueryDataBatch> results, String delimiter) throws SchemaChangeException
SchemaChangeExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.