Cassandra CQL使用详解
Data Types:
cql_type ::=native_type | collection_type | user_defined_type | tuple_type | custom_type
Native Types:
Counters:
counter type is used to define counter columns. 存储64-bit signed integer 并且支持两种操作 incrementing(增值) and decrementing(减值).
注意计数器的值不能被设置:当counter does not exist until first incremented / decremented,第一次increment / decrement 之前的值是0.
Counters 有几点重要限制:
1)They cannot be used for columns part of the PRIMARY KEY of a table .
2)主键的表的所有列为计数器类型,或者没有一个是计数器类型的.
3)Counters 不支持终止.
4)The delete of counters is supported, but is only guaranteed(担保) to work the first time you delete a counter . 换句话说,你不能重复修改 a counter that you have deleted(if you do , proper behavior is not guaranteed).
5)if a counter update fails unexpectedly(timeout or loss of connection) the client has no way to know if the update has been applied or not , In particular,replaying the update may or may not lead to an over count.
Working with timestamps:
Values of the timestamp type are encode as 64-bit signed integers representing a number of milliseconds since the standard base time known as :January 1 1970
Timestamps can be input in CQL either using their value as an integer ,or using a string that represents as ISO 8601 date. For instance ,all of the values below:
1299038700000
'2011-02-0304:05+0000'
'2011-02-0304:05:00+0000'
'2011-02-0304:05:00.000+0000'
'2011-02-03T04:05+0000'
'2011-02-03T04:05:00+0000'
'2011-02-03T04:05:00.000+0000'
Working with dates:
Values of the date
type are encoded as 32-bit unsigned integers representing a number of days with “the epoch” atthe center of the range (2^31). Epoch is January 1st, 1970
As for timestamp, a date can be input either as aninteger
or using a datestring
. In the later case, the format should be yyyy-mm-dd
(so'2011-02-03'
for instance).
Working with times:
Values of the time
type are encoded as 64-bit signed integers representing the number of nanoseconds since midnight.
As for timestamp, a time can be input either as aninteger
or using astring
representing the time. In the later case, the format should behh:mm:ss[.fffffffff]
(where the sub-second precisionis optional and if provided, can be less than the nanosecond). So for instance, the following are valid inputs for atime:
'08:12:54'
'08:12:54.123'
'08:12:54.123456'
'08:12:54.123456789'
Collections:
CQL supports 3 kind of collections : Maps Sets Lists
Maps:
A map is a (sorted) set of key-value pairs,where keys are unique and the map is sorted by its keys.
Cassandra CQL使用详解相关推荐
- 离线强化学习(Offline RL)系列3: (算法篇) IQL(Implicit Q-learning)算法详解与实现
[更新记录] 论文信息:Ilya Kostrikov, Ashvin Nair, Sergey Levine: "Offline Reinforcement Learning with Im ...
- 离线强化学习(Offline RL)系列3: (算法篇) AWAC算法详解与实现
[更新记录] 论文信息:AWAC: Accelerating Online Reinforcement Learning with Offline Datasets [Code] 本文由UC Berk ...
- 离线强化学习(Offline RL)系列3: (算法篇) Onestep 算法详解与实现
[更新记录] 论文信息: David Brandfonbrener, William F. Whitney, Rajesh Ranganath, Joan Bruna: "Offline R ...
- k8s nodeport无法访问_k8s学习之service详解
1.概述 通过Deployment来创建一组Pod来提供具有高可用性的服务.每个Pod都会分配一个单独的Pod IP,却存在如下两问题: 1.pod ip仅仅集群内部可见的虚拟IP,外部无法访问 2. ...
- 深入剖析Redis系列(三) - Redis集群模式搭建与原理详解
前言 在 Redis 3.0 之前,使用 哨兵(sentinel)机制来监控各个节点之间的状态.Redis Cluster 是 Redis 的 分布式解决方案,在 3.0 版本正式推出,有效地解决了 ...
- 可视化数据库管理工具DataGrip使用详解
参考链接:https://www.hangge.com/blog/cache/detail_2829.html 日常开发中少不了各种可视化数据库管理工具.如果需要同时能连接多种数据库,大家肯定都会想到 ...
- SpringBoot的配置详解application
SpringBoot的配置文件application有两种文件格式,两种配置的内容是一致的,只是格式不一致. 1.application.properties 2.application.yml或者a ...
- [转]application.properties详解 --springBoot配置文件
本文转载:http://blog.csdn.net/lpfsuperman/article/details/78287265###; # spring boot application.propert ...
- [免费专栏] Android安全之数据存储与数据安全「详解」
也许每个人出生的时候都以为这世界都是为他一个人而存在的,当他发现自己错的时候,他便开始长大 少走了弯路,也就错过了风景,无论如何,感谢经历 Android安全付费专栏长期更新,本篇最新内容请前往: [ ...
最新文章
- KDD 2021多个奖项出炉:斯坦福博士摘得学位论文奖,北航校友胡侠获新星奖
- Convert Sorted Array to Binary Search Tree - LeetCode
- ML之FE:利用【数据分析+数据处理】算法对国内某平台上海2020年6月份房价数据集【12+1】进行特征工程处理(史上最完整,建议收藏)
- QThreadPool Class的翻译
- AI驱动的超分辨技术落地实践
- 【Unity】12.4 通过网格分层选择行进路线
- 贷款审批到底会考核哪些内容?
- centos7 postgresql9和postgis2.1插件编译部署
- Java Web应用小案例:实现登录功能
- 将界面最小化到系统托盘的完整步骤
- ASP.NET FileUpload文件上传路径问题
- 华为算法精英赛(题1:判断输入天数为当年的第几天)
- 布隆过滤器实现原理及源码解析
- Flash在线文档阅读器::pdf、doc、docx、xls、xlsx、ppt、pptx、htm、txt、rtf、epub、csv、xdoc等
- 解决调用wx.downLoadFile下载的文件名乱码(长串英文字符)问题
- 第14.4节 使用IE浏览器获取网站访问的http信息
- 三天玩转win7,你也想?
- python五子棋课程设计报告_算法课程设计:使用Python完成可视化的五子棋AI
- 无线wifi摄像头怎样可以远程监控
- Accumulation Degree -换根dp