Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partition ranges, covering indexes, smarter iterators #1116

Merged
merged 13 commits into from
Dec 16, 2020
Prev Previous commit
Next Next commit
merged master, resolved conflicts
  • Loading branch information
andy-wm-arthur committed Dec 15, 2020
commit 1c77b54f866d35bd85d6f154e3f9dead093eb88c
5 changes: 0 additions & 5 deletions go/libraries/doltcore/table/keyless_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (

"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
"github.com/dolthub/dolt/go/libraries/doltcore/schema"
"github.com/dolthub/dolt/go/libraries/doltcore/table/typed/noms"
"github.com/dolthub/dolt/go/store/types"
)

Expand All @@ -32,10 +31,6 @@ func newKeylessTableReaderForPartition(ctx context.Context, tbl *doltdb.Table, s
return nil, fmt.Errorf("newKeylessTableReaderForPartition is unimplemented")
}

func newKeylessTableReaderForRanges(ctx context.Context, tbl *doltdb.Table, sch schema.Schema, ranges ...*noms.ReadRange) (SqlTableReader, error) {
return nil, fmt.Errorf("newKeylessTableReaderForRanges is unimplemented")
}

func newKeylessTableReaderFrom(ctx context.Context, tbl *doltdb.Table, sch schema.Schema, val types.Value) (SqlTableReader, error) {
return nil, fmt.Errorf("newKeylessTableReaderFrom is unimplemented")
}
11 changes: 0 additions & 11 deletions go/libraries/doltcore/table/pk_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
"github.com/dolthub/dolt/go/libraries/doltcore/row"
"github.com/dolthub/dolt/go/libraries/doltcore/schema"
"github.com/dolthub/dolt/go/libraries/doltcore/table/typed/noms"
"github.com/dolthub/dolt/go/store/types"
)

Expand All @@ -34,7 +33,6 @@ type pkTableReader struct {
}

var _ SqlTableReader = pkTableReader{}
var _ SqlTableReader = &noms.NomsRangeReader{}

// GetSchema implements the TableReader interface.
func (rdr pkTableReader) GetSchema() schema.Schema {
Expand Down Expand Up @@ -89,15 +87,6 @@ func newPkTableReader(ctx context.Context, tbl *doltdb.Table, sch schema.Schema,
}, nil
}

func newPkTableReaderForRanges(ctx context.Context, tbl *doltdb.Table, sch schema.Schema, ranges ...*noms.ReadRange) (SqlTableReader, error) {
rows, err := tbl.GetRowData(ctx)
if err != nil {
return nil, err
}

return noms.NewNomsRangeReader(sch, rows, ranges), nil
}

func newPkTableReaderFrom(ctx context.Context, tbl *doltdb.Table, sch schema.Schema, val types.Value) (SqlTableReader, error) {
rows, err := tbl.GetRowData(ctx)
if err != nil {
Expand Down
15 changes: 0 additions & 15 deletions go/libraries/doltcore/table/table_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
"github.com/dolthub/dolt/go/libraries/doltcore/row"
"github.com/dolthub/dolt/go/libraries/doltcore/schema"
"github.com/dolthub/dolt/go/libraries/doltcore/table/typed/noms"
"github.com/dolthub/dolt/go/store/types"
)

Expand Down Expand Up @@ -97,20 +96,6 @@ func NewBufferedTableReaderForPartition(ctx context.Context, tbl *doltdb.Table,
return newPkTableReaderForPartition(ctx, tbl, sch, start, end)
}

// NewTableReaderForRanges creates a SqlTableReader that reads the rows of |tbl| corresponding to the
// the noms.ReadRandes in |ranges|.
func NewTableReaderForRanges(ctx context.Context, tbl *doltdb.Table, ranges ...*noms.ReadRange) (SqlTableReader, error) {
sch, err := tbl.GetSchema(ctx)
if err != nil {
return nil, err
}

if schema.IsKeyless(sch) {
return newKeylessTableReaderForRanges(ctx, tbl, sch, ranges...)
}
return newPkTableReaderForRanges(ctx, tbl, sch, ranges...)
}

// NewTableReaderFrom creates a SqlTableReader that reads the rows of |tbl| beginning at the record
// whose types.Map key is >= |val|.
func NewTableReaderFrom(ctx context.Context, tbl *doltdb.Table, val types.Value) (SqlTableReader, error) {
Expand Down
2 changes: 0 additions & 2 deletions go/libraries/doltcore/table/typed/noms/range_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"context"
"io"

"github.com/dolthub/go-mysql-server/sql"

"github.com/dolthub/dolt/go/libraries/doltcore/row"
"github.com/dolthub/dolt/go/libraries/doltcore/schema"
"github.com/dolthub/dolt/go/store/types"
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.