[ 
https://issues.apache.org/jira/browse/IGNITE-27705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pavel Tupitsyn updated IGNITE-27705:
------------------------------------
    Description: 
*table.GetKeyValueView<Guid, string>()* requires reflection, which is 
unexpected with simple native types.

I was trying to make a small demo and run it with `dotnet run app.cs` 
(https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-app/), and it 
failed to run:

{code}
Unhandled exception. System.PlatformNotSupportedException: Dynamic code 
generation is not supported on this platform.
   at System.Reflection.Emit.AssemblyBuilder.ThrowDynamicCodeNotSupported()
   at System.Reflection.Emit.AssemblyBuilder.EnsureDynamicCodeSupported()
   at System.Reflection.Emit.DynamicMethod.Init(String name, MethodAttributes 
attributes, CallingConventions callingConvention, Type returnType, Type[] 
signature, Type owner, Module m, Boolean skipVisibility, Boolean 
transparentMethod)
   at System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, 
Type[] parameterTypes, Module m, Boolean skipVisibility)
   at 
Apache.Ignite.Internal.Table.Serialization.ObjectSerializerHandler`1.EmitWriter(Schema
 schema, Boolean keyOnly)
   at 
Apache.Ignite.Internal.Table.Serialization.ObjectSerializerHandler`1.Write(BinaryTupleBuilder&
 tupleBuilder, T record, Schema schema, Boolean keyOnly, Span`1 noValueSet)
   at 
Apache.Ignite.Internal.Table.Serialization.IRecordSerializerHandler`1.Write(MsgPackWriter&
 writer, Schema schema, T record, Boolean keyOnly, Boolean computeHash)
   at 
Apache.Ignite.Internal.Table.Serialization.RecordSerializer`1.WriteWithHeader(MsgPackWriter&
 w, Nullable`1 txId, Schema schema, T rec, Boolean keyOnly)
   at 
Apache.Ignite.Internal.Table.Serialization.RecordSerializer`1.Write(PooledArrayBuffer
 buf, Nullable`1 txId, Schema schema, T rec, Boolean keyOnly)
   at Apache.Ignite.Internal.Table.RecordView`1.DoRecordOutOpAsync(ClientOp op, 
ITransaction transaction, T record, Boolean keyOnly, Nullable`1 
schemaVersionOverride)
   at Apache.Ignite.Internal.Table.RecordView`1.UpsertAsync(ITransaction 
transaction, T record)
   at Apache.Ignite.Internal.Table.KeyValueView`2.PutAsync(ITransaction 
transaction, TK key, TV val)
{code}

We should provide mappers for supported types and not rely on reflection.

  was:
*table.GetKeyValueView<Guid, string>()* requires reflection, which is 
unexpected with simple native types.

I was trying to make a small demo and run it with `dotnet run app.cs` 
(https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-app/), and it 
failed to run:

{code}
Unhandled exception. System.PlatformNotSupportedException: Dynamic code 
generation is not supported on this platform.
   at System.Reflection.Emit.AssemblyBuilder.ThrowDynamicCodeNotSupported()
   at System.Reflection.Emit.AssemblyBuilder.EnsureDynamicCodeSupported()
   at System.Reflection.Emit.DynamicMethod.Init(String name, MethodAttributes 
attributes, CallingConventions callingConvention, Type returnType, Type[] 
signature, Type owner, Module m, Boolean skipVisibility, Boolean 
transparentMethod)
   at System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, 
Type[] parameterTypes, Module m, Boolean skipVisibility)
   at 
Apache.Ignite.Internal.Table.Serialization.ObjectSerializerHandler`1.EmitWriter(Schema
 schema, Boolean keyOnly)
   at 
Apache.Ignite.Internal.Table.Serialization.ObjectSerializerHandler`1.Write(BinaryTupleBuilder&
 tupleBuilder, T record, Schema schema, Boolean keyOnly, Span`1 noValueSet)
   at 
Apache.Ignite.Internal.Table.Serialization.IRecordSerializerHandler`1.Write(MsgPackWriter&
 writer, Schema schema, T record, Boolean keyOnly, Boolean computeHash)
   at 
Apache.Ignite.Internal.Table.Serialization.RecordSerializer`1.WriteWithHeader(MsgPackWriter&
 w, Nullable`1 txId, Schema schema, T rec, Boolean keyOnly)
   at 
