You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Henrique Arroyo <he...@ifood.com.br.INVALID> on 2020/05/19 13:36:02 UTC

[ISSUE] Enum vs BinaryEnum

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

Re: [ISSUE] Enum vs BinaryEnum

Posted by Denis Magda <dm...@apache.org>.
Could you please share a reproducer with us?

-
Denis


On Tue, May 19, 2020 at 8:33 AM Henrique Arroyo
<he...@ifood.com.br.invalid> 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
>