Usage of Enums in SQL (Ignite 2.0)

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

Usage of Enums in SQL (Ignite 2.0)

dmagda
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

Reply | Threaded
Open this post in threaded view
|

Re: Usage of Enums in SQL (Ignite 2.0)

Sergi
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 <[hidden email]>:

> 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
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Usage of Enums in SQL (Ignite 2.0)

Denis Magda
Sergi,

That makes total sense. Thanks for adding the feature!


Denis

> On Apr 21, 2017, at 12:21 AM, Sergi Vladykin <[hidden email]> 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 <[hidden email]>:
>
>> 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
>>
>>