2016-07-15 28 views
2

ist Was ist der Unterschied zwischen Varchar und Text-Datentyp in Cassandra CQL ist.Was ist der Unterschied zwischen Varchar und Textart in Cassandra CQL

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

Wenn ich versuche, eine Tabelle mit Felddatentyp zu erstellen, wie varchar es als Text-Datentyp ist die Schaffung

CREATE TABLE test (empID int, first_name varchar, last_name varchar , Primärschlüssel (empID));

DESC Testtabelle gibt mir das folgende Ergebnis.

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-Spezifikation 3.4.0 | india Protokoll v4]

+0

Etwas verwandt mit: http://stackoverflow.com/questions/31880381/cassand-alter-column-type-which-types-are-compatible/ – Aaron

Antwort

2

CQL data types doc, beide text und varchar sind UTF-8-Strings. Also beide sind ein und dasselbe.