From 55043f5abd08d7afbaec23f3c9720bdb9a5809cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Tue, 23 Jan 2024 23:28:20 +0000 Subject: [PATCH] nexus: don't send quoting to grpc Ident::to_string preserves quoting, so ``` exclude:["c2"] exclude:[c2] ``` send different things to grpc endpoint, which expects unquoted strings Same goes for PartitionKeyColumn --- flow/connectors/eventhub/eventhub.go | 6 ++---- nexus/analyzer/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/flow/connectors/eventhub/eventhub.go b/flow/connectors/eventhub/eventhub.go index 9eab9ae1b2..01cf856f1c 100644 --- a/flow/connectors/eventhub/eventhub.go +++ b/flow/connectors/eventhub/eventhub.go @@ -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) diff --git a/nexus/analyzer/src/lib.rs b/nexus/analyzer/src/lib.rs index a3dbe1b37d..6602782e72 100644 --- a/nexus/analyzer/src/lib.rs +++ b/nexus/analyzer/src/lib.rs @@ -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(), }); }