Skip to content

Commit

Permalink
Added tab to bad characters, increased batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Masili committed Jul 18, 2021
1 parent 896efe1 commit cb42f3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions core/commands/connectors/db_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ func (p *PgConnector) Write(data []map[string]interface{}) error {
value := row[c.Name]
switch value.(type) {
case string: // already marshalled
repairedString := string(carriageReturn.ReplaceAll([]byte(value.(string)), []byte{}))
vals[i] = repairedString
vals[i] = value
default:
marshal, err := json.Marshal(value)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion core/commands/load_osm.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r OsmRunner) Run(c *utils.Config) error {
if err != nil {
return err
}
requests := pipeline.BatchRequest(channel, 2500, time.Second)
requests := pipeline.BatchRequest(channel, 10000, time.Second)
var pgWorkers sync.WaitGroup
pgWorkers.Add(1)
beat := &pipeline.ProgressBarBeat{OperationName: "Writing"}
Expand Down
2 changes: 1 addition & 1 deletion core/commands/osm/decode_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ var keyVal = []byte(`":"`)
var quotes = []byte(`"`)
var endPar = []byte(`}`)
var nameBytes = []byte(`name`)
var carriageReturn = regexp.MustCompile(`[\n\r"\\]`)
var carriageReturn = regexp.MustCompile(`[\n\r\t"\\]`)
var escapeQuote = regexp.MustCompile(`"`)

// Make tags map from stringtable and array of IDs (used in DenseNodes encoding).
Expand Down

0 comments on commit cb42f3b

Please sign in to comment.