You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "kcheng.mvp" <kc...@gmail.com> on 2018/11/20 02:46:20 UTC

New added property with @QuerySqlField does not persist


My case is very similar with this one
http://apache-ignite-users.70518.x6.nabble.com/SQL-cannot-find-data-of-new-class-definition-td22081.html


I add the new column(property) via sql as addressed in the
http://apache-ignite-users.70518.x6.nabble.com/SQL-cannot-find-data-of-new-class-definition-td22081.html,

after this *I can query with sql on the new added column(property).* but
when I try to put data to cache 
via

IgniteCache.put()


I found the value for the new added column(property) is `null`, in fact I
have set value on this object.

is this a bug or i missed something?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: New added property with @QuerySqlField does not persist

Posted by Dmitry Lazurkin <di...@gmail.com>.
Try to print putted object with new field from java code. Column in
QueryEntity is just link to binary object field. So you may be have
different names for binary field and column.

PS. I use ignite 2.6 and don't have problems with new fields/columns.

On 11/22/18 05:26, kcheng.mvp wrote:
> Thank you very much!
>
> how to handle this case in production?
>
> it's too common to add new attribute to a new cache/pojo attribute.!!!
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/



Re: New added property with @QuerySqlField does not persist

Posted by "kcheng.mvp" <kc...@gmail.com>.
Thank you very much!

how to handle this case in production?

it's too common to add new attribute to a new cache/pojo attribute.!!!




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: New added property with @QuerySqlField does not persist

Posted by Ray <ra...@cisco.com>.
Actually you can't, because the schema stored in cache configuration is the
old one before adding column.

I've asked a similar question on dev list.

http://apache-ignite-developers.2346864.n4.nabble.com/Schema-in-CacheConfig-is-not-updated-after-DDL-commands-Add-drop-column-Create-drop-index-td38002.html



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: New added property with @QuerySqlField does not persist

Posted by "kcheng.mvp" <kc...@gmail.com>.
Thank you reply very much!
May be I don't address the issue clearly.

here is my steps:

1: keep the server running
2: alter the schema via sql
3: I can query the new add column
4: add the corresponding attribute in pojo and with tag it with
@QuerySqlField.
5: call IgniteCache.put with new version pojo
6: the value of the new added column is null, in fact I have set value for
the corresponding pojo attribute.


my question is how to make the new added pojo attribute take effect when use
it with cache api(IgniteCache.put/get)





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: New added property with @QuerySqlField does not persist

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi,

If you want to change sql schema after start, you have to use ALTER TABLE
command: https://apacheignite-sql.readme.io/docs/alter-table

Best Regards,
Evgenii

вт, 20 нояб. 2018 г. в 06:37, kcheng.mvp <kc...@gmail.com>:

> i noticed there is a comment from @slava.koptilin
>
> > I think the problem is to support dynamic update of fields in
> QueryEntity.
> I am afraid that there is no plan to support that. At least, I didn't find
> a
> ticket in JIRA.
>
>
> is there any plan to add this feature?
>
> it's obviously with the system goes on, new columns/properties will be
> added.
>
> Thanks!
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: New added property with @QuerySqlField does not persist

Posted by "kcheng.mvp" <kc...@gmail.com>.
i noticed there is a comment from @slava.koptilin

> I think the problem is to support dynamic update of fields in QueryEntity. 
I am afraid that there is no plan to support that. At least, I didn't find a 
ticket in JIRA. 


is there any plan to add this feature?

it's obviously with the system goes on, new columns/properties will be
added.

Thanks! 



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/