C# SQL API on key-value entries in cache error

classic Classic list List threaded Threaded
2 messages Options
abd abd
Reply | Threaded
Open this post in threaded view
|

C# SQL API on key-value entries in cache error

This post was updated on .
CONTENTS DELETED
The author has deleted this message.
ptupitsyn ptupitsyn
Reply | Threaded
Open this post in threaded view
|

Re: C# SQL API on key-value entries in cache error

Hello,

The correct query would be "SELECT AssociateID FROM Associate",
because Ignite infers table name from the class name, and column names from property names.

You can override table name with QueryEntity.TableName property,
and column names with QuerySqlFieldAttribute.Name property.

On Wed, Nov 18, 2020 at 6:38 PM ABDumalagan <[hidden email]> wrote:
Hello,

I ran into some errors trying to use Apache Ignite's SQL API, specifically the @QueryAnnotation and executing a query.

Right now, I start a cluster remotely with an XML file. Then, I start another node locally and programmatically with C# that connects to an underlying Oracle database in order to load the cache with data. The entries in the cache are key-value pairs, where the key is an Associate ID and the value is the entire Associate object.

My objective is to be able to query the data in cache. The steps I've done so far was to annotate the fields in the value class definition with the @QuerySqlField annotation in Associate.cs , instantiate the QueryEntity in CacheConfiguration in Program.cs, and perform a query using SqlFieldsQuery in Program.cs

The error that I'm running into is:

'Failed to parse query. Table "DEFAULT" not found; SQL statement: SELECT Associate_ID FROM default [42102-197]'

Am I running into this error because my entries are in key-value pairs? Do I need to organize the entries in my cache into a SQL table?

The code is attached as a file here:

Program.cs

Associate.cs

Thank you!



Sent from the Apache Ignite Users mailing list archive at Nabble.com.