You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by saikiran939 <sa...@gmail.com> on 2017/09/12 08:11:06 UTC
Possibility of default SQL functions to query 'Map' or 'List' based
attributes
Hi Members,
We are using Ignite cache to store and querying data from the cache. The
POJO object for cache has Map of Maps e.g Map<String, Map<String,
String>> based attribute values.
Presently we are using custom SQL function to query these map based
attribute. Code would look something like below:
@QuerySqlFunction
public static String getAttribute(Object param, String aName , String
aAttributeName ) {
HashMap attributeMap = (HashMap)((HashMap)param).get(aCategoryName);
if(attributeMap==null)
return null;
return (String)attributeMap.get(aAttributeName);
}
The query makes use of this function as:
SELECT * FROM AttributesCache WHERE hash = ? AND (
getAttribute(attributeMap,?,?) LIKE ? )
Here attributeMap is the variable name of Map<String, Map<String,
String>> attribute.
By making use of such Map based representation we were able to avoid more
than one cache and therefore we could avoid inner joins during querying and
transactions during update operation.
But the usage of this function warrants us to have this SQL function on
Ignite server node but we are aiming to remove classes not to be present at
ignite server node.
My question is - is it possible for Ignite team to have such useful/common
Custom SQL functions (like querying Map or List or Collection) shipped
out-of-the-box ignite core jar ? This can help us in avoiding deploying such
basic sql functions class files at server node and everyone can benefit from
such sql functions.
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: Possibility of default SQL functions to query 'Map' or 'List'
based attributes
Posted by Konstantin Dudkov <kd...@ya.ru>.
Hi,
I think the best way is to discuss this topic on devlist
(dev@ignite.apache.org) and to make a pull request if community agrees with
your opinion.
Regards,
Konstantin
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/