Skip to content

Commit

Permalink
[no-release-notes] remove exchange bump (#8485)
Browse files Browse the repository at this point in the history
  • Loading branch information
jycor authored Oct 23, 2024
1 parent 34754fc commit 966503a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 32 deletions.
13 changes: 1 addition & 12 deletions go/cmd/dolt/commands/engine/sqlengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"fmt"
"os"
"runtime"
"strconv"
"strings"

Expand Down Expand Up @@ -48,7 +47,6 @@ import (
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/statspro"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle/writer"
"github.com/dolthub/dolt/go/libraries/utils/config"
"github.com/dolthub/dolt/go/store/types"
)

// SqlEngine packages up the context necessary to run sql queries against dsqle.
Expand Down Expand Up @@ -94,15 +92,6 @@ func NewSqlEngine(
return nil, err
}

nbf := types.Format_Default
if len(dbs) > 0 {
nbf = dbs[0].DbData().Ddb.Format()
}
parallelism := runtime.GOMAXPROCS(0)
if types.IsFormat_DOLT(nbf) {
parallelism = 1
}

bThreads := sql.NewBackgroundThreads()
dbs, err = dsqle.ApplyReplicationConfig(ctx, bThreads, mrEnv, cli.CliOut, dbs...)
if err != nil {
Expand Down Expand Up @@ -146,7 +135,7 @@ func NewSqlEngine(
sqlEngine := &SqlEngine{}

// Create the engine
engine := gms.New(analyzer.NewBuilder(pro).WithParallelism(parallelism).Build(), &gms.Config{
engine := gms.New(analyzer.NewBuilder(pro).Build(), &gms.Config{
IsReadOnly: config.IsReadOnly,
IsServerLocked: config.IsServerLocked,
}).WithBackgroundThreads(bThreads)
Expand Down
4 changes: 1 addition & 3 deletions go/cmd/dolt/commands/filter-branch.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"fmt"
"io"
"runtime"
"strings"

sqle "github.com/dolthub/go-mysql-server"
Expand Down Expand Up @@ -370,8 +369,7 @@ func rebaseSqlEngine(ctx context.Context, dEnv *env.DoltEnv, root doltdb.RootVal
return nil, nil, err
}

parallelism := runtime.GOMAXPROCS(0)
azr := analyzer.NewBuilder(pro).WithParallelism(parallelism).Build()
azr := analyzer.NewDefault(pro)

err = db.SetRoot(sqlCtx, root)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ require (
github.com/cespare/xxhash/v2 v2.2.0
github.com/creasty/defaults v1.6.0
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
github.com/dolthub/go-mysql-server v0.18.2-0.20241023210926-ef9faa30f31f
github.com/dolthub/go-mysql-server v0.18.2-0.20241023223952-9322ec486dc1
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63
github.com/dolthub/swiss v0.1.0
github.com/goccy/go-json v0.10.2
Expand Down
4 changes: 2 additions & 2 deletions go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662 h1:aC17hZD6iwzBwwfO5M+3oBT5E5gGRiQPdn+vzpDXqIA=
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168=
github.com/dolthub/go-mysql-server v0.18.2-0.20241023210926-ef9faa30f31f h1:+ByVVCp0zFnTwWSYXqETRgF1C2fBklE/lI0pxrHh4/A=
github.com/dolthub/go-mysql-server v0.18.2-0.20241023210926-ef9faa30f31f/go.mod h1:z/GGuH2asedC+lkJA4sx+C3oyRH1HRx8ET6N9AGBVms=
github.com/dolthub/go-mysql-server v0.18.2-0.20241023223952-9322ec486dc1 h1:OL9LrwzgvZO+bPrKgmK0qweWDYTigfxQzA4JSouV8Ys=
github.com/dolthub/go-mysql-server v0.18.2-0.20241023223952-9322ec486dc1/go.mod h1:z/GGuH2asedC+lkJA4sx+C3oyRH1HRx8ET6N9AGBVms=
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE=
Expand Down
20 changes: 8 additions & 12 deletions go/libraries/doltcore/sqle/enginetest/dolt_query_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,29 @@ var DoltCommitPlanTests = []queries.QueryPlanTest{
{
Query: "select * from dolt_log order by commit_hash;",
ExpectedPlan: "Sort(dolt_log.commit_hash ASC)\n" +
" └─ Exchange\n" +
" └─ Table\n" +
" └─ name: dolt_log\n" +
" └─ Table\n" +
" └─ name: dolt_log\n" +
"",
},
{
Query: "select * from dolt_diff order by commit_hash;",
ExpectedPlan: "Sort(dolt_diff.commit_hash ASC)\n" +
" └─ Exchange\n" +
" └─ Table\n" +
" └─ name: dolt_diff\n" +
" └─ Table\n" +
" └─ name: dolt_diff\n" +
"",
},
{
Query: "select * from dolt_commits order by commit_hash;",
ExpectedPlan: "Sort(dolt_commits.commit_hash ASC)\n" +
" └─ Exchange\n" +
" └─ Table\n" +
" └─ name: dolt_commits\n" +
" └─ Table\n" +
" └─ name: dolt_commits\n" +
"",
},
{
Query: "select * from dolt_commit_ancestors order by commit_hash;",
ExpectedPlan: "Sort(dolt_commit_ancestors.commit_hash ASC)\n" +
" └─ Exchange\n" +
" └─ Table\n" +
" └─ name: dolt_commit_ancestors\n" +
" └─ Table\n" +
" └─ name: dolt_commit_ancestors\n" +
"",
},
}
2 changes: 1 addition & 1 deletion go/libraries/doltcore/sqle/enginetest/testgen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestGenNewFormatQueryPlans(t *testing.T) {
_, _ = w.WriteString("var NewFormatQueryPlanTests = []queries.QueryPlanTest{\n")
for _, tt := range queries.PlanTests {
_, _ = w.WriteString("\t{\n")
ctx := enginetest.NewContextWithEngine(harness, engine)
ctx := enginetest.NewContext(harness)
binder := planbuilder.New(ctx, engine.EngineAnalyzer().Catalog, sql.NewMysqlParser())
parsed, _, _, qFlags, err := binder.Parse(tt.Query, nil, false)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion go/libraries/doltcore/sqle/sqlddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ func newTestEngine(ctx context.Context, dEnv *env.DoltEnv) (*gms.Engine, *sql.Co
sqlCtx := sql.NewContext(ctx, sql.WithSession(doltSession))
sqlCtx.SetCurrentDatabase(mrEnv.GetFirstDatabase())

return gms.New(analyzer.NewBuilder(pro).WithParallelism(1).Build(), &gms.Config{
return gms.New(analyzer.NewBuilder(pro).Build(), &gms.Config{
IsReadOnly: false,
IsServerLocked: false,
}), sqlCtx
Expand Down

0 comments on commit 966503a

Please sign in to comment.