cols = columninfo(conn,keyspace,tablename)
returns column information from a specified Cassandra® database table in a specified keyspace using the Cassandra database connection.
Using a Cassandra® database connection, return column information for a Cassandra database table. Specify the keyspace and the name of the table. In this case, the Cassandra database has the employeedata keyspace, which contains the employees_by_job database table.
Create a Cassandra database connection using the local host address. conn is a cassandra object.
Using a Cassandra® database connection, return partition key values for a Cassandra database table. Specify the keyspace and name of the table. In this case, the Cassandra database has the employeedata keyspace, which contains the employees_by_job database table.
Create a Cassandra database connection using the local host address. conn is a cassandra object.
job_id is the only partition key in the employees_by_job database table. Each row is a partition key value that is a unique partition in employees_by_job.
Use the partition key values with the partitionRead function to import data from a Cassandra database table.
Cassandra database connection, specified as a cassandra
object.
keyspace — Keyspace character vector | string scalar
Keyspace, specified as a character vector or string scalar. If you do not know the keyspace,
then access the Keyspaces property of the cassandra
object using dot notation to view the keyspaces in the Cassandra database.
Example: "employeedata"
Data Types: char | string
tablename — Cassandra database table name character vector | string scalar
Cassandra database table name, specified as a character vector or string scalar. If
you do not know the name of the table, then use the tablenames function to find it.
Column information from a Cassandra database table, returned as a MATLAB® table containing these variables.
Variable Name
Variable Description
Variable Data Type
Name
Cassandra database column name
string
DataType
CQL data type of the Cassandra database column
string
PartitionKey
Whether the Cassandra database table column is a partition key
(true indicates a partition key)
logical
ClusteringColumn
Whether the Cassandra database table column is a clustering column
("ASC" indicates ascending order,
"DESC" indicates descending order, and
"" indicates that the column is not a clustering
column)
string
If the data type of a column in a Cassandra database table is a collection (for example, a list,
map, and so on), then the value of the DataType
variable contains angle brackets (<>). These angle brackets
surround the data type of the items in the collection. The value for user-defined types
(UDTs) contains the type name. For example, if the UDT is person,
then the value of the DataType variable is person
in the MATLAB table. For details about valid CQL data types, see CQL data types.
keyValues — Partition key values table
Partition key values, returned as a table. The MATLAB table contains one variable for each partition key in the Cassandra database table. Each row in the MATLAB table represents a unique partition in the Cassandra database table.
You can use the partition key values with the partitionRead function to import data from a Cassandra database table.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.