I'm writing a Spark-based app and have to drop some tables in Cassandra DB.
I know how to read from tables with spark.read.format("jdbc"). I know how to save dataframe with df.write.format("jbdc").
But how can I drop a table that I don't need anymore?
To drop a Cassandra table, you can simply use the Spark SQL
DROP TABLEcommand:Note that the JDBC API is limited so our general recommendation is to use the Spark Cassandra connector. It is fully open-source so is free to use.
The Spark Cassandra connector is a library specifically designed for connecting to Cassandra clusters from Spark applications. Cassandra tables are exposed as DataFrames or RDDs and the connector also allows execution of the full CQL API. Cheers!