tmp for cassandra batch delete
now i have no time to verify this bash script. it is hard for me to delete each data via primary key
#!/bin/bash
if [[ ${1} == "" ]];then  
        echo "Please indicate the cassandra Address."  
        echo "Use this cmd like this:"  
        echo "./clear_data.sh 192.102.1.1"  
        exit  
fi;
arr=(`cqlsh ${1} -f list_tables.cmd`)
echo "table list: ${arr[*]}"
for((i=0; i<${#arr[@]}; i++));do  
        count=(`cqlsh ${1} -e "use clicki_v4; select count(*) from ${arr[i]};"`)  
        #echo ${count[*]}  
        echo "before truncate table, there are ${count[2]} rows in table ${arr[i]};"  
        #====================================  
        #NOTE: dangerous command, please seriously  check!!!!!!  
        cqlsh ${1} -e "use clicki_v4; truncate ${arr[i]};"  
        #====================================  
        count=(`cqlsh ${1} -e "use clicki_v4; select count(*) from ${arr[i]}"`)  
        echo "after truncate table, there are ${count[2]} rows in table ${arr[i]};"  
done;
--目前就一个库clicki_v4,后续可以继续增加...  
use clicki_v4;  
desc tables;
CREATE TABLE coach_uat.mytable (
            uid text,
            id int,
            name text,
        PRIMARY KEY (uid),
    );
CREATE TABLE coach_uat.mytable(
              key1 text,
              key2 text,
              key3 text,
              column1 bigint,
              column2 int,
              column3 timestamp,
        primary key(key1, key2, key3);
    )
tmp for cassandra batch delete的更多相关文章
- Cassandra 安装部署
		
Linux 系统安装Cassandra 一.Cassandra需要安装jdk支持,首先安装jdk 自行百度查找安装 二.下载Cassandra 官网地址: https://cassandra.apac ...
 - Ubuntu18.04 LTS 搭建Cassandra集群
		
环境需求 jdk8 root@node01:~# java -version java version "1.8.0_202" Java(TM) SE Runtime Enviro ...
 - [LeetCode] Delete Node in a Linked List 删除链表的节点
		
Write a function to delete a node (except the tail) in a singly linked list, given only access to th ...
 - [LintCode] Delete Node in the Middle of Singly Linked List 在单链表的中间删除节点
		
Implement an algorithm to delete a node in the middle of a singly linked list, given only access to ...
 - 237. Delete Node in a Linked List(C++)
		
237. Delete Node in a Linked Lis t Write a function to delete a node (except the tail) in a singly l ...
 - rsync同步时,删除目标目录比源目录多余文件的方法(--delete)
		
在日常运维工作中,我们经常用到rsync这个同步神器.有时在同步两个目录时,会要求删除目标目录中比源目录多出的文件,这种情况下,就可用到rsync的--delete参数来实现这个需求了. 实例说明:在 ...
 - 关于dbutils中QueryRunner看批量删除语句batch
		
//批量删除 public void delBooks(String[] ids) throws SQLException { QueryRunner qr = new QueryRunner(C3P ...
 - 237 Delete Node in a Linked List 删除链表的结点
		
编写一个函数,在给定单链表一个结点(非尾结点)的情况下,删除该结点. 假设该链表为1 -> 2 -> 3 -> 4 并且给定你链表中第三个值为3的节点,在调用你的函数后,该链表应变为 ...
 - [LeetCode] 237. Delete Node in a Linked List 删除链表的节点
		
Write a function to delete a node (except the tail) in a singly linked list, given only access to th ...
 
随机推荐
- Django-form组件和ModelForm组件
			
一. 构建Form表单 通过建一个类,添加需要进行验证的form字段,继而添加验证条件 from django import forms from django.forms import widget ...
 - ubuntu shell脚本出错  dash
			
今天在Ubuntu下调试代码,明明是正确的,却仍然报错,查了错误信息才知道:Ubuntu中默认不是bash,而是为了加快开机速度,使用了dash. dash中需要严格的语法,而且与bash语法不同.例 ...
 - Geometry
			
uva1473 这题说的是 在空间中给了n个点 然后用体积最小的圆锥将这些点包含在内可以在表面上, 将这些点 映射到xoz平面上然后,然后枚举每个上凸包的边和每个点的极值进行判断求得最小的体积 我们会 ...
 - 代码静态检查Eclipse插件:SonarLint插件离线安装
			
Eclipse Version: Oxygen.3a Release (4.7.3a)Myeclipse版本: 10.7 SonarLint 插件离线安装包:org.sonarlint.eclipse ...
 - SQL: 左连接,右连接,内连接,左外连接,右外连接,完全连接
			
例子: ---------------------- --------------------------- a表 id name b表 id job parent_id 1 张三 ...
 - MySQL重装失败,could not start the service MySQL.Error:0
			
MySQL5.5 安装失败现象: mysqld.exe [6132] 中发生了未经处理的 win32 异常 could not start the service MySQL.Error:0 1.在 ...
 - 实现kylin定时跑当天的任务
			
说明: 每天自动构建cube,动态在superset里面查看每天曲线变化图 #! /bin/bash ##cubeName cube的名称 ##endTime 执行build cube的结束时间 (命 ...
 - JProfiler8 远程监控tomcat配置过程
			
1. 阅读人群 1.熟悉liunx服务器,起码知道liunx常见的命令 2.熟悉tomcat容器,起码知道怎么tomcat的启动以及停止 3.熟悉java编程语言,JProfiler8是专门监控jav ...
 - Vue源码解析之nextTick
			
Vue源码解析之nextTick 前言 nextTick是Vue的一个核心功能,在Vue内部实现中也经常用到nextTick.但是,很多新手不理解nextTick的原理,甚至不清楚nextTick的作 ...
 - HTTP从入门到入土(5)——HTTP报文格式
			
HTTP报文格式 HTTP报文分为请求报文和响应报文,只有发送了请求报文,才会有响应报文. 常见的报文格式如下所示: