Skip to content

Commit

Permalink
Fix gluesync and gluerecover prefix match (#1751)
Browse files Browse the repository at this point in the history
* Fix table prefix matching for gluesync and gluerecover.

* Add flag to skip version check in gluesync/gluerecover

* Revert "Add flag to skip version check in gluesync/gluerecover"

This reverts commit 0cefbbf
  • Loading branch information
alxarch authored Oct 15, 2020
1 parent 688a177 commit 6807436
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions internal/log_analysis/gluetasks/recover.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
goerr "errors"
"fmt"
"path"
"regexp"
"time"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -79,7 +78,7 @@ func (r *RecoverDatabaseTables) Run(ctx context.Context, glueAPI glueiface.GlueA
DatabaseName: &r.DatabaseName,
}
if r.MatchPrefix != "" {
expr := "^" + regexp.QuoteMeta(r.MatchPrefix)
expr := r.MatchPrefix + "*"
input.Expression = &expr
}
err := glueAPI.GetTablesPagesWithContext(ctx, &input, func(page *glue.GetTablesOutput, _ bool) bool {
Expand Down
3 changes: 1 addition & 2 deletions internal/log_analysis/gluetasks/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package gluetasks
import (
"context"
"reflect"
"regexp"
"sync/atomic"
"time"

Expand Down Expand Up @@ -62,7 +61,7 @@ func (s *SyncDatabaseTables) Run(ctx context.Context, api glueiface.GlueAPI, log
DatabaseName: &s.DatabaseName,
}
if s.MatchPrefix != "" {
expr := "^" + regexp.QuoteMeta(s.MatchPrefix)
expr := s.MatchPrefix + "*"
input.Expression = &expr
}
log.Info("scanning for tables")
Expand Down

0 comments on commit 6807436

Please sign in to comment.