Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Static Public Member Functions | |
static void | setUp () throws Exception |
static void | cleanUp () |
Protected Member Functions | |
Path | cleanseFilePath (Path path) |
void | runPlannerTestFile (String testFile, TQueryOptions options) |
void | runPlannerTestFile (String testFile) |
void | runPlannerTestFile (String testFile, String dbName) |
Private Member Functions | |
void | buildMaps (TQueryExecRequest execRequest) |
THdfsPartition | findPartition (int nodeId, THdfsFileSplit split) |
void | testHdfsPartitionsReferenced (TQueryExecRequest execRequest, String query, StringBuilder errorLog) |
StringBuilder | PrintScanRangeLocations (TQueryExecRequest execRequest) |
String | getExpectedErrorMessage (ArrayList< String > expectedPlan) |
void | handleNotImplException (String query, String expectedErrorMsg, StringBuilder errorLog, StringBuilder actualOutput, Throwable e) |
TQueryOptions | mergeQueryOptions (TQueryOptions a, TQueryOptions b) |
TQueryOptions | defaultQueryOptions () |
void | RunTestCase (TestCase testCase, StringBuilder errorLog, StringBuilder actualOutput, String dbName, TQueryOptions options) throws CatalogException |
void | testSingleNodePlan (TestCase testCase, TQueryCtx queryCtx, StringBuilder errorLog, StringBuilder actualOutput) throws CatalogException |
void | testColumnLineageOutput (TestCase testCase, TQueryCtx queryCtx, StringBuilder errorLog, StringBuilder actualOutput) throws CatalogException |
void | testDistributedPlan (TestCase testCase, TQueryCtx queryCtx, StringBuilder errorLog, StringBuilder actualOutput) throws CatalogException |
String | removeExplainHeader (String explain) |
void | runPlannerTestFile (String testFile, String dbName, TQueryOptions options) |
Private Attributes | |
final String | testDir_ = "functional-planner/queries/PlannerTest" |
final String | outDir_ = "/tmp/PlannerTest/" |
final Map< Integer, TPlanNode > | planMap_ = Maps.newHashMap() |
final Map< Integer, TTupleDescriptor > | tupleMap_ = Maps.newHashMap() |
final Map< Integer, TTableDescriptor > | tableMap_ = Maps.newHashMap() |
Static Private Attributes | |
static final Logger | LOG = LoggerFactory.getLogger(PlannerTest.class) |
static final boolean | GENERATE_OUTPUT_FILE = true |
static Frontend | frontend_ |
Definition at line 75 of file PlannerTestBase.java.
|
inlineprivate |
Clears the old maps and constructs new maps based on the new execRequest so that findPartitions() can locate various thrift metadata structures quickly.
Definition at line 108 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.testSingleNodePlan().
|
inlineprotected |
Normalize components of the given file path, removing any environment- or test-run dependent components. For example, substitutes the unique id portion of Impala generated file names with a fixed literal. Subclasses should override to do filesystem specific cleansing.
Definition at line 264 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.PrintScanRangeLocations().
|
inlinestatic |
Definition at line 99 of file PlannerTestBase.java.
|
inlineprivate |
Definition at line 322 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.RunTestCase().
|
inlineprivate |
Look up the partition corresponding to the plan node (identified by nodeId) and a file split.
Definition at line 135 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.PrintScanRangeLocations(), and com.cloudera.impala.planner.PlannerTestBase.testHdfsPartitionsReferenced().
|
inlineprivate |
Extracts and returns the expected error message from expectedPlan. Returns null if expectedPlan is empty or its first element is not an error message. The accepted format for error messages is 'not implemented: expected error message' Returns the empty string if expectedPlan starts with 'not implemented' but no expected error message was given.
Definition at line 279 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.testDistributedPlan(), and com.cloudera.impala.planner.PlannerTestBase.testSingleNodePlan().
|
inlineprivate |
|
inlineprivate |
Merge the options of b into a and return a
Definition at line 313 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.RunTestCase().
|
inlineprivate |
Construct a string representation of the scan ranges for this request.
Definition at line 211 of file PlannerTestBase.java.
References com.cloudera.impala.planner.PlannerTestBase.cleanseFilePath(), and com.cloudera.impala.planner.PlannerTestBase.findPartition().
Referenced by com.cloudera.impala.planner.PlannerTestBase.testSingleNodePlan().
|
inlineprivate |
Strips out the header containing resource estimates and the warning about missing stats from the given explain plan, because the estimates can change easily with stats/cardinality.
Definition at line 594 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.testDistributedPlan(), and com.cloudera.impala.planner.PlannerTestBase.testSingleNodePlan().
|
inlineprotected |
Definition at line 606 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.runPlannerTestFile(), com.cloudera.impala.planner.PlannerTest.testAggregation(), com.cloudera.impala.planner.PlannerTest.testAnalyticFns(), com.cloudera.impala.planner.PlannerTest.testConstant(), com.cloudera.impala.planner.PlannerTest.testDataSourceTables(), com.cloudera.impala.planner.PlannerTest.testDdl(), com.cloudera.impala.planner.PlannerTest.testDistinct(), com.cloudera.impala.planner.PlannerTest.testDistinctEstimate(), com.cloudera.impala.planner.PlannerTest.testEmpty(), com.cloudera.impala.planner.PlannerTest.testHbase(), com.cloudera.impala.planner.PlannerTest.testHdfs(), com.cloudera.impala.planner.PlannerTest.testImplicitJoins(), com.cloudera.impala.planner.PlannerTest.testInlineView(), com.cloudera.impala.planner.PlannerTest.testInlineViewLimit(), com.cloudera.impala.planner.PlannerTest.testInsert(), com.cloudera.impala.planner.PlannerTest.testJoinOrder(), com.cloudera.impala.planner.PlannerTest.testJoins(), com.cloudera.impala.planner.PlannerTest.testLineage(), com.cloudera.impala.planner.PlannerTest.testNestedCollections(), com.cloudera.impala.planner.PlannerTest.testOrder(), com.cloudera.impala.planner.PlannerTest.testOuterJoins(), com.cloudera.impala.planner.PlannerTest.testPredicatePropagation(), com.cloudera.impala.planner.S3PlannerTest.testS3ScanRanges(), com.cloudera.impala.planner.PlannerTest.testSmallQueryOptimization(), com.cloudera.impala.planner.PlannerTest.testSubqueryRewrite(), com.cloudera.impala.planner.PlannerTest.testTopN(), com.cloudera.impala.planner.PlannerTest.testTpcds(), com.cloudera.impala.planner.PlannerTest.testTpch(), com.cloudera.impala.planner.PlannerTest.testUnion(), com.cloudera.impala.planner.PlannerTest.testValues(), com.cloudera.impala.planner.PlannerTest.testViews(), and com.cloudera.impala.planner.PlannerTest.testWithClause().
|
inlineprivate |
Definition at line 610 of file PlannerTestBase.java.
References com.cloudera.impala.planner.PlannerTestBase.GENERATE_OUTPUT_FILE, com.cloudera.impala.testutil.TestFileParser.getTestCases(), com.cloudera.impala.planner.PlannerTestBase.outDir_, com.cloudera.impala.testutil.TestFileParser.Section.QUERY, com.cloudera.impala.planner.PlannerTestBase.RunTestCase(), and com.cloudera.impala.planner.PlannerTestBase.testDir_.
|
inlineprotected |
Definition at line 647 of file PlannerTestBase.java.
References com.cloudera.impala.planner.PlannerTestBase.runPlannerTestFile().
|
inlineprotected |
Definition at line 651 of file PlannerTestBase.java.
References com.cloudera.impala.planner.PlannerTestBase.runPlannerTestFile().
|
inlineprivate |
Produces single-node and distributed plans for testCase and compares plan and scan range results. Appends the actual single-node and distributed plan as well as the printed scan ranges to actualOutput, along with the requisite section header. locations to actualScanRangeLocations; compares both to the appropriate sections of 'testCase'.
Definition at line 338 of file PlannerTestBase.java.
References com.cloudera.impala.planner.PlannerTestBase.defaultQueryOptions(), com.cloudera.impala.planner.PlannerTestBase.mergeQueryOptions(), com.cloudera.impala.planner.PlannerTestBase.testColumnLineageOutput(), com.cloudera.impala.planner.PlannerTestBase.testDistributedPlan(), and com.cloudera.impala.planner.PlannerTestBase.testSingleNodePlan().
Referenced by com.cloudera.impala.planner.PlannerTestBase.runPlannerTestFile().
|
inlinestatic |
Definition at line 91 of file PlannerTestBase.java.
|
inlineprivate |
Definition at line 468 of file PlannerTestBase.java.
References com.cloudera.impala.analysis.ColumnLineageGraph.equals(), com.cloudera.impala.planner.PlannerTestBase.handleNotImplException(), and com.cloudera.impala.testutil.TestFileParser.Section.LINEAGE.
Referenced by com.cloudera.impala.planner.PlannerTestBase.RunTestCase().
|
inlineprivate |
Produces distributed plan for testCase and compares actual plan with expected plan. If testCase contains no expected distributed plan then this function is a no-op.
Definition at line 532 of file PlannerTestBase.java.
References com.cloudera.impala.testutil.TestFileParser.Section.DISTRIBUTEDPLAN, com.cloudera.impala.planner.PlannerTestBase.getExpectedErrorMessage(), com.cloudera.impala.planner.PlannerTestBase.handleNotImplException(), and com.cloudera.impala.planner.PlannerTestBase.removeExplainHeader().
Referenced by com.cloudera.impala.planner.PlannerTestBase.RunTestCase().
|
inlineprivate |
Verify that all THdfsPartitions included in the descriptor table are referenced by at least one scan range or part of an inserted table. PrintScanRangeLocations will implicitly verify the converse (it'll fail if a scan range references a table/partition descriptor that is not present).
Definition at line 161 of file PlannerTestBase.java.
References com.cloudera.impala.planner.PlannerTestBase.findPartition().
Referenced by com.cloudera.impala.planner.PlannerTestBase.testSingleNodePlan().
|
inlineprivate |
Produces single-node plan for testCase and compares actual plan with expected plan, as well as the scan range locations. If testCase contains no expected single-node plan then this function is a no-op.
Definition at line 368 of file PlannerTestBase.java.
References com.cloudera.impala.planner.PlannerTestBase.buildMaps(), com.cloudera.impala.planner.PlannerTestBase.getExpectedErrorMessage(), com.cloudera.impala.planner.PlannerTestBase.handleNotImplException(), com.cloudera.impala.testutil.TestFileParser.Section.PLAN, com.cloudera.impala.planner.PlannerTestBase.PrintScanRangeLocations(), com.cloudera.impala.planner.PlannerTestBase.removeExplainHeader(), com.cloudera.impala.testutil.TestFileParser.Section.SCANRANGELOCATIONS, and com.cloudera.impala.planner.PlannerTestBase.testHdfsPartitionsReferenced().
Referenced by com.cloudera.impala.planner.PlannerTestBase.RunTestCase().
|
staticprivate |
Definition at line 78 of file PlannerTestBase.java.
|
staticprivate |
Definition at line 77 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.runPlannerTestFile().
|
staticprivate |
Definition at line 76 of file PlannerTestBase.java.
|
private |
Definition at line 81 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.runPlannerTestFile().
|
private |
Definition at line 84 of file PlannerTestBase.java.
|
private |
Definition at line 88 of file PlannerTestBase.java.
|
private |
Definition at line 80 of file PlannerTestBase.java.
Referenced by com.cloudera.impala.planner.PlannerTestBase.runPlannerTestFile().
|
private |
Definition at line 86 of file PlannerTestBase.java.