public class TestBaseViewSupport extends BaseTestQuery
BaseTestQuery.ClassicTestServices, BaseTestQuery.SilentListener, BaseTestQuery.TestResultSet
allocator, bits, client, config, serviceSet
c, dirTestWatcher, optionManager
Constructor and Description |
---|
TestBaseViewSupport() |
Modifier and Type | Method and Description |
---|---|
protected static void |
createViewHelper(String viewSchema,
String viewName,
String finalSchema,
String viewFields,
String viewDef)
Create view with given parameters.
|
protected static void |
dropViewHelper(String viewSchema,
String viewName,
String finalSchema)
Drop view with given parameters.
|
protected static void |
dropViewIfExistsHelper(String viewSchema,
String viewName,
String finalSchema,
Boolean ifViewExists)
Drop view if exists with given parameters.
|
protected static String |
generateViewName()
Generate a view name by appending the test class with a increasing counter.
|
protected static void |
queryViewHelper(String query,
String[] baselineColumns,
List<Object[]> baselineValues)
Execute the given query and check against the given baseline.
|
protected static void |
testViewHelper(String finalSchema,
String viewFields,
String viewDef,
String queryOnView,
String[] expectedBaselineColumns,
List<Object[]> expectedBaselineValues)
Tests creating a view with given parameters, query the view and check against the provided baselines and finally
drop the view.
|
alterSession, cloneDefaultTestConfigProperties, closeClient, errorMsgTestHelper, getAllocator, getDrillbitContext, getFile, getPhysicalFileFromResource, getResultString, getUserPort, logResult, newTest, parseErrorHelper, printResult, resetDrillbitCount, resetSessionOption, runSQL, setColumnWidth, setColumnWidths, setSessionOption, setSessionOption, setSessionOption, setSessionOption, setupDefaultTestCluster, test, test, testBuilder, testLogicalWithResults, testNoResult, testNoResult, testPhysical, testPhysicalFromFile, testPhysicalWithResults, testPreparedStatement, testRunAndPrint, testRunAndReturn, testSql, testSqlWithResults, testWithListener, updateClient, updateClient, updateClient, updateTestCluster, updateTestCluster
clear, getLocalFileSystem, getTempDir, mockDrillbitContext, mockUsDateFormatSymbols, mockUtcDateTimeZone, parseExpr, setupOptionManager
protected static void createViewHelper(String viewSchema, String viewName, String finalSchema, String viewFields, String viewDef) throws Exception
viewSchema
- Schema name to prefix when referring to the view.viewName
- Name of the view.finalSchema
- Absolute schema path where the view is created. Pameter viewSchema may refer the schema
with respect the current default schema. Combining viewSchema with default schema
gives the final schema.viewFields
- If the created view needs to specify the fields, otherwise nullviewDef
- Definition of the view.Exception
protected static void dropViewHelper(String viewSchema, String viewName, String finalSchema) throws Exception
viewSchema
- viewName
- finalSchema
- Exception
protected static void dropViewIfExistsHelper(String viewSchema, String viewName, String finalSchema, Boolean ifViewExists) throws Exception
viewSchema
- viewName
- finalSchema
- ifViewExists
- Helps to check query result depending from the existing of the view.Exception
protected static void queryViewHelper(String query, String[] baselineColumns, List<Object[]> baselineValues) throws Exception
query
- baselineColumns
- baselineValues
- Exception
protected static String generateViewName()
protected static void testViewHelper(String finalSchema, String viewFields, String viewDef, String queryOnView, String[] expectedBaselineColumns, List<Object[]> expectedBaselineValues) throws Exception
finalSchema
- Absolute schema path where the view is going to be created.viewFields
- If view has any field listviewDef
- Definition of the view.queryOnView
- Query to run on created view. Refer to test view using "TEST_VIEW_NAME". Similarly schema
using "TEST_SCHEMA".expectedBaselineColumns
- Expected columns from querying the view.expectedBaselineValues
- Expected row values from querying the view.Exception
Copyright © 2018 The Apache Software Foundation. All rights reserved.