VMware GemFire

 View Only

 Removing record with space character from gemfire using gfsh

Selvakumar Murugesan's profile image
Selvakumar Murugesan posted Mar 28, 2019 10:51 AM

Dear All,

 

We have inserted the record which has trailing spaces('JP3758190007/106    ') that we couldn't remove by using gfsh. Please advise what query do we need use to achieve the same.

 

Query which we tried to delete with no luck:

remove --region=/INSTR_EAI_TEMP --key='JP3758190007/106    '

 

query --query="select tpaInstrumentId from /INSTR_EAI_TEMP where tpaInstrumentId='JP3758190007/106    '" ​

 

Thanks and Regards,

Selva Kumar M.

Rajiv CE's profile image
Rajiv CE

Hi Selva,

 

I tried to insert the record with key 'JP3758190007/106   ' and i was able to remove the record successfully. See the attached snapshot.

 

Which version of gemfire are you using.

 

Regards,

Rajiv

Selvakumar Murugesan's profile image
Selvakumar Murugesan
Hello Rajiv, We are using gemfire 8.2 version . Thanks and Regards, [cid:image007.png@01D1C7A3.D96B2750] SELVA KUMAR MURUGESAN MFS SD Ph :+91 44 6118 0267(extn:80267) Emergency Callout +91-44-61180277/+91-44-71080277 [cid:image005.jpg@01D17BA8.11897BC0] : PARIS BP2S MFS SERVICE DELIVERY
Juan Cassella's profile image
Juan Cassella

Hello SelvaKumar,

 

Thanks for contacting the Pivotal Support Community.

My name is Juan José Ramos Cassella, and I am a GemFire Technical Support Engineer with Pivotal. 

That said, and adding to what Rajiv previously stated, the remove command seems to be trimming the actual value used for the --key parameter, so you won't be able to remove this particular entry within GemFire SHell. You can, however, write a really simple java client to delete the entry:

public static void main(String[] args) throws Exception { ClientCache cache = new ClientCacheFactory(). set("log-level", "config"). set("cache-xml-file", "client-cache.xml"). create();   try { Region<?, ?> region = cache.getRegion("INSTR_EAI_TEMP"); region.remove("JP3758190007/106 "); } finally { if (cache != null) cache.close(); }   System.exit(0); }

Hope this helps.

Best regards.