【问题标题】:apache ignite postgres persistence json and jsonb problemapache点燃postgres持久化json和jsonb问题
【发布时间】:2019-02-11 21:47:30
【问题描述】:

我想将一个 postgres 表缓存到 apache ignite 缓存中;支持 json 和 jsonb。

CREATE TABLE public.some_event (
    id BIGINT NOT NULL, 
    name TEXT, 
    team_squad JSON, 
    event_type TEXT, 
    start_datime BIGINT, 
    end_datime BIGINT, 
    is_running BOOLEAN, 
    is_finished BOOLEAN, 
    recent_matches JSON, 
    CONSTRAINT event_info_pkey 
    PRIMARY KEY (id)
);

在 apache inite 配置中说,

“recent_matches”字段选择为other的jdbc类型,java类型为Object;我得到了 PGObject。

如果字段选择为jdbc类型varchar且java类型为String;我得到这样的转义json

"\"id\"": ..."

如果 sql 使用类型转换 ::text 我得到 BufferedStream。

我不需要对 json 或任何特殊 sql 进行任何特殊过滤。只想发送字符串以进行插入和更新。对于阅读,没有双引号转义的 json 字符串。

由于我是 apache ignite 的新手,因此从文档中我无法理解二进制封送处理,也无法找到任何完整的示例。

你能提供任何完整的例子吗?

【问题讨论】:

    标签: java json postgresql ignite


    【解决方案1】:

    Ignite 没有对 PostgreSQL 的 JSON 类型的特定支持。

    您可能需要扩展CacheJdbcPojoStore,覆盖fillParameter() 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-17
      • 2010-12-07
      • 2021-01-15
      • 2011-04-04
      相关资源
      最近更新 更多