-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only data for one column is returned when reading row with same qualifier in multiple families #9870
Comments
Assigning to Rishabh to investigate. (I'd have a look myself, but I'm off sick at the moment.) |
I'll have a look at it first thing tomorrow morning IST and share my investigation. Thanks. |
I tried to write a simple program to reproduce the problem. Hope it is helpful. var tableId = "TestTable";
var table = new Table
{
Granularity = Table.Types.TimestampGranularity.Millis,
ColumnFamilies =
{
{ "MyFamily1", new ColumnFamily { GcRule = new GcRule { MaxNumVersions = 10 } } },
{ "MyFamily2", new ColumnFamily { GcRule = new GcRule { MaxNumVersions = 10 } } }
}
};
try
{
await _tableAdminClient.CreateTableAsync(
parent: new InstanceName(_settings.ProjectId, _settings.InstanceId),
tableId,
table);
}
catch (Exception)
{
// ignored, table already exists
}
var tableName = TableName.FromProjectInstanceTable(_settings.ProjectId, _settings.InstanceId, tableId);
var rowKey = ByteString.CopyFromUtf8("row-key-0");
var mutateRowRequest = new MutateRowRequest()
{
TableNameAsTableName = tableName,
RowKey = ByteString.CopyFromUtf8("row-key-0"),
Mutations =
{
Mutations.SetCell(
"MyFamily1",
ByteString.CopyFromUtf8("my-qualifier"),
ByteString.CopyFromUtf8("in-family-1")),
Mutations.SetCell(
"MyFamily2",
ByteString.CopyFromUtf8("my-qualifier"),
ByteString.CopyFromUtf8("in-family-2"))
}
};
await _bigtableClient.MutateRowAsync(mutateRowRequest);
var row = await _bigtableClient.ReadRowAsync(tableName, rowKey);
foreach (var family in row.Families)
{
foreach (var column in family.Columns)
{
Console.WriteLine(column.Cells.First().Value.ToStringUtf8());
}
} The program only prints |
Right. I wrote a similar sample app and was able to reproduce this issue. In addition to different qualifiers working, I observed that if there is another cell with a different qualifier in the first family, then also all the column values are printed. I will further investigate tomorrow and update when I know more about it. Thanks. |
It looks like the problem is that when the family changes on lines: google-cloud-dotnet/apis/Google.Cloud.Bigtable.V2/Google.Cloud.Bigtable.V2/RowAsyncEnumerator.cs Lines 324 to 333 in 8e661bb
The _currentCell contents are not fully reset, only the family info is. So the specific tweak for this bug would be to reset currentCell.Column when FamilyName changes. One possible implementation would be: in the Family change if statement body set a flag familyChanged and use that as an or condition in the column if statement condition. |
Also, please add a test in the conformance test json file for this issue: |
Environment details
Steps to reproduce
Seems that the issue could be related to RowAsyncEnumerator;
google-cloud-dotnet/apis/Google.Cloud.Bigtable.V2/Google.Cloud.Bigtable.V2/RowAsyncEnumerator.cs
Line 335 in 8e661bb
The text was updated successfully, but these errors were encountered: