Hello!

You can add fields to existing SQL-backed cache using ALTER TABLE ... ADD
COLUMN command:
https://apacheignite-sql.readme.io/docs/alter-table

The recommendation for your use case, where the layout of dat1a is expected
to change, is to just use SQL (DDL) defined tables and forget about
BinaryObject's.

With regards to your original case, i.e., a different class definition: I
could spend time debugging it if you had more info, but this approach is
not recommended anyway.

Regards,

-- 
Ilya Kasnacheev

2018-06-15 16:29 GMT+03:00 Cong Guo <[email protected]>:

> Hi all,
>
>
>
> I am trying to use BinaryObject to support data of different class
> definitions in one cache. This is for my system upgrade. I first start a
> cache with data, and then launch a new node to join the cluster and put new
> data into the existing cache. The new data has a different class
> definition. I use the same class name, but add a member to the class. I can
> add the objects of this new class to the cache. The cache size changes and
> I can get both the new and old data using keys. However, when I use
> SQLFieldsQuery like “select id from myclassname” where id is a member
> exists in both the versions of classes, I can get only the old data. There
> is no error or exception. SQL just cannot find the data of the new class
> definition.
>
>
>
> How can I use SQL queries to find both the new and old data? The new data
> is in the cache, but it seems not being in the table using my class name.
> Where is the new data? Is there a new table? If yes, what is the table
> name? I do not expect to see the new column using the old query. I just
> hope to see the old fields of new data using the old queries.
>
>
>
> BTW, I use QueryEntity to set up fields and indexes in my codes. Does
> anyone has an example about how to add fields to existing cache
> dynamically? Thank you!
>

Reply via email to