Varchar Data Type in Cassandra
Varchar data type is same like Text Data type in Cassandra. Varchar data type in Cassandra is used to save UTF-8 encoded string values. I was trying to find what is the difference between Text and Varchar data type in Cassandra but look like they are same. I created the tbs table with column "Name" of varchar type. After creating the table when I checked the definition of table by using describe keyword in CQL, it shows the data type of "Name" column as text.
(
id INT PRIMARY KEY,
NAME Varchar
);
Let's check the definition of table by using Describe Table "TableName" in CQL.
Let's insert couple of records in table which has Name column as varchar data type.
(
id, NAME
)
VALUES
( 1, 'Doe John' );
(
id, NAME
)
VALUES
( 2, 'Test_varchar_123' );
Check the data in table by using Select query in CQL
NAME
FROM tbs;
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.