Skip to content

Commit

Permalink
nexus: don't send quoting to grpc
Browse files Browse the repository at this point in the history
Ident::to_string preserves quoting, so
```
exclude:["c2"]
exclude:[c2]
```
send different things to grpc endpoint,
which expects unquoted strings

Same goes for PartitionKeyColumn
  • Loading branch information
serprex committed Jan 23, 2024
1 parent cd6086c commit 55043f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions flow/connectors/eventhub/eventhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,8 @@ func (c *EventHubConnector) processBatch(
partitionColumn := destination.PartitionKeyColumn
partitionValue := record.GetItems().GetColumnValue(partitionColumn).Value
var partitionKey string
if partitionValue == nil {
partitionKey = ""
} else {
partitionKey = fmt.Sprintf("%v", partitionValue)
if partitionValue != nil {
partitionKey = fmt.Sprint(partitionValue)
}
partitionKey = utils.HashedPartitionKey(partitionKey, numPartitions)
destination.SetPartitionValue(partitionKey)
Expand Down
4 changes: 2 additions & 2 deletions nexus/analyzer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ impl<'a> StatementAnalyzer for PeerDDLAnalyzer<'a> {
partition_key: table_mapping
.partition_key
.as_ref()
.map(|s| s.to_string()),
.map(|s| s.value.clone()),
exclude: table_mapping
.exclude
.as_ref()
.map(|ss| ss.iter().map(|s| s.to_string()).collect())
.map(|ss| ss.iter().map(|s| s.value.clone()).collect())
.unwrap_or_default(),
});
}
Expand Down

0 comments on commit 55043f5

Please sign in to comment.