Caches can store objects of any type, there are no restrictions for "a
value type per caches". SQL tables support the following data types:
https://apacheignite-sql.readme.io/docs/data-types
-
Denis
On Mon, Apr 29, 2019 at 11:52 PM Scott Cote wrote:
> What are the restrictions around having tw
What are the restrictions around having two caches in an ignite node that use
the same value type?
Issues with the sql?
Can I have two sql tables of the same class type inside ignite?
I thought the answer was no, and saw results verifying that position, but I
cannot remember and cannot find th
Let me try to answer this question.
1. I would recommend to avoid this, because Ignite stores objects as binary
arrays, so you will have an object from A being stored as an array of bytes
in both: cache A and cache C, which obviously takes more memory. Another
reason not to use it is that you will
Hi,
I have three entities/POJOs ,say A, B and C which corresponds to tables A,
B, and C in persistence DB
public class A {
private int key;
private String name;
}
public class B {
private int key;
private String city;
}
public class C {
private int key;
priv
Hi Naveen,
> Does it mean we do not need to develop these classes OR
> just dont need to deployed on server node's classpath.
In case of using BinaryObject you do not need to create the key and value
types.
> How do I resolve this issue??
It seems that "CITY_DETAILS_BINARY" cache is not created
Hi Slava
Approach suggested by you still requires us to build the key and value
classes right, I was under impression that we dont need to build key and
value classes at all.
This is the snippet I got it from the docs. Does it mean we do not need to
develop these classes OR just dont need to dep
Hi Naveen,
Yes, you can get a whole key and value objects.
You need to do the following steps:
1. define a key and value types in the following way:
package com.ril.edif;
public class CityKey {
// Please make sure that the field, which is used as primary key,
annotated by AffinityKeyMapped,
This works, I could query the data.
If we dont have POJOs and use binary objects to read and write, how can
make rest API work.
If I understand correctly, Java classes should be on classpath of the
ignite node to work rest API. How can we make rest API work??
Also, instead of reading field by fiel
Hello Naveen,
It seems, you need to use BinaryObject for that
BinaryObjectBuilder builder =
ignite.binary().builder("com.ril.edif.cityKey");
builder.setField("city_id", new Long(1));
BinaryObject keyValue = builder.build();
IgniteCache cache =
ignite.cache("city_details").withKeepBinary();
Binar
Hi Ilya
I was going thru an example using BinaryObject and trying to follow the
same.
I have created a table with the below SQL DDL
CREATE TABLE city_details (
city_id LONG PRIMARY KEY, city_name VARCHAR, state_name VARCHAR )
WITH "backups=1, cache_name=city_details, key_type=com.ril.edif.c
Hello Naveen!
No, Ignite does not create the java class for value_type (and key_type). You
can either create the class yourself, or alternatively you can use
BinaryObject to add rows to backing cache, via get/put or DataStreamer for
example.
Please refer to our docs for more detail:
https://apach
I do have the same question.
When we execute the DDL statement for creating the table thru SQLLINE
with the value_type as some.package.MWorkPlan, does it create the java
class with this name and load it into JVM.
OR we need to create some.package.MWorkPlan class and refer while
creating the table
Hello!
I think that key_type and value_type should be fully qualified:
key_type=some.package.WorkPlanKey,value_type=some.package.MWorkPlan
If they don't match with type used with put(), you will not see the records
in SELECT.
Please also share the results of cache.size() after insert is done.
Let’s say I create a table using Ignite DDL:
CREATE TABLE IF NOT EXISTS M_WORK_PLAN (
entity_id VARCHAR(36),
entity_version INTEGER,
owner_idVARCHAR(36),
materialisation_version VARCHAR(20),
ehr_id VARCHAR(36),
materialisation_tim
14 matches
Mail list logo