You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Harsh Mishra <ha...@quovantis.com> on 2018/05/30 14:53:56 UTC

Blocked: Migrate PosgreSQL JSONB data in Apache Ignite

Hi,

Objective: JSON handling in Apache Ignite

I am using PostgreSQL database and one table has JSONB data type so I can
add any type of key in DB.
How to handle this case in Apache Ignite.

TABLE STRUCTURE(Partial)

    app_member_id character varying(64) DEFAULT NULL::character varying,
    mobile_os character varying(64) DEFAULT NULL::character varying,
    app_name character varying(64) DEFAULT NULL::character varying,
    deleted boolean DEFAULT false,
    preferred_language bigint,
    client_member_id character varying(256) DEFAULT NULL::character varying,
*    custom_data jsonb DEFAULT '{}'::jsonb,*
    encrypted_data bytea,
    useragent text,


Data in custom_data column is like this but key name is dynamic. I do read
update these custom fields very frequently.

{"date1": "2018-05-16", "time1": "00:30:00", "number2": 123, "picklist1":
5, "paragraph1": "I am loving elasticsearch.", "singleline1": "Singleline1
data", "multipicklist1": [7, 8]}

Please let me know, I am right now blocked.

-- 

Regards,
*Harsh Mishra** | Solution Architect*
Quovantis Technologies
Mobile: +91-9958311308
Skype ID: harshmishra1984
www.quovantis.com

Re: Blocked: Migrate PosgreSQL JSONB data in Apache Ignite

Posted by "ilya.kasnacheev" <il...@gmail.com>.
Hello!

It should be possible to do all four using Cache API:

1. cache.put()
2. cache.invoke()
3. cache.remove()
4. cache.query(new SqlQuery())

Now 5. is problematic with cache API, since doing joins limits you to SQL,
which can't have any specific handling for your JSON.

Regards,



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

Re: Blocked: Migrate PosgreSQL JSONB data in Apache Ignite

Posted by Harsh Mishra <ha...@quovantis.com>.
Hi Iliya,

Thanks for the reply. I will follow your suggestions.

Does cache API support full document post and Partial update?

API doc seems confusing.

In my case, a table has all normal columns(int, varchar, char, boolean,
date, timestamp) + a custom column that has JSON data.

My requirement is:
1. Add new record.
2. Update - Full or partial. I have JSON, Array fields also.
3. Delete
4. Querying it? by many where clauses which can have string operations,
logical operators and date operators.

5. JoIN(for now, It's optional)
I could not find something which can fulfill all mentioned cases.


- Harsh



On Wed, May 30, 2018 at 9:05 PM, ilya.kasnacheev <il...@gmail.com>
wrote:

> Hello!
>
> Apache Ignite in SQL mode doesn't have special support for
> "destructure-able" datatypes. This means you can put your JSON into VARCHAR
> or BLOB and hope that performance will be sufficient.
>
> I would recommend using Cache API instead of SQL for such use cases, where
> you can collocate processing with data and handle complex data structures.
> Do affinity calls or use StreamReceiver, save on round-trips.
>
> Regards,
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Regards,
*Harsh Mishra** | Solution Architect*
Quovantis Technologies
Mobile: +91-9958311308
Skype ID: harshmishra1984
www.quovantis.com

Re: Blocked: Migrate PosgreSQL JSONB data in Apache Ignite

Posted by "ilya.kasnacheev" <il...@gmail.com>.
Hello!

Apache Ignite in SQL mode doesn't have special support for
"destructure-able" datatypes. This means you can put your JSON into VARCHAR
or BLOB and hope that performance will be sufficient.

I would recommend using Cache API instead of SQL for such use cases, where
you can collocate processing with data and handle complex data structures.
Do affinity calls or use StreamReceiver, save on round-trips.

Regards,



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