0
votes

I have a Cassandra database table which is cached to ignite cache. I want to use some select query to this table. Is it possible to achieve this using SqlFieldsQuery & QueryFieldsCursor in c++ ? or is there any other option for doing this? I just done a try using this

SqlFieldsQuery sql ("select * from user_permission");
QueryFieldsCursor cursor = cache.Query(qry);
while (cursor.HasNext())
    {
        QueryFieldsRow row = cursor.GetNext();
        std::cout << row.GetNext<std::string>() << row.GetNext<std::string>() << std::endl;
    }

But got an error like this " Failed to parse query: select * from user_permission"

1
Can you provide full stack-trace from the log file? That would help to get to the bottom of it. - isapego

1 Answers

0
votes

First of all, you don't query Cassandra using query API, you query data that is already in Ignite. So prior to executing queries, you have to preload data from Cassandra to Ignite. For this you need to configure Cassandra persistence store [1] and then use cache.LoadCache method.

Second of all, you need to make sure that SQL is configured properly as well [2].

[1] https://apacheignite-mix.readme.io/docs/ignite-with-apache-cassandra

[2] https://apacheignite-cpp.readme.io/docs/sql-queries