Comments (9)
If you use GetRawWriter
, it will work with key/value API, but not with SQL.
the attributes of Address type is not getting saved to Employee table
Please share the code. What do you mean by "not getting saved to Employee table" - how do you see that?
from ignite.
@ptupitsyn Thank you for your response. This is what I have been trying to do.
DDL statement. I have created the following table by executing the DDL statement from Database Manager (DBeaver).
CREATE TABLE IF NOT EXISTS employee (
id int,
name varchar,
companyid varchar,
age int,
city varchar,
street varchar,
streetnumber int,
flatnumber int,
PRIMARY KEY (id)
) WITH "template=partitioned,backups=1,WRITE_SYNCHRONIZATION_MODE=FULL_SYNC,CACHE_GROUP=Employee,CACHE_NAME=Employee,KEY_TYPE=int,VALUE_TYPE=Employee";
After that I have executed the following program to create an employee record , however the address details are not getting saved
ignite-sample.zip
Employee Table view
from ignite.
Address.WriteBinary
uses GetRawWriter
, which does not work with SQL.
Basically there is no mapping between field names and values, just some bytes, Ignite does not know where the City
value is an so on.
Fix Address
class to use IBinaryWriter
with field names like you do in Employee
.
We have an example with this approach: https://github.com/apache/ignite/blob/079f49d1a5acbed0bdb0a25d3674fecd71769bfe/modules/platforms/dotnet/examples/Thick/Sql/Sql/Program.cs
P.S. When sharing code, please avoid including binaries (bin
, obj
).
from ignite.
@ptupitsyn Thank you for your help.
I did try as shown in example but let me check again. One difference was I started as a Ignite client. I'm still trying to figure out the difference between Ignite.Start() and Ignite.StartClient(). That was one difference from what I did when compared to the example.
from ignite.
still trying to figure out the difference between Ignite.Start() and Ignite.StartClient()
Ignition.Start()
creates an embedded server node, which becomes a part of the cluster, stores data, executes computations, etc. This is a powerful mode but may require a lot of resources.Ignition.StartClient()
starts a lightweight thin client. It has some limitations compared to embedded mode, but is a lot quicker to start, does not require Java and consumes little resources
We recommend the thin client by default, but the API is very similar and you can switch back and forth if the requirements change.
For IBinarizable
and SQL there is no difference, both modes work exactly the same.
from ignite.
@ptupitsyn Thank you that cleared by confusions.
However this issue still persist, the Address fields are not updated. Although the data is not serialized to these fields, I can see the values are there in the cache. Is it because while creating the table using the ddl statement we have the VALUE_TYPE as Employee and the ignite server is unware of the "Address" type ?
Attaching the sample code with the updated implementation
ignite-sample.zip
from ignite.
Adding address object
column to your DDL script fixes the issue.
SQL engine does not drill down the nested object if there is no matching column.
from ignite.
DL statement.
CREATE TABLE IF NOT EXISTS synim_tab.employee (
id int,
name varchar,
companyid varchar,
age int,
city varchar,
street varchar,
streetnumber int,
flatnumber int,
PRIMARY KEY (id)
) WITH "template=partitioned,backups=1,WRITE_SYNCHRONIZATION_MODE=FULL_SYNC,CACHE_GROUP=Employee,CACHE_NAME=Employee,KEY_TYPE=int,VALUE_TYPE=Employee";
What would be the data type of address ?If I add address as a column then how are this fields of address (city, streetnumber, flatnumber) going to be mapped ?
from ignite.
CREATE TABLE IF NOT EXISTS employee (
id int,
name varchar,
address object,
companyid varchar,
age int,
city varchar,
street varchar,
streetnumber int,
flatnumber int,
PRIMARY KEY (id)
) WITH "template=partitioned,backups=1,WRITE_SYNCHRONIZATION_MODE=FULL_SYNC,CACHE_GROUP=Employee,CACHE_NAME=Employee,KEY_TYPE=int,VALUE_TYPE=Employee";
Just add address object
column and run your code, it will work.
from ignite.
Related Issues (20)
- Continuous query using NodeJS client HOT 2
- we need go client sdk HOT 11
- Is there any plan to support window aggregation in Calcite Query Engine
- Is Ignite 2.16.0 impacted by CVE-2024-22243 ? HOT 1
- I am running a 3-node external cluster, but I find that the memory is growing slowly. By checking the top, I can see that the buffer/cache has been growing slowly and has not been released. What is the reason for this
- Ignite 2.16 is incompatible with recent h2database, h2 must be shaded HOT 2
- Ignite Getting started guide for Java missing something (gives errors) HOT 2
- Question: Ignite client instance HOT 8
- Support Apache Arrow serialization transfer
- How do I reset the expiration time after ignite sets the expiration time
- In ignite2.16.0 and jdk21, run task with lambda expression, it can not run.
- CPU goes crazy in ignite server
- Spring boot 3 support for Ignite
- Question: CacheStore Configuration using DDL HOT 3
- Question: Apache ignite on kubernetes with Proxy HOT 2
- Ignite cluster discovery HOT 1
- Out of direct memory where flush wal buffer to disk in flush method, please ensure this.
- lz4 upgrade HOT 1
- Unable to connect to ignite with persistence enabled HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ignite.