Skip to content

Commit

Permalink
merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cor committed Dec 26, 2024
2 parents 9e96856 + 68651da commit b135082
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 37 deletions.
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.19.1-0.20241226200001-d8e318971f41
github.com/dolthub/go-mysql-server v0.19.1-0.20241226184402-e01b2a800f4e
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-20241215010122-db690dd53c90 h1:Sni8jrP0sy/w9ZYXoff4g/ixe+7bFCZlfCqXKJSU+zM=
github.com/dolthub/go-icu-regex v0.0.0-20241215010122-db690dd53c90/go.mod h1:ylU4XjUpsMcvl/BKeRRMXSH7e7WBrPXdSLvnRJYrxEA=
github.com/dolthub/go-mysql-server v0.19.1-0.20241226200001-d8e318971f41 h1:EoqNEMPlVB3bWZOKPapCmiClNOHYGw1Vvb8OeMKIewc=
github.com/dolthub/go-mysql-server v0.19.1-0.20241226200001-d8e318971f41/go.mod h1:ToNOAVZAJ6iQBpigxYZo3q8JZDRxpI2/VRrtUoZeehI=
github.com/dolthub/go-mysql-server v0.19.1-0.20241226184402-e01b2a800f4e h1:xFfx4anC6grBkHtN1vwHuA7yfrzABbipI7wG4yNcEoM=
github.com/dolthub/go-mysql-server v0.19.1-0.20241226184402-e01b2a800f4e/go.mod h1:ToNOAVZAJ6iQBpigxYZo3q8JZDRxpI2/VRrtUoZeehI=
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
45 changes: 24 additions & 21 deletions go/libraries/doltcore/sqle/enginetest/dolt_engine_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ func RunSystemTableIndexesTests(t *testing.T, harness DoltEnginetestHarness) {
}

for _, stt := range SystemTableIndexTests {
harness = harness.NewHarness(t).WithParallelism(2)
harness = harness.NewHarness(t).WithParallelism(1)
defer harness.Close()
harness.SkipSetupCommit()
e := mustNewEngine(t, harness)
Expand All @@ -1422,27 +1422,30 @@ func RunSystemTableIndexesTests(t *testing.T, harness DoltEnginetestHarness) {
enginetest.RunQueryWithContext(t, e, harness, ctx, q)
}

for i, c := range []string{"inner", "lookup", "hash", "merge"} {
e.EngineAnalyzer().Coster = biasedCosters[i]
for _, tt := range stt.queries {
if tt.query == "select count(*) from dolt_blame_xy" && c == "inner" {
// todo we either need join hints to work inside the blame view
// and force the window relation to be primary, or we need the
// blame view's timestamp columns to be specific enough to not
// overlap during testing.
t.Skip("the blame table is unstable as secondary table in join with exchange node")
}
t.Run(fmt.Sprintf("%s(%s): %s", stt.name, c, tt.query), func(t *testing.T) {
if tt.skip {
t.Skip()
}

ctx = ctx.WithQuery(tt.query)
if tt.exp != nil {
enginetest.TestQueryWithContext(t, ctx, e, harness, tt.query, tt.exp, nil, nil, nil)
costers := []string{"inner", "lookup", "hash", "merge"}
for i, c := range costers {
t.Run(c, func(t *testing.T) {
e.EngineAnalyzer().Coster = biasedCosters[i]
for _, tt := range stt.queries {
if tt.query == "select count(*) from dolt_blame_xy" && c == "inner" {
// todo we either need join hints to work inside the blame view
// and force the window relation to be primary, or we need the
// blame view's timestamp columns to be specific enough to not
// overlap during testing.
t.Skip("the blame table is unstable as secondary table in join with exchange node")
}
})
}
t.Run(fmt.Sprintf("%s(%s): %s", stt.name, c, tt.query), func(t *testing.T) {
if tt.skip {
t.Skip()
}

ctx = ctx.WithQuery(tt.query)
if tt.exp != nil {
enginetest.TestQueryWithContext(t, ctx, e, harness, tt.query, tt.exp, nil, nil, nil)
}
})
}
})
}
}
}
Expand Down
1 change: 1 addition & 0 deletions go/libraries/doltcore/sqle/enginetest/dolt_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ type DoltEnginetestHarness interface {
WithSkippedQueries(skipped []string) DoltEnginetestHarness

// WithParallelism returns a copy of the harness with parallelism set to the given number of threads
// Deprecated: parallelism currently no-ops
WithParallelism(parallelism int) DoltEnginetestHarness

// WithConfigureStats returns a copy of the harness with the given configureStats value
Expand Down
8 changes: 8 additions & 0 deletions go/libraries/doltcore/sqle/enginetest/dolt_queries_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -6240,6 +6240,14 @@ var SystemTableIndexTests = []systabScript{
ORDER BY cm.date, cm.message asc`,
exp: []sql.Row{{5}},
},
{
query: "select count(*) /*+ JOIN_ORDER(a,b) */ from dolt_diff_xy a join xy b on x = to_x",
exp: []sql.Row{{45}},
},
{
query: "select count(*) /*+ JOIN_ORDER(b,a) */ from dolt_diff_xy a join xy b on x = to_x",
exp: []sql.Row{{45}},
},
},
},
{
Expand Down
25 changes: 13 additions & 12 deletions go/libraries/doltcore/sqle/index/dolt_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,19 @@ func DoltDiffIndexesFromTable(ctx context.Context, db, tbl string, t *doltdb.Tab

// to_ columns
toIndex := doltIndex{
id: "PRIMARY",
tblName: doltdb.DoltDiffTablePrefix + tbl,
dbName: db,
columns: toCols,
indexSch: sch,
tableSch: sch,
unique: true,
comment: "",
vrw: t.ValueReadWriter(),
ns: t.NodeStore(),
keyBld: keyBld,
order: sql.IndexOrderAsc,
id: "PRIMARY",
tblName: doltdb.DoltDiffTablePrefix + tbl,
dbName: db,
columns: toCols,
indexSch: sch,
tableSch: sch,
unique: true,
comment: "",
vrw: t.ValueReadWriter(),
ns: t.NodeStore(),
keyBld: keyBld,
// only ordered on PK within a diff partition
order: sql.IndexOrderNone,
constrainedToLookupExpression: false,
}

Expand Down
2 changes: 1 addition & 1 deletion go/libraries/doltcore/sqle/kvexec/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func getMergeKv(ctx *sql.Context, n sql.Node) (mergeState, error) {
//case *dtables.DiffTable:
// TODO: add interface to include system tables
default:
return ms, nil
return ms, fmt.Errorf("non-standard indexed table not supported")
}

if idx.Format() != types.Format_DOLT {
Expand Down

0 comments on commit b135082

Please sign in to comment.