diff --git a/client.go b/client.go index f2c2f72..aca3350 100644 --- a/client.go +++ b/client.go @@ -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. @@ -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 { diff --git a/gpexp/importbatch.go b/gpexp/importbatch.go index 9ee21b6..4dd2fab 100644 --- a/gpexp/importbatch.go +++ b/gpexp/importbatch.go @@ -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.