Integrating apache ignite in legacy java sql based project joins issue

六眼飞鱼酱① 提交于 2020-01-25 08:35:08

问题


I have a legacy java project where I have more than 1000 table and a lot of SQL queries.

In order to achieve a better querying performance I m studying the apache ignite in memory database where I wan't to use the 3rd party persistence mechanism, the later is based on caching (CacheStore) that I implemented successfully in my POC, unfortunately I have lot of complex queries with lot of joins, in this case I have to update my queries using cache store names as in the example

    private static void select(IgniteCache<Long, Person> personCache, String msg) {
        String sql =
            "select p.id, concat(p.firstName, ' ', p.lastName), o.name, p.resume, p.salary " +
            "from Person as p, \"" + ORG_CACHE + "\".Organization as o " +
            "where p.orgId = o.id";

        List<List<?>> res = personCache.query(new SqlFieldsQuery(sql).setDistributedJoins(true)).getAll();

        print(msg);

        for (Object next : res)
            System.out.println(">>>     " + next);
    }

I really wish to avoid this, and use native SQL.

Is there any other possible solutions to achieve joins using the 3rd party persistence and cache

Thanks


回答1:


When creating a cache, you can set its sqlSchema to "PUBLIC". If you do that for all caches, you will never need to specify their schemas explicitly (if that's what your question was about).



来源:https://stackoverflow.com/questions/58928903/integrating-apache-ignite-in-legacy-java-sql-based-project-joins-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!