Apache.Ignite.Internal.Table.Serialization.RecordSerializer`1.Write(PooledArrayBuffer
 buf, Nullable`1 txId, Schema schema, T rec, Boolean keyOnly)
   at Apache.Ignite.Internal.Table.RecordView`1.DoRecordOutOpAsync(ClientOp op, 
ITransaction transaction, T record, Boolean keyOnly, Nullable`1 
schemaVersionOverride)
   at Apache.Ignite.Internal.Table.RecordView`1.UpsertAsync(ITransaction 
transaction, T record)
   at Apache.Ignite.Internal.Table.KeyValueView`2.PutAsync(ITransaction 
transaction, TK key, TV val)
{code}


> .NET: Primitive mapping requires reflection
> -------------------------------------------
>
>                 Key: IGNITE-27705
>                 URL: https://issues.apache.org/jira/browse/IGNITE-27705
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms ai3, thin clients ai3
>            Reporter: Pavel Tupitsyn
>            Assignee: Pavel Tupitsyn
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.2
>
>
> *table.GetKeyValueView<Guid, string>()* requires reflection, which is 
> unexpected with simple native types.
> I was trying to make a small demo and run it with `dotnet run app.cs` 
> (https://devblogs.microsoft.com/dotnet/announcing-dotnet-run-app/), and it 
> failed to run:
> {code}
> Unhandled exception. System.PlatformNotSupportedException: Dynamic code 
> generation is not supported on this platform.
>    at System.Reflection.Emit.AssemblyBuilder.ThrowDynamicCodeNotSupported()
>    at System.Reflection.Emit.AssemblyBuilder.EnsureDynamicCodeSupported()
>    at System.Reflection.Emit.DynamicMethod.Init(String name, MethodAttributes 
> attributes, CallingConventions callingConvention, Type returnType, Type[] 
> signature, Type owner, Module m, Boolean skipVisibility, Boolean 
> transparentMethod)
>    at System.Reflection.Emit.DynamicMethod..ctor(String name, Type 
> returnType, Type[] parameterTypes, Module m, Boolean skipVisibility)
>    at 
> Apache.Ignite.Internal.Table.Serialization.ObjectSerializerHandler`1.EmitWriter(Schema
>  schema, Boolean keyOnly)
>    at 
> Apache.Ignite.Internal.Table.Serialization.ObjectSerializerHandler`1.Write(BinaryTupleBuilder&
>  tupleBuilder, T record, Schema schema, Boolean keyOnly, Span`1 noValueSet)
>    at 
> Apache.Ignite.Internal.Table.Serialization.IRecordSerializerHandler`1.Write(MsgPackWriter&
>  writer, Schema schema, T record, Boolean keyOnly, Boolean computeHash)
>    at 
> Apache.Ignite.Internal.Table.Serialization.RecordSerializer`1.WriteWithHeader(MsgPackWriter&
>  w, Nullable`1 txId, Schema schema, T rec, Boolean keyOnly)
>    at 
> Apache.Ignite.Internal.Table.Serialization.RecordSerializer`1.Write(PooledArrayBuffer
>  buf, Nullable`1 txId, Schema schema, T rec, Boolean keyOnly)
>    at Apache.Ignite.Internal.Table.RecordView`1.DoRecordOutOpAsync(ClientOp 
> op, ITransaction transaction, T record, Boolean keyOnly, Nullable`1 
> schemaVersionOverride)
>    at Apache.Ignite.Internal.Table.RecordView`1.UpsertAsync(ITransaction 
> transaction, T record)
>    at Apache.Ignite.Internal.Table.KeyValueView`2.PutAsync(ITransaction 
> transaction, TK key, TV val)
> {code}
> We should provide mappers for supported types and not rely on reflection.



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

Reply via email to