You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ratadepally (via GitHub)" <gi...@apache.org> on 2024/09/12 15:13:30 UTC
[I] Question: Ignite issue with Mapping of Value Type Object [ignite]
ratadepally opened a new issue, #11531:
URL: https://github.com/apache/ignite/issues/11531
Hi
We are currently facing an issue with mapping cache data to value object.
We actually came across a scenario where if the data is inserted to cache through DML statements which is INSERT In our case
then after that when we try to retrieve the data using cache API which is cache.get(id) then it is trying to map all the values
in the VALUE_TYPE object except for the primary key which is coming as "NULL".
When we try to insert data to cache using cache.put(key, Value) then we are able to map the values correctly but same does not apply for above.
Is this an exepected behavior or do we need any configuration change to map the primary key value correctly.
Please suggest.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Question: Ignite issue with Mapping of Value Type Object [ignite]
Posted by "ptupitsyn (via GitHub)" <gi...@apache.org>.
ptupitsyn commented on issue #11531:
URL: https://github.com/apache/ignite/issues/11531#issuecomment-2350886831
Could you please share the code as text? I'm not sure how to run screenshots.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Question: Ignite issue with Mapping of Value Type Object [ignite]
Posted by "ptupitsyn (via GitHub)" <gi...@apache.org>.
ptupitsyn commented on issue #11531:
URL: https://github.com/apache/ignite/issues/11531#issuecomment-2346620952
Could you please share the code? A minimal working reproducer would be ideal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Question: Ignite issue with Mapping of Value Type Object [ignite]
Posted by "ratadepally (via GitHub)" <gi...@apache.org>.
ratadepally commented on issue #11531:
URL: https://github.com/apache/ignite/issues/11531#issuecomment-2353119527
> Could you please share the code as text? I'm not sure how to run screenshots.
Hi @ptupitsyn
Sorry please see the attachments for the code as a zip and also in the word document.
[IgniteEventing.zip](https://github.com/user-attachments/files/17014999/IgniteEventing.zip)
[IgniteExample.docx](https://github.com/user-attachments/files/17015002/IgniteExample.docx)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Question: Ignite issue with Mapping of Value Type Object [ignite]
Posted by "sk0x50 (via GitHub)" <gi...@apache.org>.
sk0x50 closed issue #11531: Question: Ignite issue with Mapping of Value Type Object
URL: https://github.com/apache/ignite/issues/11531
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Question: Ignite issue with Mapping of Value Type Object [ignite]
Posted by "ratadepally (via GitHub)" <gi...@apache.org>.
ratadepally commented on issue #11531:
URL: https://github.com/apache/ignite/issues/11531#issuecomment-2368706552
Hi @ptupitsyn - Any update on this please?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Question: Ignite issue with Mapping of Value Type Object [ignite]
Posted by "ptupitsyn (via GitHub)" <gi...@apache.org>.
ptupitsyn commented on issue #11531:
URL: https://github.com/apache/ignite/issues/11531#issuecomment-2368924186
Looks like the `ID` is both the cache key, and a part of cache value (`Employees.id`) field.
* When you do `cache.put`, you duplicate the ID in two places
* When you insert via SQL, the ID only goes to the key part
To see how this works internally, try [Binary Mode](https://ignite.apache.org/docs/latest/key-value-api/binary-objects) - inspect the resulting object fields in both cases.
I recommend removing `Employees.id` field to avoid confusion. The id is already in the cache key.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Question: Ignite issue with Mapping of Value Type Object [ignite]
Posted by "ratadepally (via GitHub)" <gi...@apache.org>.
ratadepally commented on issue #11531:
URL: https://github.com/apache/ignite/issues/11531#issuecomment-2349678217
> Could you please share the code? A minimal working reproducer would be ideal.
Hi @ptupitsyn -
Please find the attachments for sample code to reproduce the issue.




I have first inserted the data using INSERT statement and then tried to retrieve it using cache.get("1"). and I see below result where primary key value is NULL. Same applies when we use the query API
Employee Data: Employee{id=null, name='john', email='johndoe@gmail.com'}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org