Skip to content

Commit be1917b

Browse files
author
James Cor
committed
remove exchange node
1 parent c5725b1 commit be1917b

File tree

20 files changed

+11
-1282
lines changed

20 files changed

+11
-1282
lines changed

enginetest/harness.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ import (
3535
// times during a single test run, and must return a "fresh" engine instance each time, i.e. an instance that contains
3636
// exactly the test data provided via other setup methods.
3737
type Harness interface {
38-
// Parallelism returns how many parallel go routines to use when constructing an engine for test.
39-
Parallelism() int
4038
// NewContext allows a harness to specify any sessions or context variables necessary for the proper functioning of
4139
// their engine implementation. Every harnessed engine test uses the context created by this method, with some
4240
// additional information (e.g. current DB) set uniformly. To replicate the behavior of tests during setup,

enginetest/initialization.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ func NewContextWithClient(harness ClientHarness, client sql.Client) *sql.Context
3737
return newContextSetup(harness.NewContextWithClient(client))
3838
}
3939

40-
// TODO: remove
41-
func NewContextWithEngine(harness Harness, engine QueryEngine) *sql.Context {
42-
return NewContext(harness)
43-
}
44-
4540
var pid uint64
4641

4742
func newContextSetup(ctx *sql.Context) *sql.Context {
@@ -84,22 +79,15 @@ func NewBaseSession() *sql.BaseSession {
8479

8580
// NewEngineWithProvider returns a new engine with the specified provider
8681
func NewEngineWithProvider(_ *testing.T, harness Harness, provider sql.DatabaseProvider) *sqle.Engine {
87-
var a *analyzer.Analyzer
88-
89-
if harness.Parallelism() > 1 {
90-
a = analyzer.NewBuilder(provider).WithParallelism(harness.Parallelism()).Build()
91-
} else {
92-
a = analyzer.NewDefault(provider)
93-
}
82+
analyzer := analyzer.NewDefault(provider)
9483

9584
// All tests will run with all privileges on the built-in root account
96-
a.Catalog.MySQLDb.AddRootAccount()
85+
analyzer.Catalog.MySQLDb.AddRootAccount()
9786
// Almost no tests require an information schema that can be updated, but test setup makes it difficult to not
9887
// provide everywhere
99-
a.Catalog.InfoSchema = information_schema.NewInformationSchemaDatabase()
100-
101-
engine := sqle.New(a, new(sqle.Config))
88+
analyzer.Catalog.InfoSchema = information_schema.NewInformationSchemaDatabase()
10289

90+
engine := sqle.New(analyzer, new(sqle.Config))
10391
if idh, ok := harness.(IndexDriverHarness); ok {
10492
idh.InitializeIndexDriver(engine.Analyzer.Catalog.AllDatabases(NewContext(harness)))
10593
}

enginetest/memory_engine_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,10 +484,6 @@ func TestIndexQueryPlans(t *testing.T) {
484484
}
485485
}
486486

487-
func TestParallelismQueries(t *testing.T) {
488-
enginetest.TestParallelismQueries(t, enginetest.NewMemoryHarness("default", 2, testNumPartitions, true, nil))
489-
}
490-
491487
func TestQueryErrors(t *testing.T) {
492488
enginetest.TestQueryErrors(t, enginetest.NewDefaultMemoryHarness())
493489
}

enginetest/parallelism.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

enginetest/plangen/cmd/plangen/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func generatePlansForSuite(spec PlanSpec, w *bytes.Buffer) error {
164164
_, _ = w.WriteString("\n")
165165

166166
if !tt.Skip {
167-
ctx := enginetest.NewContextWithEngine(harness, engine)
167+
ctx := enginetest.NewContext(harness)
168168
binder := planbuilder.New(ctx, engine.EngineAnalyzer().Catalog, sql.NewMysqlParser())
169169
parsed, _, _, qFlags, err := binder.Parse(tt.Query, nil, false)
170170
if err != nil {

sql/analyzer/analyzer.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ type Builder struct {
7474
afterAllRules []Rule
7575
provider sql.DatabaseProvider
7676
debug bool
77-
parallelism int
7877
}
7978

8079
// NewBuilder creates a new Builder from a specific catalog.
@@ -100,12 +99,6 @@ func (ab *Builder) WithDebug() *Builder {
10099
return ab
101100
}
102101

103-
// WithParallelism sets the parallelism level on the analyzer.
104-
func (ab *Builder) WithParallelism(parallelism int) *Builder {
105-
ab.parallelism = parallelism
106-
return ab
107-
}
108-
109102
// AddPreAnalyzeRule adds a new rule to the analyze before the standard analyzer rules.
110103
func (ab *Builder) AddPreAnalyzeRule(id RuleId, fn RuleFunc) *Builder {
111104
ab.preAnalyzeRules = append(ab.preAnalyzeRules, Rule{id, fn})
@@ -271,7 +264,6 @@ func (ab *Builder) Build() *Analyzer {
271264
contextStack: make([]string, 0),
272265
Batches: batches,
273266
Catalog: NewCatalog(ab.provider),
274-
Parallelism: ab.parallelism,
275267
Coster: memo.NewDefaultCoster(),
276268
ExecBuilder: rowexec.DefaultBuilder,
277269
}
@@ -286,7 +278,6 @@ type Analyzer struct {
286278
Verbose bool
287279
// A stack of debugger context. See PushDebugContext, PopDebugContext
288280
contextStack []string
289-
Parallelism int
290281
// Batches of Rules to apply.
291282
Batches []*Batch
292283
// Catalog of databases and registered functions.
@@ -304,7 +295,6 @@ type Analyzer struct {
304295
// To add custom rules, the easiest way is use the Builder.
305296
func NewDefault(provider sql.DatabaseProvider) *Analyzer {
306297
return NewBuilder(provider).Build()
307-
308298
}
309299

310300
// NewDefaultWithVersion creates a default Analyzer instance either
@@ -402,10 +392,8 @@ func NewProcRuleSelector(sel RuleSelector) RuleSelector {
402392
switch id {
403393
case pruneTablesId,
404394
unnestInSubqueriesId,
405-
406395
// once after default rules should only be run once
407-
TrackProcessId,
408-
parallelizeId:
396+
TrackProcessId:
409397
return false
410398
}
411399
return sel(id)
@@ -452,8 +440,7 @@ func NewFinalizeUnionSel(sel RuleSelector) RuleSelector {
452440
case
453441
// skip recursive resolve rules
454442
resolveSubqueriesId,
455-
resolveUnionsId,
456-
parallelizeId:
443+
resolveUnionsId:
457444
return false
458445
case finalizeSubqueriesId,
459446
hoistOutOfScopeFiltersId:

0 commit comments

Comments
 (0)