Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
fix importbatch bug, wrap some errs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaffee committed Oct 8, 2019
1 parent 4129aee commit 6791c14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (c *Client) EnsureIndex(index *Index) error {
if err == ErrIndexExists {
return nil
}
return err
return errors.Wrap(err, "creating index")
}

// EnsureField creates a field on the server if it doesn't exists.
Expand Down Expand Up @@ -424,7 +424,7 @@ func (c *Client) syncSchema(schema *Schema, serverSchema *Schema) error {
if _, ok := serverSchema.indexes[indexName]; !ok {
err = c.EnsureIndex(index)
if err != nil {
return err
return errors.Wrap(err, "ensuring index")
}
}
for _, field := range index.fields {
Expand Down
3 changes: 3 additions & 0 deletions gpexp/importbatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ func (b *Batch) makeFragments() (fragments, error) {
}

for fname, rowIDSets := range b.rowIDSets {
if len(rowIDSets) == 0 {
continue
}
field := b.headerMap[fname]
opts := field.Opts()
curShard := ^uint64(0) // impossible sentinel value for shard.
Expand Down

0 comments on commit 6791c14

Please sign in to comment.