Pavel Tupitsyn created IGNITE-27655:
---------------------------------------

             Summary: .NET: GetPartitionAsync(tuple) fails on non-key columns
                 Key: IGNITE-27655
                 URL: https://issues.apache.org/jira/browse/IGNITE-27655
             Project: Ignite
          Issue Type: Bug
          Components: platforms ai3, thin clients ai3
            Reporter: Pavel Tupitsyn
            Assignee: Pavel Tupitsyn
             Fix For: 3.2


GetPartitionAsync fails on a full tuple (key+val):

{code}
var tuple1 = GetTuple(1, "foo");

await Table.RecordBinaryView.UpsertAsync(null, tuple1); // Ok
await Table.PartitionDistribution.GetPartitionAsync(tuple1); // Fail
{code}

Exception:
{code}
System.ArgumentException : Tuple doesn't match schema: schemaVersion=1, 
extraColumns=VAL
Data:
  UnmappedColumnsPresent: True
   at 
Apache.Ignite.Internal.Table.Serialization.TupleSerializerHandler.ValidateMappedCount(IIgniteTuple
 record, Schema schema, Int32 columnCount, Int32 written) in 
/home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Table/Serialization/TupleSerializerHandler.cs:line
 146
   at 
Apache.Ignite.Internal.Table.Serialization.TupleSerializerHandler.Write(BinaryTupleBuilder&
 tupleBuilder, IIgniteTuple record, Schema schema, Boolean keyOnly, Span`1 
noValueSet) in 
/home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Table/Serialization/TupleSerializerHandler.cs:line
 117
   at 
Apache.Ignite.Internal.Table.Serialization.IRecordSerializerHandler`1.GetKeyColocationHash(Schema
 schema, T key) in 
/home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Table/Serialization/IRecordSerializerHandler.cs:line
 82
   at 
Apache.Ignite.Internal.Table.PartitionManager.GetPartitionInternalAsync[TK](TK 
key, IRecordSerializerHandler`1 serializerHandler) in 
/home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite/Internal/Table/PartitionManager.cs:line
 232
   at Apache.Ignite.Tests.Table.RecordViewBinaryTests.TestUpsertGet() in 
/home/pavel/w/ignite-3/modules/platforms/dotnet/Apache.Ignite.Tests/Table/RecordViewBinaryTests.cs:line
 45
{code}

This works in Java:
{code}
    @Test
    public void testGetPartitionForKeyIgnoresExtraColumns() {
        Tuple keyTuple = Tuple.create().set("key", 42);
        Tuple fullTuple = Tuple.create().set("key", 42).set("val", "unused");

        var part1 = partitionDistribution().partition(keyTuple);
        var part2 = partitionDistribution().partition(fullTuple);

        assertThat(part1, equalTo(part2));
    }
{code}

We should not force the user to remove value columns just to compute the 
partition.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to