Untitled
unknown
plain_text
a year ago
672 B
1
Indexable
Never
from cassandra.cluster import Cluster from cassandra.query import BatchStatement, SimpleStatement from cassandra.auth import PlainTextAuthProvider contact_points = ['172.16.177.58'] auth_provider = PlainTextAuthProvider('hobs_analytics', 'hobs_analytics') cluster = Cluster(contact_points=contact_points, auth_provider=auth_provider),request_timeout=70.0 session = cluster.connect() batch = BatchStatement() batch.add(SimpleStatement("DELETE FROM hobs_ods_staging.hos_cart_details WHERE businessid='businessid'")) result = session.execute(batch) rows_deleted = result[0].count print(f"{rows_deleted} rows deleted") session.close() cluster.shutdown()