I have a query that I am running on Jupyter with Python 3 kernel. But I am getting an error. The code+query:
import cassandra
from cassandra.cluster import Cluster
cluster = Cluster()
session = cluster.connect()
query = """
DROP TABLE IF EXISTS song_info_by_session, songs_played_by_user_in_session, user_info_by_songs_listened;
"""
try:
session.execute(query)
except Exception as e:
print(e)
And the error is:
<Error from server: code=2000 [Syntax error in CQL query] message="line 2:41 no viable alternative at input ',' (DROP TABLE IF EXISTS [song_info_by_session],...)">
It is my first time using Cassandra and I couldn't find any info if it is possible or not to drop multiple tables in one query, so I wanted to check if I have another error unrelated with this feature, or I got error due to this.
Doc: https://docs.datastax.com/en/cql-oss/3.3/cql/cql_reference/cqlDropTable.html#Synopsis
It is only possible to DROP one table at a time, so you will have to run each DROP statement individually.