Skip to content

Commit

Permalink
[no-release-notes] bump and test for required commit_diff index predi…
Browse files Browse the repository at this point in the history
…cates (#7256)

* bump and test for required commit_diff index predicatesg

* bump gms
  • Loading branch information
max-hoffman authored Jan 5, 2024
1 parent 58c82fa commit a7b37c5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/dolthub/fslock v0.0.3
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
github.com/dolthub/vitess v0.0.0-20240103190516-a3640a70c939
github.com/dolthub/vitess v0.0.0-20240104220048-4b296d3a3d8b
github.com/dustin/go-humanize v1.0.1
github.com/fatih/color v1.13.0
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568
Expand Down Expand Up @@ -57,7 +57,7 @@ require (
github.com/cespare/xxhash v1.1.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.17.1-0.20240104203619-96d886a351e4
github.com/dolthub/go-mysql-server v0.17.1-0.20240104231423-dcf9acb9f61f
github.com/dolthub/swiss v0.1.0
github.com/goccy/go-json v0.10.2
github.com/google/go-github/v57 v57.0.0
Expand Down
8 changes: 4 additions & 4 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-20230524105445-af7e7991c97e h1:kPsT4a47cw1+y/N5SSCkma7FhAPw7KeGmD6c9PBZW9Y=
github.com/dolthub/go-icu-regex v0.0.0-20230524105445-af7e7991c97e/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168=
github.com/dolthub/go-mysql-server v0.17.1-0.20240104203619-96d886a351e4 h1:Vez1CcPzonFeuw2qUOcfZx5dFn3nyeCox7WiMrQ6Vgs=
github.com/dolthub/go-mysql-server v0.17.1-0.20240104203619-96d886a351e4/go.mod h1:dAfTKf71hGyum5tSTE4D3dtkGuMSOaVNJp+CTCMRnFE=
github.com/dolthub/go-mysql-server v0.17.1-0.20240104231423-dcf9acb9f61f h1:nIJGTmtDxVgmnaou1FGNJwZs13RO9WyLT5GXN2ZCml4=
github.com/dolthub/go-mysql-server v0.17.1-0.20240104231423-dcf9acb9f61f/go.mod h1:XVhlCn7TOZvALss7hO4CKaJsydzi4p6zoKTX/pIvDH0=
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488 h1:0HHu0GWJH0N6a6keStrHhUAK5/o9LVfkh44pvsV4514=
github.com/dolthub/ishell v0.0.0-20221214210346-d7db0b066488/go.mod h1:ehexgi1mPxRTk0Mok/pADALuHbvATulTh6gzr7NzZto=
github.com/dolthub/jsonpath v0.0.2-0.20230525180605-8dc13778fd72 h1:NfWmngMi1CYUWU4Ix8wM+USEhjc+mhPlT9JUR/anvbQ=
Expand All @@ -195,8 +195,8 @@ github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9X
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY=
github.com/dolthub/swiss v0.1.0 h1:EaGQct3AqeP/MjASHLiH6i4TAmgbG/c4rA6a1bzCOPc=
github.com/dolthub/swiss v0.1.0/go.mod h1:BeucyB08Vb1G9tumVN3Vp/pyY4AMUnr9p7Rz7wJ7kAQ=
github.com/dolthub/vitess v0.0.0-20240103190516-a3640a70c939 h1:kciLntsnQPtDSQOUfSwmPj7TsAR2bzP8GUwuWnGvCTo=
github.com/dolthub/vitess v0.0.0-20240103190516-a3640a70c939/go.mod h1:IwjNXSQPymrja5pVqmfnYdcy7Uv7eNJNBPK/MEh9OOw=
github.com/dolthub/vitess v0.0.0-20240104220048-4b296d3a3d8b h1:isS4RQQIxNGku8NV/SrVGSyBoHtrgpYt0fd/zv53ix4=
github.com/dolthub/vitess v0.0.0-20240104220048-4b296d3a3d8b/go.mod h1:IwjNXSQPymrja5pVqmfnYdcy7Uv7eNJNBPK/MEh9OOw=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
Expand Down
5 changes: 5 additions & 0 deletions go/libraries/doltcore/sqle/dtables/commit_diff_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ func (dt *CommitDiffTable) PreciseMatch() bool {
return false
}

// RequiredPredicates implements sql.IndexRequired
func (dt *CommitDiffTable) RequiredPredicates() []string {
return []string{"to_commit", "from_commit"}
}

func (dt *CommitDiffTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error) {
return nil, fmt.Errorf("error querying table %s: %w", dt.Name(), ErrExactlyOneToCommit)
}
Expand Down
18 changes: 18 additions & 0 deletions go/libraries/doltcore/sqle/enginetest/dolt_queries_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -5506,6 +5506,24 @@ var SystemTableIndexTests = []systabScript{
},
},
},
{
name: "required index lookup in join",
setup: append(systabSetup,
"set @tag_head = hashof('main^');",
"call dolt_tag('t1', concat(@tag_head, '^'));",
),
queries: []systabQuery{
{
query: `
select /*+ HASH_JOIN(t,cd) */ distinct t.tag_name
from dolt_tags t
left join dolt_commit_diff_xy cd
on cd.to_commit = t.tag_name and
cd.from_commit = concat(t.tag_name, '^')`,
exp: []sql.Row{{"t1"}},
},
},
},
{
name: "commit indexing edge cases",
setup: append(systabSetup,
Expand Down

0 comments on commit a7b37c5

Please sign in to comment.