Text Data Type in Cassandra
Text data type in Cassandra is used to save UTF-8 encoded string values. In below example, I am creating a table with column "Name" as Text data type and inserting couple of records for test.
CQLSH:techbrotherstutorials>CREATE TABLE tbs
(
id INT PRIMARY KEY,
NAME TEXT
);
(
id INT PRIMARY KEY,
NAME TEXT
);
Insert records in table by using CQL insert statement
CQLSH:techbrotherstutorials>INSERT INTO tbs
(
id,
NAME
)
VALUES
(
1,
'Doe John'
);
(
id,
NAME
)
VALUES
(
1,
'Doe John'
);
CQLSH:techbrotherstutorials>INSERT INTO tbs
(
id,
NAME
)
VALUES
(
2,
'Test_Text_123'
);
(
id,
NAME
)
VALUES
(
2,
'Test_Text_123'
);
Check the data in table by using Select statement in CQL
CQLSH:techbrotherstutorials>SELECT *
FROM tbs;
FROM tbs;