ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitriy Setrakyan <dsetrak...@apache.org>
Subject Re: Improve binary enum handling
Date Mon, 24 Apr 2017 13:28:57 GMT
Vladimir,

I am very confused. I thought we already had resolved this issue in this
ticket:
https://issues.apache.org/jira/browse/IGNITE-3595

Can you clarify?

D.

On Mon, Apr 24, 2017 at 5:58 AM, Vladimir Ozerov <vozerov@gridgain.com>
wrote:

> Igniters,
>
> Currently we have limited support of binary enums. The main problem is that
> we do not store any metadata about enum names. For this reason it is
> impossible to use enums in SQL even though H2 already supports it [1]. We
> need to improve enum metadata support and provide some additional API to
> register new enums in runtime.
>
> Proposed API:
>
> 1) Enum mappings can be defined statically in BinaryTypeConfiguration:
>
> class BinaryTypeConfiguration {
>     boolean isEnum;                  // Old method
>     *Map<String, Integer> enumValues;* // New method
> }
>
> 2) New enum could be registered through IgniteBinary (e.g. we will use it
> if enum is defined in CREATE TABLE statement). Elso it would be possible to
> build enum using only name.
>
> interface IgniteBinary {
>     BinaryObject buildEnum(String typeName, int ordinal);              //
> Old
>     *BinaryObject buildEnum(String typeName, String name); *             //
> New
>
>     *BinaryType defineEnum(String typeName, Map<String, Integer> vals);* //
> New
> }
>
> 3) BinaryObject will have new method "enumName":
>
> interface BinaryObject {
>     enumOrdinal();     // Old
>     *String enumName();* // New
> }
>
> 4) It would be possible to get the list of known values from BinaryType:
>
> interface BinaryType {
>     boolean isEnum();                      // Old
>     *Collection<BinaryObject> enumValues();* // New
> }
>
> Thoughts?
>
> Vladimir.
>
> [1] https://github.com/h2database/h2database/pull/487/commits
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message