Untitled
unknown
plain_text
2 years ago
672 B
4
Indexable
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()
Editor is loading...