<div dir="ltr">Hi,<div><br></div><div>I've found some problems trying to use db_cassandra module for tables that are not related to Kamailio and that are queried from the sqlops module. Below there's a list where I describe them with some level of detail:</div>
<div><br></div><div>1. Querying from sqlops was impossible because of a parameter check that reads the table name from the connection structure. This table name is never set when using raw SQL (or CQL).</div><div>2. All data was being treated as string, not matter what their actual type was. The table information for database schema was being ignored for raw queries.</div>
<div>3. If you define your table structure beforehand, using CQL DDL for example, all numeric types are inaccessible from inside the module because of the problem described in the item above.</div><div><br></div><div>I fixed the problems of points #1 and #2. Sqlops module is now fully usable with Cassandra and the table definition is being taken into account even for raw queries. Some basic checks are also performed with field definitions. The problem #3 remains; I was not able to fix it because I don't have enough experience with Thrift. Hopefully, this will change soon enough. </div>
<div><br></div><div>To avoid running into problems with point #3, one can simply create the column family without specifying member types, and creating an index for your primary key field (this will allow you to query using "where clause" with that field as a condition). Later, define the table structure in plain text with the correct database types and pass that information to cassandra module (schema_path param), and the module should treat every value with the correct type inside Kamailio memory space. </div>
<div><div><br></div><div>I've attached the patch of the fix. Hopefully, the original authors of the module (who are copied on this email) will review it and authorize me to push it to master.</div><div><br></div><div>
Regards,</div>-- <br>Carlos<div><a href="http://caruizdiaz.com" target="_blank">http://caruizdiaz.com</a></div><div>+595981146623</div>
</div></div>