为什么hazelcast无法使用imap查询不正确的结果,并且hazelcastjsonvalue包含汉字? [英] why hazelcast not query incorrect result with imap and hazelcastjsonvalue include chinese character?

查看:129
本文介绍了为什么hazelcast无法使用imap查询不正确的结果,并且hazelcastjsonvalue包含汉字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将hazelcast存储数据与imap和hazelcastjsonvalue一起使用时,我无法在sql之类的"side ='1'".我想是因为json包含像国债"之类的汉字.如何解决这个问题?如果可以设置hazelcast的某些配置以支持汉字.这样的代码,System.out.println()结果为{},应包含json:

when I use hazelcast store data with imap and hazelcastjsonvalue, I can not query incorrect result where sql like " side='1' ". I suppose because the json include Chinese character like "国债". How to fix this? If can I set some configuration of hazelcast to support chinese character. code like this, System.out.println() result is {} , should include json:

Gson gson = new Gson();
String json = "{\"orderId\":\"-20200822-221116-188-quote-100002\",\"securityId\":\"130015\",\"tradingAccount\":\"xtrinterbanktra01\",\"subSystemId\":\"QDM-ESP\",\"userId\":\"xtrinterbankat01\",\"securityExchange\":\"B\",\"systemNodeId\":710,\"quoteId\":\"1598145974197\",\"execId\":\"22550774606679263\",\"investAccount\":\"xtrinterbankinvest01\",\"productAccount\":\"xtrinterbankprod01\",\"assetAccount\":\"xtrinterbankasst01\",\"securityAccount\":\"111010032010000205011\",\"securityType\":\"4\",\"settlType\":\"1\",\"orderModel\":\"legs\",\"orderStatus\":\"8\",\"createdTime\":1598145974,\"createdDate\":\"20200824\",\"tradeDate\":\"20200824\",\"positionFlag\":1,\"price\":111.0,\"orderQty\":1.0E7,\"accumulatedExecQty\":1.0E7,\"lastQty\":1.0E7,\"finalFlag\":true,\"symbol\":\"13国债15\",\"side\":\"1\",\"orderVersion\":2,\"classType\":\"OrderBO\",\"messageId\":87350933198472267,\"uniqueKey\":\"-20200822-221116-188-quote-100002\",\"topicName\":\"order\",\"subject\":\"business/order/130015/B/xtrinterbanktra01/xtrinterbankat01\",\"publisherId\":\"oms-710-9577@168-61-73-136\",\"tenantId\":\"ficc\",\"extFields\":{\"quotaionType\":\"5\",\"clOrdId\":\"-20200822-221116-188-quote-100001\",\"marketIndicator\":\"4\",\"deliveryType\":\"0\",\"transcatTime\":\"1883635200\",\"quoteStaus\":\"16\",\"clearingMethod\":\"13\",\"execType\":\"F\",\"validUnitTime\":\"1883635200\"}}";

String tableName = "__UT_TestMap";

IMap map = instance.getMap(tableName);
map.addIndex(new IndexConfig(IndexType.HASH,"orderId"));

map.put("-20200822-221116-188-quote-100002",new HazelcastJsonValue(json));

System.out.println(map.entrySet(Predicates.sql("side='1'")));

推荐答案

这看起来像个错误,因此我对其进行了一些简化并记录了它

This looks like a bug, so I've simplified it a bit and logged it here

链接到原始问题

这篇关于为什么hazelcast无法使用imap查询不正确的结果,并且hazelcastjsonvalue包含汉字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