How to change schema name on executing LINQ query?

孤人 提交于 2019-12-13 01:51:55

问题


I have a cache with one QueryEntity created as

ignite.CreateCache<long, MyEntity>(new CacheClientConfiguration("myEntityCache", queryEntity)
            {
                SqlSchema = "MYSCHEMA"
            });

And I'm trying to execute LINQ query against this cache

var result = cache
                .AsCacheQueryable()
                .Select(x => x.Value)
                .Where(predicate)
                .ToList();

But I get an error

'Failed to parse query. Schema "myEntityCache" not found; SQL statement: select _T0._VAL from "myEntityCache".MYENTITY as _T0 where ? [90079-195]'

Schema name should be equal to "MYSCHEMA" but instead ignite uses cache name which doesn't match with schema.

I didn't find any option how to specify schema name, so the question is how to fix this?


回答1:


I have checked this and can confirm that there is a bug. SqlSchema is simply ignored when generating SQL from LINQ.

Ticked filed: https://issues.apache.org/jira/browse/IGNITE-9116

The fix seems to be trivial and you can expect it in the next release.

There is no apparent workaround.



来源:https://stackoverflow.com/questions/51562948/how-to-change-schema-name-on-executing-linq-query

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