Skip to content

Commit

Permalink
[Bug] Fix casing (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored Mar 5, 2023
1 parent 68f2869 commit ec33415
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion models/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/artie-labs/transfer/lib/stringutil"
"github.com/artie-labs/transfer/lib/typing"
"github.com/segmentio/kafka-go"
"strings"
"sync"
)

Expand Down Expand Up @@ -68,11 +69,13 @@ func (e *Event) Save(topicConfig *kafkalib.TopicConfig, message kafka.Message) (

// Update col if necessary
for col, val := range e.Data {
// columns need to all be normalized and lower cased.
col = strings.ToLower(col)

// Columns here could contain spaces. Every destination treats spaces in a column differently.
// So far, Snowflake accepts them when escaped properly, however BigQuery does not accept it.
// Instead of making this more complicated for future destinations, we will escape the spaces by having double underscore `__`
// So, if customers want to retrieve spaces again, they can replace `__`.

var containsSpace bool
containsSpace, col = stringutil.EscapeSpaces(col)
if containsSpace {
Expand Down

0 comments on commit ec33415

Please sign in to comment.