You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Sergi Vladykin <se...@gmail.com> on 2017/04/21 07:21:29 UTC

Re: Usage of Enums in SQL (Ignite 2.0)

This ticket is about being able to use enums as INT and VARCHAR literals in
SQL like this:

SELECT name FROM person WHERE job = 'BOSS' or job = 2

Previously you had to always use ? parameters and set enum as a Java object
there, but this is impossible for any usual SQL console. Now we will be
able to use constant name or ordinal as a literal.

Sergi

2017-04-21 3:39 GMT+03:00 Denis Magda <dm...@apache.org>:

> Alexander P., Sergi,
>
> Could you give me an example on how to use enums in SQL queries [1] from
> the user standpoint?
>
> It will be ideal if you write a code snippet that demonstrates it. Right
> after that I’ll add a special section in our SQL Grid documentation.
>
>
> [1] https://issues.apache.org/jira/browse/IGNITE-3595 <
> https://issues.apache.org/jira/browse/IGNITE-3595>
>
> —
> Denis
>
>

Re: Usage of Enums in SQL (Ignite 2.0)

Posted by Denis Magda <dm...@gridgain.com>.
Sergi,

That makes total sense. Thanks for adding the feature!

—
Denis

> On Apr 21, 2017, at 12:21 AM, Sergi Vladykin <se...@gmail.com> wrote:
> 
> This ticket is about being able to use enums as INT and VARCHAR literals in
> SQL like this:
> 
> SELECT name FROM person WHERE job = 'BOSS' or job = 2
> 
> Previously you had to always use ? parameters and set enum as a Java object
> there, but this is impossible for any usual SQL console. Now we will be
> able to use constant name or ordinal as a literal.
> 
> Sergi
> 
> 2017-04-21 3:39 GMT+03:00 Denis Magda <dm...@apache.org>:
> 
>> Alexander P., Sergi,
>> 
>> Could you give me an example on how to use enums in SQL queries [1] from
>> the user standpoint?
>> 
>> It will be ideal if you write a code snippet that demonstrates it. Right
>> after that I’ll add a special section in our SQL Grid documentation.
>> 
>> 
>> [1] https://issues.apache.org/jira/browse/IGNITE-3595 <
>> https://issues.apache.org/jira/browse/IGNITE-3595>
>> 
>> —
>> Denis
>> 
>>