You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by vkulichenko <va...@gmail.com> on 2017/02/07 22:52:44 UTC

Re: pure memory SQL Grid

Hi Lighfer,

Please properly subscribe to the mailing list so that the community can
receive email notifications for your messages. To subscribe, send empty
email to user-subscribe@ignite.apache.org and follow simple instructions in
the reply.


Lighfer wrote
> I hava billions of JSON data exported from MySQL, and want to import them
> to Apache Ignite cluster to use SQL JOIN feature to speed up the query,
> without connect to any database.
> 
> I use ignite-schema-import to generate POJO classes and CacheConfig, try
> to insert data(parsed from JSON) into cache, but I get this exception:
> class org.apache.ignite.IgniteCheckedException: Failed to start component:
> class org.apache.ignite.IgniteException: Failed to initialize cache store
> (data source is not provided).
> 
> In my case, I can only provide generate POJO classes and data in JSON
> format, Is it the wrong way I try? is that any other ways to archive my
> purpose?

Schema import utility is designed explicitely to integrate with RDBMS. Your
case is more specific, so you should manually create POJO classes and use
data streamer to load the data from JSON files:
https://apacheignite.readme.io/docs/data-loading#ignitedatastreamer

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/pure-memory-SQL-Grid-tp10464p10493.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: pure memory SQL Grid

Posted by vkulichenko <va...@gmail.com>.
BTW, schema utility is deprecated. It's better to use web console:
http://ignite.apache.org/addons.html#web-console

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/pure-memory-SQL-Grid-tp10464p10494.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: pure memory SQL Grid

Posted by Andrey Mashenkov <am...@gridgain.com>.
Hi Lighfer,

You can use UserRes object as a key and as a value at same time, but do not
forget to override hashcode() and equals() methods.

On Wed, Feb 8, 2017 at 11:57 AM, Lighfer <li...@gmail.com> wrote:

> thanks for your reply.
>
> Now it works, but there is a new problem, it looks like every table must
> has
> a _key field, how to deal with middle table?
>
> example:
> class User {
>     @QuerySqlField(index = true)
>     Integer userId;
>     ...
> }
>
> class Res {
>     @QuerySqlField(index = true)
>     Integer resId;
>     ...
> }
>
> class UserRes {
>     @QuerySqlField(index = true)
>     Integer userId;
>     @QuerySqlField(index = true)
>     Integer resId;
>     ...
> }
>
> The UserRes class has no field can be used as _key.
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/pure-memory-SQL-Grid-tp10464p10501.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: pure memory SQL Grid

Posted by Lighfer <li...@gmail.com>.
Thanks! It works!



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/pure-memory-SQL-Grid-tp10464p10515.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: pure memory SQL Grid

Posted by vkulichenko <va...@gmail.com>.
I would just generate unique key for each row. If you load from a single
node, it can be a simple integer or long value. For distributed ID
generation you can use atomic sequence:
https://apacheignite.readme.io/docs/id-generator

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/pure-memory-SQL-Grid-tp10464p10507.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: pure memory SQL Grid

Posted by Lighfer <li...@gmail.com>.
thanks for your reply.

Now it works, but there is a new problem, it looks like every table must has
a _key field, how to deal with middle table?

example: 
class User {
    @QuerySqlField(index = true)
    Integer userId;
    ...
}

class Res {
    @QuerySqlField(index = true)
    Integer resId;
    ...
}

class UserRes {
    @QuerySqlField(index = true)
    Integer userId;
    @QuerySqlField(index = true)
    Integer resId;
    ...
}

The UserRes class has no field can be used as _key.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/pure-memory-SQL-Grid-tp10464p10501.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.