Merge lp:~mmcm/akiban-server/operator-pipeline-options into lp:~akiban-technologies/akiban-server/trunk

Proposed by Mike McMahon
Status: Merged
Approved by: Nathan Williams
Approved revision: 2732
Merged at revision: 2694
Proposed branch: lp:~mmcm/akiban-server/operator-pipeline-options
Merge into: lp:~akiban-technologies/akiban-server/trunk
Diff against target: 630 lines (+175/-34)
19 files modified
src/main/java/com/akiban/qp/operator/API.java (+3/-1)
src/main/java/com/akiban/qp/operator/Map_NestedLoops.java (+14/-4)
src/main/java/com/akiban/server/explain/Label.java (+1/-0)
src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java (+1/-0)
src/main/java/com/akiban/sql/optimizer/rule/PipelineConfiguration.java (+67/-0)
src/main/java/com/akiban/sql/optimizer/rule/SchemaRulesContext.java (+11/-0)
src/main/java/com/akiban/sql/server/ServerOperatorCompiler.java (+1/-0)
src/main/java/com/akiban/sql/server/ServerSession.java (+4/-0)
src/main/java/com/akiban/sql/server/ServerSessionBase.java (+10/-0)
src/test/java/com/akiban/server/test/ApiTestBase.java (+4/-0)
src/test/java/com/akiban/server/test/costmodel/MapCT.java (+2/-1)
src/test/java/com/akiban/server/test/it/qp/AncestorLookup_NestedIT.java (+8/-8)
src/test/java/com/akiban/server/test/it/qp/BranchLookup_NestedIT.java (+8/-8)
src/test/java/com/akiban/server/test/it/qp/Map_NestedLoopsIT.java (+10/-10)
src/test/java/com/akiban/server/test/it/qp/Map_NestedLoopsPipelineIT.java (+26/-0)
src/test/java/com/akiban/server/test/it/qp/Sort_InsertionLimitedIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/qp/UnionAll_DefaultIT.java (+1/-1)
src/test/java/com/akiban/sql/optimizer/OperatorCompilerTest.java (+2/-0)
src/test/java/com/akiban/sql/optimizer/rule/RulesTestContext.java (+1/-0)
To merge this branch: bzr merge lp:~mmcm/akiban-server/operator-pipeline-options
Reviewer Review Type Date Requested Status
Nathan Williams Approve
Review via email: mp+174585@code.launchpad.net

Description of the change

Change how operators get pipeline-related options.

Instead of having each operator look into config properties, set them from the optimizer, which in turn gets them all at once from there.

Add an option for Map_NestedLoops to select the previous rebinding implementation. Make this the default, since there are issues with query cancelation with pipelining.

