You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geode.apache.org by Claudiu Balciza <cb...@1wa.org> on 2020/08/26 16:58:32 UTC

weird gfsh behavior

Hi all,

I have encountered this strange gfsh behavior
There is data in a region and I can query it

gfsh>query --query='select key from /Region.entries where key=28733'
Result : true
Limit  : 100
Rows   : 1

Result
------
28733

But when I try to get or remove the entry

gfsh>get --region=Region --key='28733'
Result      : false
Key Class   : java.lang.String
Key         : 28733
Value Class : java.lang.String
Value       : null

gfsh>remove --region=Region --key='28733'
Result    : false
Message   : Key is not present in the region
Key Class : java.lang.String
Key       : 28733

But then
gfsh>query --query='select key from /Region.entries where key=28733'
Result : true
Limit  : 100
Rows   : 1

Result
------
28733

I’m a bit stumped 😊

Claudiu

Re: weird gfsh behavior

Posted by Jinmei Liao <ji...@vmware.com>.
Sorry, it should be:
query --query='select e.key from /Region.entrySet e where e.key=28733'


From: Jinmei Liao <ji...@vmware.com>
Reply-To: "user@geode.apache.org" <us...@geode.apache.org>
Date: Wednesday, August 26, 2020 at 10:02 AM
To: "user@geode.apache.org" <us...@geode.apache.org>
Subject: Re: weird gfsh behavior

Looks like that key does not exist in your region. Your query doesn’t look correct. Try this:
query --query='select e.key from /Region.entries e where e.key=28733'


From: Claudiu Balciza <cb...@1wa.org>
Reply-To: "user@geode.apache.org" <us...@geode.apache.org>
Date: Wednesday, August 26, 2020 at 9:58 AM
To: "user@geode.apache.org" <us...@geode.apache.org>
Subject: weird gfsh behavior

Hi all,

I have encountered this strange gfsh behavior
There is data in a region and I can query it

gfsh>query --query='select key from /Region.entries where key=28733'
Result : true
Limit  : 100
Rows   : 1

Result
------
28733

But when I try to get or remove the entry

gfsh>get --region=Region --key='28733'
Result      : false
Key Class   : java.lang.String
Key         : 28733
Value Class : java.lang.String
Value       : null

gfsh>remove --region=Region --key='28733'
Result    : false
Message   : Key is not present in the region
Key Class : java.lang.String
Key       : 28733

But then
gfsh>query --query='select key from /Region.entries where key=28733'
Result : true
Limit  : 100
Rows   : 1

Result
------
28733

I’m a bit stumped 😊

Claudiu

Re: weird gfsh behavior

Posted by Jinmei Liao <ji...@vmware.com>.
Looks like that key does not exist in your region. Your query doesn’t look correct. Try this:
query --query='select e.key from /Region.entries e where e.key=28733'


From: Claudiu Balciza <cb...@1wa.org>
Reply-To: "user@geode.apache.org" <us...@geode.apache.org>
Date: Wednesday, August 26, 2020 at 9:58 AM
To: "user@geode.apache.org" <us...@geode.apache.org>
Subject: weird gfsh behavior

Hi all,

I have encountered this strange gfsh behavior
There is data in a region and I can query it

gfsh>query --query='select key from /Region.entries where key=28733'
Result : true
Limit  : 100
Rows   : 1

Result
------
28733

But when I try to get or remove the entry

gfsh>get --region=Region --key='28733'
Result      : false
Key Class   : java.lang.String
Key         : 28733
Value Class : java.lang.String
Value       : null

gfsh>remove --region=Region --key='28733'
Result    : false
Message   : Key is not present in the region
Key Class : java.lang.String
Key       : 28733

But then
gfsh>query --query='select key from /Region.entries where key=28733'
Result : true
Limit  : 100
Rows   : 1

Result
------
28733

I’m a bit stumped 😊

Claudiu

Re: weird gfsh behavior

Posted by Nabarun Nag <nn...@vmware.com>.
Hi
The query seems to be working as per our doc examples.

I can reproduce the issue if the key is of Integer type but the get and remove operations are based on String keys.

Alberto's solution should be resolving this issue.

Regards
Nabarun
________________________________
From: Alberto Gomez <al...@est.tech>
Sent: Wednesday, August 26, 2020 10:09 AM
To: user@geode.apache.org <us...@geode.apache.org>
Subject: Re: weird gfsh behavior

I think the problem is that the key is of type Integer.

Can you try this?

remove --region=/test --key=1234 --key-class=java.lang.Integer

BR,

Alberto
________________________________
From: Claudiu Balciza <cb...@1wa.org>
Sent: Wednesday, August 26, 2020 6:58 PM
To: user@geode.apache.org <us...@geode.apache.org>
Subject: weird gfsh behavior


Hi all,



I have encountered this strange gfsh behavior

There is data in a region and I can query it



gfsh>query --query='select key from /Region.entries where key=28733'

Result : true

Limit  : 100

Rows   : 1



Result

------

28733



But when I try to get or remove the entry



gfsh>get --region=Region --key='28733'

Result      : false

Key Class   : java.lang.String

Key         : 28733

Value Class : java.lang.String

Value       : null



gfsh>remove --region=Region --key='28733'

Result    : false

Message   : Key is not present in the region

Key Class : java.lang.String

Key       : 28733



But then

gfsh>query --query='select key from /Region.entries where key=28733'

Result : true

Limit  : 100

Rows   : 1



Result

------

28733



I’m a bit stumped ??



Claudiu

Re: weird gfsh behavior

Posted by Alberto Gomez <al...@est.tech>.
I think the problem is that the key is of type Integer.

Can you try this?

remove --region=/test --key=1234 --key-class=java.lang.Integer

BR,

Alberto
________________________________
From: Claudiu Balciza <cb...@1wa.org>
Sent: Wednesday, August 26, 2020 6:58 PM
To: user@geode.apache.org <us...@geode.apache.org>
Subject: weird gfsh behavior


Hi all,



I have encountered this strange gfsh behavior

There is data in a region and I can query it



gfsh>query --query='select key from /Region.entries where key=28733'

Result : true

Limit  : 100

Rows   : 1



Result

------

28733



But when I try to get or remove the entry



gfsh>get --region=Region --key='28733'

Result      : false

Key Class   : java.lang.String

Key         : 28733

Value Class : java.lang.String

Value       : null



gfsh>remove --region=Region --key='28733'

Result    : false

Message   : Key is not present in the region

Key Class : java.lang.String

Key       : 28733



But then

gfsh>query --query='select key from /Region.entries where key=28733'

Result : true

Limit  : 100

Rows   : 1



Result

------

28733



I’m a bit stumped ??



Claudiu