%% Return Database Table Names in Cassandra Database
% Using a Cassandra® database connection and the Apache Cassandra database C++ interface, return the names of all database tables in the Cassandra database.
%
% Create a Cassandra database connection using the configured data source CassandraDataSource and a blank user name and password. The apacheCassandra function returns conn as a connection object.

datasource = "CassandraDataSource";
username = "";
password = "";
conn = apacheCassandra(datasource,username,password);

%
% Return the names of all database tables in the Cassandra database using the Cassandra database connection. t is a table that contains the names of all Cassandra database tables and their corresponding keyspaces.

t = tablenames(conn);

%
% Display the first few rows of the returned data.

head(t)

% The Keyspace variable indicates the keyspace. The Table variable indicates the name of the Cassandra database table in the corresponding keyspace.
%
% Close the Cassandra database connection.

close(conn)

% Copyright 2020 The MathWorks, Inc.