[ISSUE] Enum vs BinaryEnum

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[ISSUE] Enum vs BinaryEnum

Henrique Arroyo
Hi,

I am experiencing an issue related to enum data types in ignite cluster,
the following message is displayed during object deserialization:

Caused by: class org.apache.ignite.binary.BinaryObjectException:
Unexpected field type [pos=33, expected=Enum, actual=Enum]


At first I was confused by the message but looking at the code I can see
that there are two types of enum

FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum";
FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_ENUM] = "Enum";

(
https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
)

I am updating that field in two different ways, one is directly using
cache.put and the other is using an SQL update query. I wonder if that is
the cause of the issue, but I don't understand why it would be, since both
use the same classes and enum type.
Any help in understanding what is going on so I can fix this would be
appreciated.

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: [ISSUE] Enum vs BinaryEnum

dmagda
Could you please share a reproducer with us?

-
Denis


On Tue, May 19, 2020 at 8:33 AM Henrique Arroyo
<[hidden email]> wrote:

> Hi,
>
> I am experiencing an issue related to enum data types in ignite cluster,
> the following message is displayed during object deserialization:
>
> Caused by: class org.apache.ignite.binary.BinaryObjectException:
> Unexpected field type [pos=33, expected=Enum, actual=Enum]
>
>
> At first I was confused by the message but looking at the code I can see
> that there are two types of enum
>
> FIELD_TYPE_NAMES[GridBinaryMarshaller.ENUM] = "Enum";
> FIELD_TYPE_NAMES[GridBinaryMarshaller.BINARY_ENUM] = "Enum";
>
> (
>
> https://github.com/apache/ignite/blob/master/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryUtils.java
> )
>
> I am updating that field in two different ways, one is directly using
> cache.put and the other is using an SQL update query. I wonder if that is
> the cause of the issue, but I don't understand why it would be, since both
> use the same classes and enum type.
> Any help in understanding what is going on so I can fix this would be
> appreciated.
>
> Thank you
>