Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache ignite json field

Tags:

ignite

Perhaps I am missing this in the documentation, but is it possible to store and query against json data in Apache Ignite? For example, let's say I have a "table" called "cars" with the following fields:

model
blueprint

The "blueprint" field is actually a json field that may contain data such as:

{
    horsepower: 200,
    mpg: 30
}

Those are not the only fields for the "blueprint" field, and it may contain many more or less fields. Is it possible to run a query such as:

SELECT model FROM cars WHERE blueprint.horsepower < 300 AND blueprint.mpg > 20

It is not known in advance what the fields will be for the "blueprint" field, and creating indexes for them is not optional.

Note: This is not a conversation about if this is the logically optimal way to store this information, or how the "blueprint" field should be stored in a separate table. This question is meant to understand if querying against a json field is trivially possible in apache ignite.

like image 731
user396404 Avatar asked Oct 25 '25 05:10

user396404


1 Answers

This is not supported out of the box as for now. However, you can create conversion logic between JSON and Ignite binary format and save BinaryObjects in caches. To create a BinaryObject without a Java class, you can use binary object builder: https://apacheignite.readme.io/docs/binary-marshaller#modifying-binary-objects-using-binaryobjectbuilder

like image 87
Valentin Kulichenko Avatar answered Oct 26 '25 22:10

Valentin Kulichenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!