如何在执行LINQ查询时更改架构名称? [英] How to change schema name on executing LINQ query?
问题描述
我有一个缓存,其中一个QueryEntity创建为
I have a cache with one QueryEntity created as
ignite.CreateCache<long, MyEntity>(new CacheClientConfiguration("myEntityCache", queryEntity)
{
SqlSchema = "MYSCHEMA"
});
我正在尝试对此缓存执行LINQ查询
And I'm trying to execute LINQ query against this cache
var result = cache
.AsCacheQueryable()
.Select(x => x.Value)
.Where(predicate)
.ToList();
但是我得到一个错误
'无法解析查询.找不到架构"myEntityCache";SQL语句:从"myEntityCache" .MYENTITY中选择_T0._VAL作为_T0,其中?[90079-195]'
'Failed to parse query. Schema "myEntityCache" not found; SQL statement: select _T0._VAL from "myEntityCache".MYENTITY as _T0 where ? [90079-195]'
架构名称应等于"MYSCHEMA",但ignite使用与架构不匹配的缓存名称.
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?
推荐答案
我已经检查了这一点,并可以确认存在错误.从LINQ生成SQL时,仅会忽略 SqlSchema
.
I have checked this and can confirm that there is a bug. SqlSchema
is simply ignored when generating SQL from LINQ.
已提交的已勾选的内容: https://issues.apache.org/jira/browse/IGNITE-9116
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.
没有明显的解决方法.
这篇关于如何在执行LINQ查询时更改架构名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!