gpt4 book ai didi

cassandra - Cassandra CQL 中 Varchar 和文本类型有什么区别

转载 作者:行者123 更新时间:2023-12-02 22:33:54 30 4
gpt4 key购买 nike

What is the difference between Varchar and text data type in Cassandra CQL.

https://docs.datastax.com/en/cql/3.0/cql/cql_reference/cql_data_types_c.html

当我尝试创建字段数据类型为 varchar 的表时,它会创建为文本数据类型

CREATE TABLE test ( empID int, first_name varchar, last_name varchar, PRIMARY KEY (empID) );

DESC 测试表给出了以下结果。

CREATE TABLE test (
empid int PRIMARY KEY,
first_name text,
last_name text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';

[cqlsh 5.0.1 | Cassandra 3.0.7.1158 | DSE 5.0.0 | CQL spec 3.4.0 | Native protocol v4]

最佳答案

CQL data types doc 中,textvarchar 都是 UTF-8 字符串。所以两者是一回事。

关于cassandra - Cassandra CQL 中 Varchar 和文本类型有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38389957/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com