Oleg
Oleg

Reputation: 1458

How to change schema name on executing LINQ query?

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?

Upvotes: 1

Views: 218

Answers (1)

Pavel Tupitsyn
Pavel Tupitsyn

Reputation: 9006

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.

Upvotes: 3

Related Questions