From 7f26319520ef5bf53a9ab308cfee34a73b0274ab Mon Sep 17 00:00:00 2001 From: Rishabh Verma Date: Tue, 21 Feb 2023 15:16:13 +0530 Subject: [PATCH] fix(BigTable): Fixes the issue with same qualifier across families. --- .../Google.Cloud.Bigtable.V2/RowAsyncEnumerator.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apis/Google.Cloud.Bigtable.V2/Google.Cloud.Bigtable.V2/RowAsyncEnumerator.cs b/apis/Google.Cloud.Bigtable.V2/Google.Cloud.Bigtable.V2/RowAsyncEnumerator.cs index 8198140dbd2f..6b29da41c739 100644 --- a/apis/Google.Cloud.Bigtable.V2/Google.Cloud.Bigtable.V2/RowAsyncEnumerator.cs +++ b/apis/Google.Cloud.Bigtable.V2/Google.Cloud.Bigtable.V2/RowAsyncEnumerator.cs @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. All rights reserved. +// Copyright 2017 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -321,6 +321,7 @@ public override RowMergeState HandleChunk(RowAsyncEnumerator owner, CellChunk ch } owner.Assert(chunk.ValueSize >= 0, "NewCell valueSize can't be negative"); + bool familyNameChanged = false; if (chunk.FamilyName != null) { if (chunk.FamilyName != owner._currentCell.Family?.Name) @@ -328,11 +329,12 @@ public override RowMergeState HandleChunk(RowAsyncEnumerator owner, CellChunk ch owner._currentCell.Family = new Family { Name = chunk.FamilyName }; Debug.Assert(!owner._currentFamilies.ContainsKey(chunk.FamilyName)); owner._currentFamilies[chunk.FamilyName] = owner._currentCell.Family; + familyNameChanged = true; } owner.Assert(chunk.Qualifier != null, "NewCell has a familyName, but no qualifier"); } - if (chunk.Qualifier != null && chunk.Qualifier != owner._currentCell.Column?.Qualifier) + if (chunk.Qualifier != null && (chunk.Qualifier != owner._currentCell.Column?.Qualifier || familyNameChanged)) { owner._currentCell.Column = new Column { Qualifier = chunk.Qualifier }; owner.Assert(