results = executecql(conn,query)
returns the results of executing a Cassandra® Query Language (CQL) query on the Cassandra database using the Cassandra database connection. The executecql function imports the
query results into MATLAB®.
results = executecql(conn,query,'ConsistencyLevel',level)
sets a consistency level to specify how many nodes must respond for the CQL query to
execute.
Using a Cassandra® database connection, execute a CQL query to import data from a Cassandra database table into MATLAB®. In this case, the Cassandra database contains the employees_by_job database table with employee data in the employeedata keyspace.
Create a Cassandra database connection using the local host address. conn is a cassandra object.
Write a CQL query that selects all employees who are programmers or shop clerks hired before April 30, 2006, and retrieves their job identifiers, hire dates, and email addresses. job_id is the partition key of the employees_by_job database table, and hire_date is a clustering column.
results is a table with the job_id, hire_date, and email variables. The hire_date variable is a datetime array and the job_id and email variables are string arrays.
Using a Cassandra® database connection, execute a CQL query to import data from a Cassandra database table into MATLAB®. Specify a consistency level for returning query results. In this case, the Cassandra database contains the employees_by_job database table with employee data in the employeedata keyspace.
Create a Cassandra database connection using the local host address. conn is a cassandra object.
Write a CQL query that selects all employees who are programmers, and retrieves their hire dates and email addresses. job_id is the partition key of the employees_by_job database table. Limit the returned data to three rows.
Most of the replica nodes respond with returned data. results is a table with the hire_date and email variables. The hire_date variable is a datetime array and the email variable is a string array.
CQL query results, returned as a table. Each Cassandra database column from the result of the CQL query is a variable in the
table. The variable names match the names of the Cassandra database columns from the result of the CQL query.
The data types of the variables in the table depend on the CQL data types. For
details about how CQL data types convert to MATLAB data types, see Convert CQL Data Types to MATLAB Data Types.
For read or write operations that return no data, the
executecql function returns an empty table.