官术网_书友最值得收藏!

The purpose of types

Now that you know the full range of types available in Cassandra, you may be wondering what purpose those types serve. In fact, the type system in Cassandra plays a few roles:

  • Types are used for input validation. If you attempt to put a string value in an integer column, for instance, Cassandra will return an error.
  • Type information is made available to client libraries; most adapters will return the results of queries with values represented using the appropriate data type for the language.
  • In some scenarios, rows can be ordered by the value of a certain column. In that case, the type of the column determines the order of values in the column. For instance, in a text column, 2 is larger than 10, but in an int column, 10 is larger than 2.

You can find a full list of all the CQL data types in the DataStax CQL documentation at http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/cql_data_types_c.html.

Now that we've got a firm grasp of how to create a Cassandra table and what options are available to us when creating columns, it's time to put the table to use.

主站蜘蛛池模板: 安吉县| 金溪县| 宣城市| 瑞丽市| 广灵县| 共和县| 惠来县| 信阳市| 共和县| 济宁市| 无锡市| 临漳县| 册亨县| 扎赉特旗| 昌江| 华容县| 长兴县| 云阳县| 新晃| 浮梁县| 新乐市| 政和县| 松江区| 巴南区| 佛学| 泰来县| 潮安县| 张家界市| 新营市| 新巴尔虎右旗| 炉霍县| 贵德县| 措勤县| 札达县| 马关县| 理塘县| 鹿邑县| 涞水县| 都匀市| 安义县| 凌源市|