You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Hyma <hy...@gmail.com> on 2019/03/15 11:40:27 UTC

LIKE operator on Array column in Apache ignite SQL

Hi, 

Is there a way we can do like query on array field in ignite sql.

Able to retrieve records on exact search using array_contains function like
select * from market where array_contains(name,'LACL') - here name is an
array object



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: LIKE operator on Array column in Apache ignite SQL

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

Writing such function is easy (you probably could do that using custom SQL
functions already), but optimizing and indexing such function is very
non-trivial.

And users of RDBMS expect that core functionality will be sufficiently
optimized.

Regards,
-- 
Ilya Kasnacheev


пн, 18 мар. 2019 г. в 13:41, James Wang 王升平 (edvance CN) <
james.wang@edvancesecurity.com>:

> I recommend that Ignite can implement a function using JSON Path to handle
> such ArrayList type.
>
>
>
> Since most of RDBS supports JSON PATH now like MSSQL. It would be easier
> for developer to handle with nested object or JSON string.
>
>
>
> Before Ignite implement this, developer have to implement a  customized
> function for it.
>
>
>
> Best Regards,
>
> James Wang
>
> M/WeChat: +86 135 1215 1134
>
>
>
> *From:* aealexsandrov <ae...@gmail.com>
> *Sent:* Saturday, March 16, 2019 05:06 AM
> *To:* user@ignite.apache.org
> *Subject:* Re: LIKE operator on Array column in Apache ignite SQL
>
>
>
> Hi,
>
> Ignite SQL engine supports only the next types:
>
> https://apacheignite-sql.readme.io/docs/data-types
>
> Also all existed functions you can see here:
>
> https://apacheignite-sql.readme.io/docs/sql-reference-overview
>
> So there is no way to work with arrays as DataTypes even if you set them as
> type in QueryEntity.  Possible that you can add some new boolean SQL fields
> to the object that contains the array:
>
> public class Market{
>     @QuerySqlField(index = true)
>     private java.lang.String id;
>     @QuerySqlField
>     private java.lang.Boolean isContainLacl;
>     @QuerySqlField
>     private ArrayList<String> array;
>
> select * from market where isContainLacl = true;
>
> You can fill this boolean flag when generating the Market object.
>
> BR,
> Andrei
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>
> This message contains information that is deemed confidential and
> privileged. Unless you are the addressee (or authorized to receive for the
> addressee), you may not use, copy or disclose to anyone the message or any
> information contained in the message. If you have received the message in
> error, please advise the sender by reply e-mail and delete the message.
>

RE: LIKE operator on Array column in Apache ignite SQL

Posted by "James Wang 王升平 (edvance CN)" <ja...@edvancesecurity.com>.
I recommend that Ignite can implement a function using JSON Path to handle such ArrayList type.

Since most of RDBS supports JSON PATH now like MSSQL. It would be easier for developer to handle with nested object or JSON string.

Before Ignite implement this, developer have to implement a  customized function for it.

Best Regards,
James Wang
M/WeChat: +86 135 1215 1134

From: aealexsandrov <ae...@gmail.com>>
Sent: Saturday, March 16, 2019 05:06 AM
To: user@ignite.apache.org<ma...@ignite.apache.org>
Subject: Re: LIKE operator on Array column in Apache ignite SQL

Hi,

Ignite SQL engine supports only the next types:

https://apacheignite-sql.readme.io/docs/data-types

Also all existed functions you can see here:

https://apacheignite-sql.readme.io/docs/sql-reference-overview

So there is no way to work with arrays as DataTypes even if you set them as
type in QueryEntity.  Possible that you can add some new boolean SQL fields
to the object that contains the array:

public class Market{
    @QuerySqlField(index = true)
    private java.lang.String id;
    @QuerySqlField
    private java.lang.Boolean isContainLacl;
    @QuerySqlField
    private ArrayList<String> array;

select * from market where isContainLacl = true;

You can fill this boolean flag when generating the Market object.

BR,
Andrei



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
This message contains information that is deemed confidential and privileged. Unless you are the addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail and delete the message.

Re: LIKE operator on Array column in Apache ignite SQL

Posted by aealexsandrov <ae...@gmail.com>.
Hi,

Ignite SQL engine supports only the next types:

https://apacheignite-sql.readme.io/docs/data-types

Also all existed functions you can see here:

https://apacheignite-sql.readme.io/docs/sql-reference-overview

So there is no way to work with arrays as DataTypes even if you set them as
type in QueryEntity.  Possible that you can add some new boolean SQL fields
to the object that contains the array:

public class Market{
    @QuerySqlField(index = true)
    private java.lang.String id;
    @QuerySqlField
    private java.lang.Boolean isContainLacl;
    @QuerySqlField
    private ArrayList<String> array;

select * from market where isContainLacl = true;

You can fill this boolean flag when generating the Market object.

BR,
Andrei



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/