Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PlannerTest.java
Go to the documentation of this file.
1 // Copyright (c) 2015 Cloudera, Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 package com.cloudera.impala.planner;
16 
17 import org.junit.Test;
18 
19 import com.cloudera.impala.thrift.TQueryOptions;
20 
21 // All planner tests, except for S3 specific tests should go here.
22 public class PlannerTest extends PlannerTestBase {
23 
24  @Test
25  public void testPredicatePropagation() {
26  runPlannerTestFile("predicate-propagation");
27  }
28 
29  @Test
30  public void testConstant() {
31  runPlannerTestFile("constant");
32  }
33 
34  @Test
35  public void testEmpty() {
36  runPlannerTestFile("empty");
37  }
38 
39  @Test
40  public void testDistinct() {
41  runPlannerTestFile("distinct");
42  }
43 
44  @Test
45  public void testAggregation() {
46  runPlannerTestFile("aggregation");
47  }
48 
49  @Test
50  public void testAnalyticFns() {
51  runPlannerTestFile("analytic-fns");
52  }
53 
54  @Test
55  public void testHbase() {
56  runPlannerTestFile("hbase");
57  }
58 
59  @Test
60  public void testInsert() {
61  runPlannerTestFile("insert");
62  }
63 
64  @Test
65  public void testHdfs() {
66  runPlannerTestFile("hdfs");
67  }
68 
69  @Test
70  public void testNestedCollections() {
71  runPlannerTestFile("nested-collections");
72  }
73 
74  @Test
75  public void testJoins() {
76  runPlannerTestFile("joins");
77  }
78 
79  @Test
80  public void testJoinOrder() {
81  runPlannerTestFile("join-order");
82  }
83 
84  @Test
85  public void testOuterJoins() {
86  runPlannerTestFile("outer-joins");
87  }
88 
89  @Test
90  public void testImplicitJoins() {
91  runPlannerTestFile("implicit-joins");
92  }
93 
94  @Test
95  public void testOrder() {
96  runPlannerTestFile("order");
97  }
98 
99  @Test
100  public void testTopN() {
101  runPlannerTestFile("topn");
102  }
103 
104  @Test
105  public void testInlineView() {
106  runPlannerTestFile("inline-view");
107  }
108 
109  @Test
110  public void testInlineViewLimit() {
111  runPlannerTestFile("inline-view-limit");
112  }
113 
114  @Test
115  public void testSubqueryRewrite() {
116  runPlannerTestFile("subquery-rewrite");
117  }
118 
119  @Test
120  public void testUnion() {
121  runPlannerTestFile("union");
122  }
123 
124  @Test
125  public void testValues() {
126  runPlannerTestFile("values");
127  }
128 
129  @Test
130  public void testViews() {
131  runPlannerTestFile("views");
132  }
133 
134  @Test
135  public void testWithClause() {
136  runPlannerTestFile("with-clause");
137  }
138 
139  @Test
140  public void testDistinctEstimate() {
141  runPlannerTestFile("distinct-estimate");
142  }
143 
144  @Test
145  public void testDataSourceTables() {
146  runPlannerTestFile("data-source-tables");
147  }
148 
149  @Test
150  public void testLineage() {
151  runPlannerTestFile("lineage");
152  }
153 
154  @Test
155  public void testDdl() {
156  runPlannerTestFile("ddl");
157  }
158 
159  @Test
160  public void testTpch() {
161  runPlannerTestFile("tpch-all");
162  }
163 
164  @Test
165  public void testTpcds() {
166  // Uses ss_sold_date_sk as the partition key of store_sales to allow static partition
167  // pruning. The original predicates were rephrased in terms of the ss_sold_date_sk
168  // partition key, with the query semantics identical to the original queries.
169  runPlannerTestFile("tpcds-all", "tpcds");
170  }
171 
172  @Test
174  TQueryOptions options = new TQueryOptions();
175  options.setExec_single_node_rows_threshold(8);
176  runPlannerTestFile("small-query-opt", options);
177  }
178 }
void runPlannerTestFile(String testFile, TQueryOptions options)
uint64_t Test(T *ht, const ProbeTuple *input, uint64_t num_tuples)