0
我有一個用java編寫的Apache Spark作業,我可以訪問並寫入Cassandra表格。我怎樣才能截斷表格?如何使用java在Cassandra中截斷表格
我有一個用java編寫的Apache Spark作業,我可以訪問並寫入Cassandra表格。我怎樣才能截斷表格?如何使用java在Cassandra中截斷表格
沒有看到您的代碼或不知道您正在使用哪個Java驅動程序,「是」,我對如何截斷表有一個想法。調用execute
方法對你Session
,並通過TRUNCATE
命令它:
Session session = cluster.connect();
session.execute("TRUNCATE keyspace_name.table_name;");
如果不能爲你工作,那麼你可能是一個更具體一點與你的問題。
謝謝爲我工作 – Vish
您正在使用哪個java客戶端?看到這是幫助https://www.tutorialspoint.com/cassandra/cassandra_truncate_table.htm –