To post a comment you must log in.
Revision history for this message
Nathan Williams (nwilliams) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/main/java/com/akiban/qp/operator/API.java'
--- src/main/java/com/akiban/qp/operator/API.java 2013-07-10 18:42:14 +0000
+++ src/main/java/com/akiban/qp/operator/API.java 2013-07-13 21:55:29 +0000
@@ -497,9 +497,11 @@
497 public static Operator map_NestedLoops(Operator outerInput,497 public static Operator map_NestedLoops(Operator outerInput,
498 Operator innerInput,498 Operator innerInput,
499 int inputBindingPosition,499 int inputBindingPosition,
500 boolean pipeline,
500 int depth)501 int depth)
501 {502 {
502 return new Map_NestedLoops(outerInput, innerInput, inputBindingPosition, depth);503 return new Map_NestedLoops(outerInput, innerInput, inputBindingPosition,
504 pipeline, depth);
503 }505 }
504506
505 // IfEmpty507 // IfEmpty
506508
=== modified file 'src/main/java/com/akiban/qp/operator/Map_NestedLoops.java'
--- src/main/java/com/akiban/qp/operator/Map_NestedLoops.java 2013-07-10 21:30:34 +0000
+++ src/main/java/com/akiban/qp/operator/Map_NestedLoops.java 2013-07-13 21:55:29 +0000
@@ -51,6 +51,8 @@
5151
52 <li><b>int inputBindingPosition:</b> Position of inner loop row in query context.52 <li><b>int inputBindingPosition:</b> Position of inner loop row in query context.
5353
54 <li><b>boolean pipeline:</b> Whether to use bracketing cursors instead of rebinding.
55
54 <li><b>int depth:</b> Number of nested Maps, including this one.56 <li><b>int depth:</b> Number of nested Maps, including this one.
5557
56 </ul>58 </ul>
@@ -90,7 +92,7 @@
90 @Override92 @Override
91 protected Cursor cursor(QueryContext context, QueryBindingsCursor bindingsCursor)93 protected Cursor cursor(QueryContext context, QueryBindingsCursor bindingsCursor)
92 {94 {
93 if (false)95 if (!pipeline)
94 return new Execution(context, bindingsCursor); // Old-style96 return new Execution(context, bindingsCursor); // Old-style
95 else {97 else {
96 Cursor outerCursor = outerInputOperator.cursor(context, bindingsCursor);98 Cursor outerCursor = outerInputOperator.cursor(context, bindingsCursor);
@@ -127,6 +129,7 @@
127 public Map_NestedLoops(Operator outerInputOperator,129 public Map_NestedLoops(Operator outerInputOperator,
128 Operator innerInputOperator,130 Operator innerInputOperator,
129 int inputBindingPosition,131 int inputBindingPosition,
132 boolean pipeline,
130 int depth)133 int depth)
131 {134 {
132 ArgumentValidation.notNull("outerInputOperator", outerInputOperator);135 ArgumentValidation.notNull("outerInputOperator", outerInputOperator);
@@ -136,6 +139,7 @@
136 this.outerInputOperator = outerInputOperator;139 this.outerInputOperator = outerInputOperator;
137 this.innerInputOperator = innerInputOperator;140 this.innerInputOperator = innerInputOperator;
138 this.inputBindingPosition = inputBindingPosition;141 this.inputBindingPosition = inputBindingPosition;
142 this.pipeline = pipeline;
139 this.depth = depth;143 this.depth = depth;
140 }144 }
141145
@@ -150,12 +154,14 @@
150 private final Operator outerInputOperator;154 private final Operator outerInputOperator;
151 private final Operator innerInputOperator;155 private final Operator innerInputOperator;
152 private final int inputBindingPosition, depth;156 private final int inputBindingPosition, depth;
157 private final boolean pipeline;
153158
154 @Override159 @Override
155 public CompoundExplainer getExplainer(ExplainContext context)160 public CompoundExplainer getExplainer(ExplainContext context)
156 {161 {
157 CompoundExplainer ex = new NestedLoopsExplainer(getName(), innerInputOperator, outerInputOperator, null, null, context);162 CompoundExplainer ex = new NestedLoopsExplainer(getName(), innerInputOperator, outerInputOperator, null, null, context);
158 ex.addAttribute(Label.BINDING_POSITION, PrimitiveExplainer.getInstance(inputBindingPosition));163 ex.addAttribute(Label.BINDING_POSITION, PrimitiveExplainer.getInstance(inputBindingPosition));
164 ex.addAttribute(Label.PIPELINE, PrimitiveExplainer.getInstance(pipeline));
159 ex.addAttribute(Label.DEPTH, PrimitiveExplainer.getInstance(depth));165 ex.addAttribute(Label.DEPTH, PrimitiveExplainer.getInstance(depth));
160 if (context.hasExtraInfo(this))166 if (context.hasExtraInfo(this))
161 ex.get().putAll(context.getExtraInfo(this).get());167 ex.get().putAll(context.getExtraInfo(this).get());
@@ -346,9 +352,13 @@
346 pendingBindings = null;352 pendingBindings = null;
347 return bindings;353 return bindings;
348 }354 }
349 bindings = input.nextBindings();355 while (true) {
350 assert ((bindings == null) || (bindings.getDepth() < depth));356 // Skip over any that we would elide.
351 return bindings;357 bindings = input.nextBindings();
358 if ((bindings == null) || (bindings.getDepth() < depth))
359 return bindings;
360 assert (bindings.getDepth() == depth);
361 }
352 }362 }
353363
354 @Override364 @Override
355365
=== modified file 'src/main/java/com/akiban/server/explain/Label.java'
--- src/main/java/com/akiban/server/explain/Label.java 2013-07-10 18:42:14 +0000
+++ src/main/java/com/akiban/server/explain/Label.java 2013-07-13 21:55:29 +0000
@@ -48,6 +48,7 @@
48 INFIX_REPRESENTATION(Category.DESCRIPTION),48 INFIX_REPRESENTATION(Category.DESCRIPTION),
49 ASSOCIATIVE(Category.DESCRIPTION),49 ASSOCIATIVE(Category.DESCRIPTION),
50 INDEX(Category.DESCRIPTION),50 INDEX(Category.DESCRIPTION),
51 PIPELINE(Category.DESCRIPTION),
51 DEPTH(Category.DESCRIPTION),52 DEPTH(Category.DESCRIPTION),
52 53
53 // IDENTIFIER54 // IDENTIFIER
5455
=== modified file 'src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java'
--- src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java 2013-07-10 18:42:14 +0000
+++ src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java 2013-07-13 21:55:29 +0000
@@ -1529,6 +1529,7 @@
1529 stream.operator = API.map_NestedLoops(ostream.operator, 1529 stream.operator = API.map_NestedLoops(ostream.operator,
1530 stream.operator,1530 stream.operator,
1531 currentBindingPosition(),1531 currentBindingPosition(),
1532 rulesContext.getPipelineConfiguration().isMapEnabled(),
1532 nestedBindingsDepth);1533 nestedBindingsDepth);
1533 nestedBindingsDepth--;1534 nestedBindingsDepth--;
1534 popBoundRow();1535 popBoundRow();
15351536
=== added file 'src/main/java/com/akiban/sql/optimizer/rule/PipelineConfiguration.java'
--- src/main/java/com/akiban/sql/optimizer/rule/PipelineConfiguration.java 1970-01-01 00:00:00 +0000
+++ src/main/java/com/akiban/sql/optimizer/rule/PipelineConfiguration.java 2013-07-13 21:55:29 +0000
@@ -0,0 +1,67 @@
1/**
2 * Copyright (C) 2009-2013 Akiban Technologies, Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18package com.akiban.sql.optimizer.rule;
19
20import java.util.Properties;
21
22public class PipelineConfiguration
23{
24 private boolean mapEnabled = false;
25 private int indexScanLookaheadQuantum = 1;
26 private int groupLookupLookaheadQuantum = 1;
27 private boolean unionAllOpenBoth = false;
28
29 public PipelineConfiguration() {
30 }
31
32 public PipelineConfiguration(Properties properties) {
33 load(properties);
34 }
35
36 public boolean isMapEnabled() {
37 return mapEnabled;
38 }
39
40 public int getIndexScanLookaheadQuantum() {
41 return indexScanLookaheadQuantum;
42 }
43
44 public int getGroupLookupLookaheadQuantum() {
45 return groupLookupLookaheadQuantum;
46 }
47
48 public boolean isUnionAllOpenBoth() {
49 return unionAllOpenBoth;
50 }
51
52 public void load(Properties properties) {
53 for (String prop : properties.stringPropertyNames()) {
54 String val = properties.getProperty(prop);
55 if ("map.enabled".equals(prop))
56 mapEnabled = Boolean.parseBoolean(val);
57 else if ("indexScan.lookaheadQuantum".equals(prop))
58 indexScanLookaheadQuantum = Integer.parseInt(val);
59 else if ("groupLookup.lookaheadQuantum".equals(prop))
60 groupLookupLookaheadQuantum = Integer.parseInt(val);
61 else if ("unionAll.openBoth".equals(prop))
62 unionAllOpenBoth = Boolean.parseBoolean(val);
63 else
64 throw new IllegalArgumentException("Unknown property " + prop);
65 }
66 }
67}
068
=== modified file 'src/main/java/com/akiban/sql/optimizer/rule/SchemaRulesContext.java'
--- src/main/java/com/akiban/sql/optimizer/rule/SchemaRulesContext.java 2013-03-22 20:05:57 +0000
+++ src/main/java/com/akiban/sql/optimizer/rule/SchemaRulesContext.java 2013-07-13 21:55:29 +0000
@@ -36,6 +36,8 @@
36 private FunctionsRegistry functionsRegistry;36 private FunctionsRegistry functionsRegistry;
37 private CostEstimator costEstimator;37 private CostEstimator costEstimator;
38 private T3RegistryService t3Registry;38 private T3RegistryService t3Registry;
39 private PipelineConfiguration pipelineConfiguration;
40
39 protected SchemaRulesContext() {41 protected SchemaRulesContext() {
40 }42 }
4143
@@ -55,12 +57,17 @@
55 this.costEstimator = costEstimator;57 this.costEstimator = costEstimator;
56 }58 }
5759
60 protected void initPipelineConfiguration(PipelineConfiguration pipelineConfiguration) {
61 this.pipelineConfiguration = pipelineConfiguration;
62 }
63
58 @Override64 @Override
59 protected void initDone() {65 protected void initDone() {
60 super.initDone();66 super.initDone();
61 assert (schema != null) : "initSchema() not called";67 assert (schema != null) : "initSchema() not called";
62 assert (functionsRegistry != null) : "initFunctionsRegistry() not called";68 assert (functionsRegistry != null) : "initFunctionsRegistry() not called";
63 assert (costEstimator != null) : "initCostEstimator() not called";69 assert (costEstimator != null) : "initCostEstimator() not called";
70 assert (pipelineConfiguration != null) : "initPipelineConfiguration() not called";
64 }71 }
6572
66 public Schema getSchema() {73 public Schema getSchema() {
@@ -89,4 +96,8 @@
8996
90 public abstract String getDefaultSchemaName();97 public abstract String getDefaultSchemaName();
9198
99 public PipelineConfiguration getPipelineConfiguration() {
100 return pipelineConfiguration;
101 }
102
92}103}
93104
=== modified file 'src/main/java/com/akiban/sql/server/ServerOperatorCompiler.java'
--- src/main/java/com/akiban/sql/server/ServerOperatorCompiler.java 2013-06-11 16:30:17 +0000
+++ src/main/java/com/akiban/sql/server/ServerOperatorCompiler.java 2013-07-13 21:55:29 +0000
@@ -36,6 +36,7 @@
36 initParser(server.getParser());36 initParser(server.getParser());
37 initFunctionsRegistry(server.functionsRegistry());37 initFunctionsRegistry(server.functionsRegistry());
38 initCostEstimator(server.costEstimator(this, keyCreator), usePValues);38 initCostEstimator(server.costEstimator(this, keyCreator), usePValues);
39 initPipelineConfiguration(server.getPipelineConfiguration());
39 if (usePValues)40 if (usePValues)
40 initT3Registry(server.t3RegistryService());41 initT3Registry(server.t3RegistryService());
41 42
4243
=== modified file 'src/main/java/com/akiban/sql/server/ServerSession.java'
--- src/main/java/com/akiban/sql/server/ServerSession.java 2013-06-11 16:32:59 +0000
+++ src/main/java/com/akiban/sql/server/ServerSession.java 2013-07-13 21:55:29 +0000
@@ -23,6 +23,7 @@
23import com.akiban.sql.parser.SQLParser;23import com.akiban.sql.parser.SQLParser;
2424
25import com.akiban.sql.optimizer.AISBinderContext;25import com.akiban.sql.optimizer.AISBinderContext;
26import com.akiban.sql.optimizer.rule.PipelineConfiguration;
26import com.akiban.sql.optimizer.rule.cost.CostEstimator;27import com.akiban.sql.optimizer.rule.cost.CostEstimator;
2728
28import com.akiban.ais.model.AkibanInformationSchema;29import com.akiban.ais.model.AkibanInformationSchema;
@@ -165,4 +166,7 @@
165166
166 /** Check access to given schema */167 /** Check access to given schema */
167 public boolean isSchemaAccessible(String schemaName);168 public boolean isSchemaAccessible(String schemaName);
169
170 /** Get the pipeline configuration. */
171 public PipelineConfiguration getPipelineConfiguration();
168}172}
169173
=== modified file 'src/main/java/com/akiban/sql/server/ServerSessionBase.java'
--- src/main/java/com/akiban/sql/server/ServerSessionBase.java 2013-06-12 21:51:17 +0000
+++ src/main/java/com/akiban/sql/server/ServerSessionBase.java 2013-07-13 21:55:29 +0000
@@ -40,6 +40,7 @@
40import com.akiban.server.service.tree.KeyCreator;40import com.akiban.server.service.tree.KeyCreator;
41import com.akiban.server.t3expressions.T3RegistryService;41import com.akiban.server.t3expressions.T3RegistryService;
42import com.akiban.sql.optimizer.AISBinderContext;42import com.akiban.sql.optimizer.AISBinderContext;
43import com.akiban.sql.optimizer.rule.PipelineConfiguration;
43import com.akiban.sql.optimizer.rule.cost.CostEstimator;44import com.akiban.sql.optimizer.rule.cost.CostEstimator;
4445
45import java.util.*;46import java.util.*;
@@ -47,10 +48,12 @@
47public abstract class ServerSessionBase extends AISBinderContext implements ServerSession48public abstract class ServerSessionBase extends AISBinderContext implements ServerSession
48{49{
49 public static final String COMPILER_PROPERTIES_PREFIX = "optimizer.";50 public static final String COMPILER_PROPERTIES_PREFIX = "optimizer.";
51 public static final String PIPELINE_PROPERTIES_PREFIX = "akserver.pipeline.";
5052
51 protected final ServerServiceRequirements reqs;53 protected final ServerServiceRequirements reqs;
52 protected Properties compilerProperties;54 protected Properties compilerProperties;
53 protected Map<String,Object> attributes = new HashMap<>();55 protected Map<String,Object> attributes = new HashMap<>();
56 protected PipelineConfiguration pipelineConfiguration;
54 57
55 protected Session session;58 protected Session session;
56 protected Map<StoreAdapter.AdapterType, StoreAdapter> adapters = 59 protected Map<StoreAdapter.AdapterType, StoreAdapter> adapters =
@@ -401,4 +404,11 @@
401 return reqs.securityService().isAccessible(session, schemaName);404 return reqs.securityService().isAccessible(session, schemaName);
402 }405 }
403406
407 @Override
408 public PipelineConfiguration getPipelineConfiguration() {
409 if (pipelineConfiguration == null)
410 pipelineConfiguration = new PipelineConfiguration(reqs.config().deriveProperties(PIPELINE_PROPERTIES_PREFIX));
411 return pipelineConfiguration;
412 }
413
404}414}
405415
=== modified file 'src/test/java/com/akiban/server/test/ApiTestBase.java'
--- src/test/java/com/akiban/server/test/ApiTestBase.java 2013-07-03 15:32:40 +0000
+++ src/test/java/com/akiban/server/test/ApiTestBase.java 2013-07-13 21:55:29 +0000
@@ -1353,6 +1353,10 @@
1353 return true;1353 return true;
1354 }1354 }
13551355
1356 protected boolean pipelineMap() {
1357 return false;
1358 }
1359
1356 protected DDLFunctions ddlForAlter() {1360 protected DDLFunctions ddlForAlter() {
1357 return ddl();1361 return ddl();
1358 }1362 }
13591363
=== modified file 'src/test/java/com/akiban/server/test/costmodel/MapCT.java'
--- src/test/java/com/akiban/server/test/costmodel/MapCT.java 2013-07-10 18:42:14 +0000
+++ src/test/java/com/akiban/server/test/costmodel/MapCT.java 2013-07-13 21:55:29 +0000
@@ -83,7 +83,8 @@
83 TimeOperator timeSetupOuter = new TimeOperator(setupOuter);83 TimeOperator timeSetupOuter = new TimeOperator(setupOuter);
84 Operator setupInner = limit_Default(groupScan_Default(group), innerRows);84 Operator setupInner = limit_Default(groupScan_Default(group), innerRows);
85 TimeOperator timeSetupInner = new TimeOperator(setupInner);85 TimeOperator timeSetupInner = new TimeOperator(setupInner);
86 Operator plan = map_NestedLoops(timeSetupOuter, timeSetupInner, 0, 1);86 Operator plan = map_NestedLoops(timeSetupOuter, timeSetupInner,
87 0, pipelineMap(), 1);
87 long start = System.nanoTime();88 long start = System.nanoTime();
88 for (int r = 0; r < runs; r++) {89 for (int r = 0; r < runs; r++) {
89 Cursor cursor = cursor(plan, queryContext, queryBindings);90 Cursor cursor = cursor(plan, queryContext, queryBindings);
9091
=== modified file 'src/test/java/com/akiban/server/test/it/qp/AncestorLookup_NestedIT.java'
--- src/test/java/com/akiban/server/test/it/qp/AncestorLookup_NestedIT.java 2013-07-10 21:30:34 +0000
+++ src/test/java/com/akiban/server/test/it/qp/AncestorLookup_NestedIT.java 2013-07-13 21:55:29 +0000
@@ -141,7 +141,7 @@
141 map_NestedLoops(141 map_NestedLoops(
142 indexScan_Default(aValueIndexRowType),142 indexScan_Default(aValueIndexRowType),
143 ancestorLookup_Nested(rabc, aValueIndexRowType, Collections.singleton(aRowType), 0),143 ancestorLookup_Nested(rabc, aValueIndexRowType, Collections.singleton(aRowType), 0),
144 0, 1);144 0, pipelineMap(), 1);
145 Cursor cursor = cursor(plan, queryContext, queryBindings);145 Cursor cursor = cursor(plan, queryContext, queryBindings);
146 RowBase[] expected = new RowBase[]{146 RowBase[] expected = new RowBase[]{
147 row(aRowType, 13L, 1L, "a13"),147 row(aRowType, 13L, 1L, "a13"),
@@ -159,7 +159,7 @@
159 map_NestedLoops(159 map_NestedLoops(
160 indexScan_Default(aValueIndexRowType),160 indexScan_Default(aValueIndexRowType),
161 ancestorLookup_Nested(rabc, aValueIndexRowType, Arrays.asList(aRowType, rRowType), 0),161 ancestorLookup_Nested(rabc, aValueIndexRowType, Arrays.asList(aRowType, rRowType), 0),
162 0, 1);162 0, pipelineMap(), 1);
163 Cursor cursor = cursor(plan, queryContext, queryBindings);163 Cursor cursor = cursor(plan, queryContext, queryBindings);
164 RowBase[] expected = new RowBase[]{164 RowBase[] expected = new RowBase[]{
165 row(rRowType, 1L, "r1"),165 row(rRowType, 1L, "r1"),
@@ -181,7 +181,7 @@
181 map_NestedLoops(181 map_NestedLoops(
182 indexScan_Default(aValueIndexRowType),182 indexScan_Default(aValueIndexRowType),
183 ancestorLookup_Nested(rabc, aValueIndexRowType, Arrays.asList(rRowType, aRowType), 0),183 ancestorLookup_Nested(rabc, aValueIndexRowType, Arrays.asList(rRowType, aRowType), 0),
184 0, 1);184 0, pipelineMap(), 1);
185 Cursor cursor = cursor(plan, queryContext, queryBindings);185 Cursor cursor = cursor(plan, queryContext, queryBindings);
186 RowBase[] expected = new RowBase[]{186 RowBase[] expected = new RowBase[]{
187 row(rRowType, 1L, "r1"),187 row(rRowType, 1L, "r1"),
@@ -204,9 +204,9 @@
204 map_NestedLoops(204 map_NestedLoops(
205 indexScan_Default(aValueIndexRowType),205 indexScan_Default(aValueIndexRowType),
206 ancestorLookup_Nested(rabc, aValueIndexRowType, Arrays.asList(aRowType), 0),206 ancestorLookup_Nested(rabc, aValueIndexRowType, Arrays.asList(aRowType), 0),
207 0, 1),207 0, pipelineMap(), 1),
208 ancestorLookup_Nested(rabc, aRowType, Arrays.asList(rRowType), 1),208 ancestorLookup_Nested(rabc, aRowType, Arrays.asList(rRowType), 1),
209 1, 1);209 1, pipelineMap(), 1);
210 Cursor cursor = cursor(plan, queryContext, queryBindings);210 Cursor cursor = cursor(plan, queryContext, queryBindings);
211 RowBase[] expected = new RowBase[]{211 RowBase[] expected = new RowBase[]{
212 row(rRowType, 1L, "r1"),212 row(rRowType, 1L, "r1"),
@@ -236,7 +236,7 @@
236 map_NestedLoops(236 map_NestedLoops(
237 abIndexScan,237 abIndexScan,
238 ancestorLookup_Nested(rabc, abIndexScan.rowType(), Collections.singleton(rRowType), 0),238 ancestorLookup_Nested(rabc, abIndexScan.rowType(), Collections.singleton(rRowType), 0),
239 0, 1);239 0, pipelineMap(), 1);
240 Cursor cursor = cursor(plan, queryContext, queryBindings);240 Cursor cursor = cursor(plan, queryContext, queryBindings);
241 RowBase[] expected = new RowBase[]{241 RowBase[] expected = new RowBase[]{
242 row(rRowType, 1L, "r1"),242 row(rRowType, 1L, "r1"),
@@ -272,7 +272,7 @@
272 map_NestedLoops(272 map_NestedLoops(
273 abcIndexScan,273 abcIndexScan,
274 ancestorLookup_Nested(rabc, abcIndexScan.rowType(), Collections.singleton(rRowType), 0),274 ancestorLookup_Nested(rabc, abcIndexScan.rowType(), Collections.singleton(rRowType), 0),
275 0, 1);275 0, pipelineMap(), 1);
276 Cursor cursor = cursor(plan, queryContext, queryBindings);276 Cursor cursor = cursor(plan, queryContext, queryBindings);
277 RowBase[] expected = new RowBase[]{277 RowBase[] expected = new RowBase[]{
278 row(rRowType, 1L, "r1"),278 row(rRowType, 1L, "r1"),
@@ -287,7 +287,7 @@
287 map_NestedLoops(287 map_NestedLoops(
288 indexScan_Default(aValueIndexRowType),288 indexScan_Default(aValueIndexRowType),
289 ancestorLookup_Nested(rabc, aValueIndexRowType, Collections.singleton(aRowType), 0),289 ancestorLookup_Nested(rabc, aValueIndexRowType, Collections.singleton(aRowType), 0),
290 0, 1);290 0, pipelineMap(), 1);
291 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()291 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()
292 {292 {
293 @Override293 @Override
294294
=== modified file 'src/test/java/com/akiban/server/test/it/qp/BranchLookup_NestedIT.java'
--- src/test/java/com/akiban/server/test/it/qp/BranchLookup_NestedIT.java 2013-07-10 21:30:34 +0000
+++ src/test/java/com/akiban/server/test/it/qp/BranchLookup_NestedIT.java 2013-07-13 21:55:29 +0000
@@ -154,7 +154,7 @@
154 map_NestedLoops(154 map_NestedLoops(
155 indexScan_Default(aValueIndexRowType),155 indexScan_Default(aValueIndexRowType),
156 branchLookup_Nested(rabc, aValueIndexRowType, rRowType, InputPreservationOption.DISCARD_INPUT, 0),156 branchLookup_Nested(rabc, aValueIndexRowType, rRowType, InputPreservationOption.DISCARD_INPUT, 0),
157 0, 1);157 0, pipelineMap(), 1);
158 Cursor cursor = cursor(plan, queryContext, queryBindings);158 Cursor cursor = cursor(plan, queryContext, queryBindings);
159 RowBase[] expected = new RowBase[]{159 RowBase[] expected = new RowBase[]{
160 // Each r row, and everything below it, is duplicated, because the A index refers to each r value twice.160 // Each r row, and everything below it, is duplicated, because the A index refers to each r value twice.
@@ -202,7 +202,7 @@
202 Collections.singleton(aRowType),202 Collections.singleton(aRowType),
203 InputPreservationOption.DISCARD_INPUT),203 InputPreservationOption.DISCARD_INPUT),
204 branchLookup_Nested(rabc, aRowType, rRowType, InputPreservationOption.DISCARD_INPUT, 0),204 branchLookup_Nested(rabc, aRowType, rRowType, InputPreservationOption.DISCARD_INPUT, 0),
205 0, 1);205 0, pipelineMap(), 1);
206 Cursor cursor = cursor(plan, queryContext, queryBindings);206 Cursor cursor = cursor(plan, queryContext, queryBindings);
207 RowBase[] expected = new RowBase[]{207 RowBase[] expected = new RowBase[]{
208 // Each r row, and everything below it, is duplicated, because the A index refers to each r value twice.208 // Each r row, and everything below it, is duplicated, because the A index refers to each r value twice.
@@ -247,7 +247,7 @@
247 groupScan_Default(rabc),247 groupScan_Default(rabc),
248 Collections.singleton(aRowType)),248 Collections.singleton(aRowType)),
249 branchLookup_Nested(rabc, aRowType, bRowType, InputPreservationOption.DISCARD_INPUT, 0),249 branchLookup_Nested(rabc, aRowType, bRowType, InputPreservationOption.DISCARD_INPUT, 0),
250 0, 1);250 0, pipelineMap(), 1);
251 Cursor cursor = cursor(plan, queryContext, queryBindings);251 Cursor cursor = cursor(plan, queryContext, queryBindings);
252 RowBase[] expected = new RowBase[]{252 RowBase[] expected = new RowBase[]{
253 row(bRowType, 15L, 1L, "b15"),253 row(bRowType, 15L, 1L, "b15"),
@@ -272,9 +272,9 @@
272 groupScan_Default(rabc),272 groupScan_Default(rabc),
273 Collections.singleton(aRowType)),273 Collections.singleton(aRowType)),
274 branchLookup_Nested(rabc, aRowType, bRowType, InputPreservationOption.DISCARD_INPUT, 0),274 branchLookup_Nested(rabc, aRowType, bRowType, InputPreservationOption.DISCARD_INPUT, 0),
275 0, 1),275 0, pipelineMap(), 1),
276 branchLookup_Nested(rabc, bRowType, cRowType, InputPreservationOption.KEEP_INPUT, 1),276 branchLookup_Nested(rabc, bRowType, cRowType, InputPreservationOption.KEEP_INPUT, 1),
277 1, 1);277 1, pipelineMap(), 1);
278 Cursor cursor = cursor(plan, queryContext, queryBindings);278 Cursor cursor = cursor(plan, queryContext, queryBindings);
279 RowBase[] expected = new RowBase[]{279 RowBase[] expected = new RowBase[]{
280 row(bRowType, 15L, 1L, "b15"),280 row(bRowType, 15L, 1L, "b15"),
@@ -324,7 +324,7 @@
324 map_NestedLoops(324 map_NestedLoops(
325 abIndexScan,325 abIndexScan,
326 branchLookup_Nested(rabc, abIndexScan.rowType(), cRowType, InputPreservationOption.DISCARD_INPUT, 0),326 branchLookup_Nested(rabc, abIndexScan.rowType(), cRowType, InputPreservationOption.DISCARD_INPUT, 0),
327 0, 1);327 0, pipelineMap(), 1);
328 Cursor cursor = cursor(plan, queryContext, queryBindings);328 Cursor cursor = cursor(plan, queryContext, queryBindings);
329 RowBase[] expected = new RowBase[]{329 RowBase[] expected = new RowBase[]{
330 row(cRowType, 17L, 1L, "c17"),330 row(cRowType, 17L, 1L, "c17"),
@@ -342,7 +342,7 @@
342 groupScan_Default(rabc),342 groupScan_Default(rabc),
343 Collections.singleton(aRowType)),343 Collections.singleton(aRowType)),
344 branchLookup_Nested(rabc, aRowType, rRowType, aRowType, InputPreservationOption.DISCARD_INPUT, 0),344 branchLookup_Nested(rabc, aRowType, rRowType, aRowType, InputPreservationOption.DISCARD_INPUT, 0),
345 0, 1);345 0, pipelineMap(), 1);
346 Cursor cursor = cursor(plan, queryContext, queryBindings);346 Cursor cursor = cursor(plan, queryContext, queryBindings);
347 RowBase[] expected = new RowBase[]{347 RowBase[] expected = new RowBase[]{
348 row(aRowType, 13L, 1L, "a13"),348 row(aRowType, 13L, 1L, "a13"),
@@ -366,7 +366,7 @@
366 groupScan_Default(rabc),366 groupScan_Default(rabc),
367 Collections.singleton(aRowType)),367 Collections.singleton(aRowType)),
368 branchLookup_Nested(rabc, aRowType, rRowType, aRowType, InputPreservationOption.DISCARD_INPUT, 0),368 branchLookup_Nested(rabc, aRowType, rRowType, aRowType, InputPreservationOption.DISCARD_INPUT, 0),
369 0, 1);369 0, pipelineMap(), 1);
370 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()370 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()
371 {371 {
372 @Override372 @Override
373373
=== modified file 'src/test/java/com/akiban/server/test/it/qp/Map_NestedLoopsIT.java'
--- src/test/java/com/akiban/server/test/it/qp/Map_NestedLoopsIT.java 2013-07-10 21:30:34 +0000
+++ src/test/java/com/akiban/server/test/it/qp/Map_NestedLoopsIT.java 2013-07-13 21:55:29 +0000
@@ -102,25 +102,25 @@
102 @Test(expected = IllegalArgumentException.class)102 @Test(expected = IllegalArgumentException.class)
103 public void testLeftInputNull()103 public void testLeftInputNull()
104 {104 {
105 map_NestedLoops(null, groupScan_Default(coi), 0, 1);105 map_NestedLoops(null, groupScan_Default(coi), 0, pipelineMap(), 1);
106 }106 }
107107
108 @Test(expected = IllegalArgumentException.class)108 @Test(expected = IllegalArgumentException.class)
109 public void testRightInputNull()109 public void testRightInputNull()
110 {110 {
111 map_NestedLoops(groupScan_Default(coi), null, 0, 1);111 map_NestedLoops(groupScan_Default(coi), null, 0, pipelineMap(), 1);
112 }112 }
113113
114 @Test(expected = IllegalArgumentException.class)114 @Test(expected = IllegalArgumentException.class)
115 public void testNegativeInputBindingPosition()115 public void testNegativeInputBindingPosition()
116 {116 {
117 map_NestedLoops(groupScan_Default(coi), groupScan_Default(coi), -1, 1);117 map_NestedLoops(groupScan_Default(coi), groupScan_Default(coi), -1, pipelineMap(), 1);
118 }118 }
119119
120 @Test(expected = IllegalArgumentException.class)120 @Test(expected = IllegalArgumentException.class)
121 public void testNonPositiveDepth()121 public void testNonPositiveDepth()
122 {122 {
123 map_NestedLoops(groupScan_Default(coi), groupScan_Default(coi), 0, 0);123 map_NestedLoops(groupScan_Default(coi), groupScan_Default(coi), 0, pipelineMap(),0);
124 }124 }
125125
126 // Test operator execution126 // Test operator execution
@@ -132,7 +132,7 @@
132 map_NestedLoops(132 map_NestedLoops(
133 indexScan_Default(itemOidIndexRowType, false),133 indexScan_Default(itemOidIndexRowType, false),
134 ancestorLookup_Nested(coi, itemOidIndexRowType, Collections.singleton(itemRowType), 0),134 ancestorLookup_Nested(coi, itemOidIndexRowType, Collections.singleton(itemRowType), 0),
135 0, 1);135 0, pipelineMap(), 1);
136 RowBase[] expected = new RowBase[]{136 RowBase[] expected = new RowBase[]{
137 row(itemRowType, 1000L, 100L),137 row(itemRowType, 1000L, 100L),
138 row(itemRowType, 1001L, 100L),138 row(itemRowType, 1001L, 100L),
@@ -175,7 +175,7 @@
175 groupScan_Default(coi),175 groupScan_Default(coi),
176 Collections.singleton(customerRowType)),176 Collections.singleton(customerRowType)),
177 project,177 project,
178 0, 1);178 0, pipelineMap(), 1);
179 RowType projectRowType = project.rowType();179 RowType projectRowType = project.rowType();
180 RowBase[] expected = new RowBase[]{180 RowBase[] expected = new RowBase[]{
181 row(projectRowType, 1L, 100L),181 row(projectRowType, 1L, 100L),
@@ -212,7 +212,7 @@
212 groupScan_Default(coi),212 groupScan_Default(coi),
213 Collections.singleton(customerRowType)),213 Collections.singleton(customerRowType)),
214 ifEmpty_Default(project, projectRowType, Arrays.asList(boundField(customerRowType, 0, 0), literal(null)), InputPreservationOption.KEEP_INPUT),214 ifEmpty_Default(project, projectRowType, Arrays.asList(boundField(customerRowType, 0, 0), literal(null)), InputPreservationOption.KEEP_INPUT),
215 0, 1);215 0, pipelineMap(), 1);
216 RowBase[] expected = new RowBase[]{216 RowBase[] expected = new RowBase[]{
217 row(projectRowType, 1L, 100L),217 row(projectRowType, 1L, 100L),
218 row(projectRowType, 1L, 101L),218 row(projectRowType, 1L, 101L),
@@ -234,7 +234,7 @@
234 map_NestedLoops(234 map_NestedLoops(
235 indexScan_Default(itemOidIndexRowType, false),235 indexScan_Default(itemOidIndexRowType, false),
236 ancestorLookup_Nested(coi, itemOidIndexRowType, Collections.singleton(itemRowType), 0),236 ancestorLookup_Nested(coi, itemOidIndexRowType, Collections.singleton(itemRowType), 0),
237 0, 1);237 0, pipelineMap(), 1);
238 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()238 CursorLifecycleTestCase testCase = new CursorLifecycleTestCase()
239 {239 {
240 @Override240 @Override
@@ -291,8 +291,8 @@
291 map_NestedLoops(291 map_NestedLoops(
292 indexScan_Default(customerCidIndexRowType, false, cidRange),292 indexScan_Default(customerCidIndexRowType, false, cidRange),
293 ancestorLookup_Nested(coi, customerCidIndexRowType, Collections.singleton(customerRowType), 0),293 ancestorLookup_Nested(coi, customerCidIndexRowType, Collections.singleton(customerRowType), 0),
294 0, 2),294 0, pipelineMap(), 2),
295 1, 1);295 1, pipelineMap(), 1);
296 RowBase[] expected = new RowBase[]{296 RowBase[] expected = new RowBase[]{
297 row(customerRowType, 1L, "northbridge"),297 row(customerRowType, 1L, "northbridge"),
298 row(customerRowType, 2L, "foundation"),298 row(customerRowType, 2L, "foundation"),
299299
=== added file 'src/test/java/com/akiban/server/test/it/qp/Map_NestedLoopsPipelineIT.java'
--- src/test/java/com/akiban/server/test/it/qp/Map_NestedLoopsPipelineIT.java 1970-01-01 00:00:00 +0000
+++ src/test/java/com/akiban/server/test/it/qp/Map_NestedLoopsPipelineIT.java 2013-07-13 21:55:29 +0000
@@ -0,0 +1,26 @@
1/**
2 * Copyright (C) 2009-2013 Akiban Technologies, Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18package com.akiban.server.test.it.qp;
19
20public class Map_NestedLoopsPipelineIT extends Map_NestedLoopsIT
21{
22 @Override
23 protected boolean pipelineMap() {
24 return true;
25 }
26}
027
=== modified file 'src/test/java/com/akiban/server/test/it/qp/Sort_InsertionLimitedIT.java'
--- src/test/java/com/akiban/server/test/it/qp/Sort_InsertionLimitedIT.java 2013-07-10 18:42:14 +0000
+++ src/test/java/com/akiban/server/test/it/qp/Sort_InsertionLimitedIT.java 2013-07-13 21:55:29 +0000
@@ -540,7 +540,7 @@
540 map_NestedLoops(540 map_NestedLoops(
541 filter_Default(groupScan_Default(coi),541 filter_Default(groupScan_Default(coi),
542 Collections.singleton(customerRowType)),542 Collections.singleton(customerRowType)),
543 project, 0, 1),543 project, 0, pipelineMap(), 1),
544 projectType,544 projectType,
545 ordering(field(projectType, 0), true),545 ordering(field(projectType, 0), true),
546 SortOption.PRESERVE_DUPLICATES,546 SortOption.PRESERVE_DUPLICATES,
547547
=== modified file 'src/test/java/com/akiban/server/test/it/qp/UnionAll_DefaultIT.java'
--- src/test/java/com/akiban/server/test/it/qp/UnionAll_DefaultIT.java 2013-07-10 18:42:14 +0000
+++ src/test/java/com/akiban/server/test/it/qp/UnionAll_DefaultIT.java 2013-07-13 21:55:29 +0000
@@ -270,7 +270,7 @@
270 xEQ9Range,270 xEQ9Range,
271 ordering),271 ordering),
272 txIndexRowType),272 txIndexRowType),
273 0, 1);273 0, pipelineMap(), 1);
274 String[] expected = new String[]{274 String[] expected = new String[]{
275 hKey(1000),275 hKey(1000),
276 hKey(1002),276 hKey(1002),
277277
=== modified file 'src/test/java/com/akiban/sql/optimizer/OperatorCompilerTest.java'
--- src/test/java/com/akiban/sql/optimizer/OperatorCompilerTest.java 2013-03-22 20:05:57 +0000
+++ src/test/java/com/akiban/sql/optimizer/OperatorCompilerTest.java 2013-07-13 21:55:29 +0000
@@ -33,6 +33,7 @@
33import com.akiban.sql.optimizer.plan.ResultSet.ResultField;33import com.akiban.sql.optimizer.plan.ResultSet.ResultField;
34import com.akiban.sql.optimizer.rule.ExplainPlanContext;34import com.akiban.sql.optimizer.rule.ExplainPlanContext;
35import com.akiban.sql.optimizer.rule.RulesTestHelper;35import com.akiban.sql.optimizer.rule.RulesTestHelper;
36import com.akiban.sql.optimizer.rule.PipelineConfiguration;
36import com.akiban.sql.optimizer.rule.cost.TestCostEstimator;37import com.akiban.sql.optimizer.rule.cost.TestCostEstimator;
3738
38import com.akiban.junit.NamedParameterizedRunner;39import com.akiban.junit.NamedParameterizedRunner;
@@ -122,6 +123,7 @@
122 compiler.initT3Registry(t3Registry);123 compiler.initT3Registry(t3Registry);
123 }124 }
124 compiler.initCostEstimator(new TestCostEstimator(ais, compiler.getSchema(), statsFile, false, properties), usePValues);125 compiler.initCostEstimator(new TestCostEstimator(ais, compiler.getSchema(), statsFile, false, properties), usePValues);
126 compiler.initPipelineConfiguration(new PipelineConfiguration());
125 compiler.initDone();127 compiler.initDone();
126 return compiler;128 return compiler;
127 }129 }
128130
=== modified file 'src/test/java/com/akiban/sql/optimizer/rule/RulesTestContext.java'
--- src/test/java/com/akiban/sql/optimizer/rule/RulesTestContext.java 2013-03-22 20:05:57 +0000
+++ src/test/java/com/akiban/sql/optimizer/rule/RulesTestContext.java 2013-07-13 21:55:29 +0000
@@ -50,6 +50,7 @@
50 context.initCostEstimator(new TestCostEstimator(ais, context.getSchema(), 50 context.initCostEstimator(new TestCostEstimator(ais, context.getSchema(),
51 statsFile, statsIgnoreMissingIndexes,51 statsFile, statsIgnoreMissingIndexes,
52 properties), false);52 properties), false);
53 context.initPipelineConfiguration(new PipelineConfiguration());
53 context.initDone();54 context.initDone();
54 return context;55 return context;
55 }56 }

Subscribers

People subscribed via source and target branches