

{"id":15803,"date":"2018-05-30T06:40:58","date_gmt":"2018-05-30T06:40:58","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=15803"},"modified":"2021-04-05T13:45:24","modified_gmt":"2021-04-05T08:15:24","slug":"cassandra-collection","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/","title":{"rendered":"Cassandra Collection Data Types: List, Set, &amp; Map"},"content":{"rendered":"<h2>1. Objective<\/h2>\n<p><span style=\"font-weight: 400\">In our <strong><a href=\"https:\/\/data-flair.training\/blogs\/apache-cassandra-tutorial\/\">Cassandra <\/a><\/strong>journey, we will see Cassandra Collection Data Types tutorial. In this, we will know about Collection data type in Cassandra. These are data types just like arrays and structures in C, C++ etc. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Moreover, we will discuss this Cassandra Collection Data Types with the help of list, set, and map.<\/span><br \/>\nSo, let&#8217;s start Cassandra Collection Data Types<\/p>\n<div id=\"attachment_16030\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-16030\" class=\"wp-image-16030 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg\" alt=\"Cassandra Collection Data Types\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection--150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection--300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection--768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection--1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-16030\" class=\"wp-caption-text\">Cassandra Collection Data Types<\/p><\/div>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-troubleshooting\/\">Do you know about Cassandra Troubleshooting<\/a><\/strong><\/p>\n<h2>2. Cassandra Collection Data Types<\/h2>\n<p><span style=\"font-weight: 400\">Collection data types in Cassandra are basically a unit in which multiple values are stored. Usually, a single variable defines Cassandra-CQL collection data type. This variable, in turn, contains multiple values. <\/span><\/p>\n<p><span style=\"font-weight: 400\">There are a few collection data types, list, set and map. Many functions are performed on these Cassandra collection data types. These functions include create, insert, update and verify.<\/span><br \/>\n<a href=\"https:\/\/data-flair.training\/blogs\/cassandra-data-model\/\"><strong>Cassandra Data Model | How Cassandra Stores Data<\/strong><\/a><\/p>\n<h3>a. Cassandra List<\/h3>\n<p><span style=\"font-weight: 400\">In this data type, the values are stored in a form of a list. One value in this list is stored multiple times. There is one rule for the list data type. <\/span><\/p>\n<p><span style=\"font-weight: 400\">The order of the elements cannot be changed. After storing the values in the list, the elements get a particular index. The values can be retrieved through these indexes.<\/span><\/p>\n<p><strong>i. Create<\/strong><br \/>\n<span style=\"font-weight: 400\">This Cassandra Create table is used to create a table with list data type, the user can apply CREATE TABLE command. The table can contain many columns. The <strong>syntax<\/strong> used to create table is.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt;CREATE TABLE &lt;table name&gt;(column1 PRIMARY KEY,column2 list &lt;data type&gt;,column3 list &lt;data type&gt;,.....);<\/pre>\n<p><span style=\"font-weight: 400\">Creating a table &#8216;college students&#8217; with columns, name, enrolment number and branch.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-books\/\">Best Cassandra Books to gain complete knowledge of Cassandra<\/a><\/strong><br \/>\n<strong>Example A.1 Creating the table.<\/strong><span style=\"font-weight: 400\"><br \/>\n<\/span><br \/>\nInput:<\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh&gt; USE keyspace1;\r\ncqlsh:keyspace1&gt; CREATE TABLE employee\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... (EN int,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... NAME text,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... EMAIL LIST&lt;text&gt;,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... PRIMARY KEY(EN),\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... );<\/pre>\n<p><b>ii. Insert<\/b><br \/>\n<span style=\"font-weight: 400\">To insert elements in the table user can use INSERT INTO command. A comma separates all the values within square brackets. The <strong>syntax<\/strong> is.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt; INSERT INTO &lt;table name&gt;(column1, column2, column3,....) VALUES('R1value1',['R1value1','R1value2','R1value3'...]['R1value11','R1value12','R1value13'...]...);<\/pre>\n<p><strong>Example A.2: Cassandra insert table.<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace1&gt; INSERT INTO college student (EN, NAME, EMAIL)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(001,'Ayush',{'ayush@gmail.com'});\r\ncqlsh:keyspace1&gt; INSERT INTO college student (EN, NAME, EMAIL)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(002,'Aarav',{'aarav@ymail.com'});\r\ncqlsh:keyspace1&gt; INSERT INTO college student (EN, NAME, EMAIL)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(003,'Kabir',{'kabir@hotmail.com'});<\/pre>\n<p><b>iii. Update<\/b><br \/>\n<span style=\"font-weight: 400\">UPDATE command in Cassandra is used to update the value in particular columns of the table. The <strong>syntax<\/strong> used to update is.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-api\/\">Let&#8217;s revise Cassandra API<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt; UPDATE&lt;table name&gt;\r\nSET &lt;column2&gt;=&lt;column2&gt;+['value']\r\nwhere &lt;column1&gt;='some value';<\/pre>\n<p><span style=\"font-weight: 400\"><strong>Example A.3:<\/strong> Updating the table in Cassandra Collection.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace2&gt;UPDATE college student\r\nSET EMAIL=EMAIL+['ayush.1@gmail.com']\r\nwhere EN=001;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-cluster\/\">Have a look at Cassandra Cluster<\/a><\/p>\n<p><b>iv. Verify<\/b><br \/>\n<span style=\"font-weight: 400\">To verify the contents of the table SELECT command is used. The<strong> syntax<\/strong>\u00a0for Verify the table in Cassandra Collection Data Types is.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt; SELECT*FROM &lt;table name&gt;;<\/pre>\n<p><span style=\"font-weight: 400\">To verify the tables<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace&gt; SELECT*FROM employee;\r\n<\/pre>\n<p><span style=\"font-weight: 400\"><strong>Output\u00a0after Example A.1:<\/strong><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">NAME \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">EMAIL<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(0 rows)<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-features\/\">Explore Important Cassandra Features\u00a0<\/a><\/strong><br \/>\n<span style=\"font-weight: 400\"><strong>Output\u00a0after Example A.2:<\/strong><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN<\/span><\/td>\n<td><span style=\"font-weight: 400\">NAME<\/span><\/td>\n<td><span style=\"font-weight: 400\">EMAIL<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">001 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Ayush<\/span><\/td>\n<td><span style=\"font-weight: 400\">ayush@gmail.com<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">002<\/span><\/td>\n<td><span style=\"font-weight: 400\">Aarav<\/span><\/td>\n<td><span style=\"font-weight: 400\">aarav@ymail.com<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">003<\/span><\/td>\n<td><span style=\"font-weight: 400\">Kabir<\/span><\/td>\n<td><span style=\"font-weight: 400\">kabir@hotmail.com<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(3 rows)<\/span><br \/>\n<span style=\"font-weight: 400\"><strong>Output\u00a0after Example A.3:<\/strong><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN<\/span><\/td>\n<td><span style=\"font-weight: 400\">NAME<\/span><\/td>\n<td><span style=\"font-weight: 400\">EMAIL<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">001 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Ayush<\/span><\/td>\n<td><span style=\"font-weight: 400\">ayush.1@gmail.com<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">002<\/span><\/td>\n<td><span style=\"font-weight: 400\">Aarav<\/span><\/td>\n<td><span style=\"font-weight: 400\">aarav@ymail.com<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">003<\/span><\/td>\n<td><span style=\"font-weight: 400\">Kabir<\/span><\/td>\n<td><span style=\"font-weight: 400\">kabir@hotmail.com<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(3 rows)<\/span><\/p>\n<h3>b. Cassandra Set<\/h3>\n<p><span style=\"font-weight: 400\">To store a group of the element, a user can use SET Cassandra collection data type. The elements in the set returns in a sorted order after execution.<\/span><\/p>\n<p><strong>i. Cassandra Create Table<\/strong><br \/>\n<span style=\"font-weight: 400\">To create a table with the set, a user can use CREATE command with the following <strong>syntax<\/strong>.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt; CREATE TABLE&lt;table name&gt; (column1 PRIMARY KEY, column2 set &lt;data type&gt;, column3 set &lt;data type&gt;.....);\r\n<\/pre>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif\">Creating a table &#8216;college students&#8217; with columns, name, enrolment number and branch.<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-monitoring-tools\/\">You must know about Cassandra Monitoring Tools<\/a><\/strong><br \/>\n<span style=\"font-weight: 400\"><strong>Example B.1<\/strong> Creating the table.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh&gt; USE keyspace2;\r\ncqlsh:keyspace2&gt; CREATE TABLE college students\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... (EN int,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... NAME text,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... BRANCH SET&lt;text&gt;,\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... PRIMARY KEY(EN),\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... );<\/pre>\n<p><strong>ii. Cassandra Insert<\/strong><br \/>\n<span style=\"font-weight: 400\">To insert value in a set INSERT INTO command is used with the following syntax.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt; INSERT INTO &lt;table name&gt;(column1, column2, column3...) VALUES('R1value',{'R1value1', 'R1value2',..},{ 'R1value11', 'R1value12',..}....);<\/pre>\n<p><span style=\"font-weight: 400\"><strong>Example B.2:<\/strong> Inserting in the table.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-terminologies\/\">Let&#8217;s explore Cassandra\u00a0Terminologies<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace2&gt; INSERT INTO college student (EN, NAME, BRANCH)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(001,'Ayush',{'electrical engineering'});\r\ncqlsh:keyspace2&gt; INSERT INTO college student (EN, NAME, BRANCH)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(002,'Aarav',{'Computer engineering'});\r\ncqlsh:keyspace2&gt; INSERT INTO college student (EN, NAME, BRANCH)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(003,'Kabir',{'Applied Physics'});<\/pre>\n<p><strong>iii. Cassandra Update<\/strong><br \/>\n<span style=\"font-weight: 400\">A user can update the contents in a set using this <strong>syntax.<\/strong><\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt;UPDATE &lt;table name&gt;\r\nSET &lt;column2&gt;=&lt;column2&gt;+['value']\r\nwhere &lt;column1&gt;='some value';\r\n<\/pre>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif\"><strong>Example B.3:<\/strong> Updating the table.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace2&gt;UPDATE college student\r\nSET BRANCH=BRANCH+['electrical and electronics']\r\nwhere EN=001;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-applications\/\"><strong>Cassandra Applications | Why Cassandra Is So Popular?<\/strong><\/a><br \/>\n<b>iv. Verify\u00a0<\/b><br \/>\n<span style=\"font-weight: 400\">To verify the contents of the table SELECT command is used. The<strong> syntax<\/strong> is.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt; SELECT*FROM &lt;table name&gt;;<\/pre>\n<p><span style=\"font-weight: 400\">To verify the tables<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><strong>Input:<\/strong><span style=\"font-weight: 400\"><br \/>\n<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace2&gt; SELECT*FROM COLLEGE STUDENTS;<\/pre>\n<p><span style=\"font-weight: 400\"><strong>Output<\/strong>\u00a0<strong>after Example B.1:<\/strong><\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">NAME \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">BRANCH<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(0 rows)<\/span><br \/>\n<strong>Output after Example B.2:<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN<\/span><\/td>\n<td><span style=\"font-weight: 400\">NAME<\/span><\/td>\n<td><span style=\"font-weight: 400\">BRANCH<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">001 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Ayush<\/span><\/td>\n<td><span style=\"font-weight: 400\">Electrical Engineering<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">002<\/span><\/td>\n<td><span style=\"font-weight: 400\">Aarav<\/span><\/td>\n<td><span style=\"font-weight: 400\">Computer Engineering<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">003<\/span><\/td>\n<td><span style=\"font-weight: 400\">Kabir<\/span><\/td>\n<td><span style=\"font-weight: 400\">Applied Physics<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(3 rows)<\/span><br \/>\n<strong>Output after Example B.3:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/cql-data-manipulation-commands\/\">Do you know about Cassandra Manipulation Command<\/a><\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN<\/span><\/td>\n<td><span style=\"font-weight: 400\">NAME<\/span><\/td>\n<td><span style=\"font-weight: 400\">BRANCH<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">001 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Ayush<\/span><\/td>\n<td><span style=\"font-weight: 400\">Electrical and Electronics<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">002<\/span><\/td>\n<td><span style=\"font-weight: 400\">Aarav<\/span><\/td>\n<td><span style=\"font-weight: 400\">Computer Engineering<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">003<\/span><\/td>\n<td><span style=\"font-weight: 400\">Kabir<\/span><\/td>\n<td><span style=\"font-weight: 400\">Applied Physics<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(3 rows)<\/span><\/p>\n<h3>c. Cassandra Map<\/h3>\n<p><span style=\"font-weight: 400\">Map in Cassandra collection data type, stores a key-value pair of elements.<\/span><\/p>\n<p><strong>i. Cassandra Create a Table<\/strong><br \/>\n<span style=\"font-weight: 400\">To create a table with map, user can use CREATE command with following <strong>syntax<\/strong>.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt; CREATE TABLE&lt;table name&gt; (column1 PRIMARY KEY, column2 map &lt;type, data type&gt;, column3 map &lt;type, data type&gt;.....);<\/pre>\n<p><span style=\"font-weight: 400\">Creating a table &#8216;student&#8217; with 2 columns for Enrolment number and Subject.<\/span><br \/>\n<span style=\"font-weight: 400\"><strong>Example C.1:<\/strong> Creating the table.<\/span><br \/>\n<strong>Input:<\/strong><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/cql-clauses\/\">Have a look at Cassandra CQL Clauses<\/a><\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace3&gt;CREATE TABLE student\r\n                       ...(EN int,\r\n                       ... SUBJECT MAP(text,text),\r\n                       ... PRIMARY KEY(EN)\r\n                       ...);\r\n<\/pre>\n<p><strong><span style=\"font-family: Verdana, Geneva, sans-serif\">ii. Insert<\/span><\/strong><br \/>\n<span style=\"font-weight: 400\">To insert value in a map INSERT INTO command is used with the following syntax.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt; INSERT INTO &lt;table name&gt;(column1, column2, column3...) VALUES('R1value',{'R1value1':'R1value1' ,R1value2:'R1value01',..},{ 'R1value11':'R1value011','R1value12':'R1value012',..}....);<\/pre>\n<p><span style=\"font-weight: 400\"><strong>Example C.2<\/strong> Inserting in the table.<\/span><br \/>\n<strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace3&gt;INSERT INTO student(EN, SUBJECT)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(001,{'physics':'mathematics'})\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\ncqlsh:keyspace3&gt;INSERT INTO student(EN, SUBJECT)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(002,{'operating system':'robotics'}) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\r\ncqlsh:keyspace3&gt;INSERT INTO student(EN, SUBJECT)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0... VALUES(003,{'power system':'machines'<\/pre>\n<p><strong>iii. Update<\/strong><br \/>\n<span style=\"font-weight: 400\">A user can update the contents in a set using this <strong>syntax.<\/strong><\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt;UPDATE &lt;table name&gt;\r\nSET &lt;column2&gt;=&lt;column2&gt;+['value1':'value2']\r\nwhere &lt;column1&gt;='some value';\r\n<\/pre>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif\"><strong>Example C.3<\/strong> Updating the table.<\/span><br \/>\n<strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace3&gt;UPDATE student\r\nSET SUBJECT=SUBJECT+['programming':'artificial intelligence']\r\nwhere EN=002;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-architecture\/\"><strong>Learn about Cassandra Architecture<\/strong><\/a><\/p>\n<p><strong>iv. Verify<\/strong><br \/>\n<span style=\"font-weight: 400\">To verify the contents of the table SELECT command is used. The <strong>syntax<\/strong> is.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt; SELECT*FROM &lt;table name&gt;;<\/pre>\n<p><span style=\"font-weight: 400\">To verify the table we use the above syntax. <\/span><br \/>\n<strong>Input<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace3&gt;SELECT*FROM student;<\/pre>\n<p><strong>Output after Example C.1<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">SUBJECT<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(0 rows)<\/span><br \/>\n<strong>Output after Example C.2<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">SUBJECT<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">001 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">physics, mathematics<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">002<\/span><\/td>\n<td><span style=\"font-weight: 400\">Operating systems, robotics<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">003<\/span><\/td>\n<td><span style=\"font-weight: 400\">Power systems, machines<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(3 rows)<\/span><br \/>\n<strong>Output after Example C.3<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">EN \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">SUBJECT<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">001 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Physics, mathematics<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">002<\/span><\/td>\n<td><span style=\"font-weight: 400\">Programming, artificial intelligence<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">003<\/span><\/td>\n<td><span style=\"font-weight: 400\">Power systems, machines<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">(3 rows)<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-quiz\/\">Test Your Cassandra Knowledge<\/a><\/strong><br \/>\nSo, this was all about Collection data types in Cassandra. Hope you like the article.<\/p>\n<h2>3. Conclusion<\/h2>\n<p><span style=\"font-weight: 400\">Hence, in this Cassandra Collection tutorial, we studied about collection data types in Cassandra. Also, we studied these Cassandra collection data types with the help of list, set and map Cassandra. <\/span><\/p>\n<p><span style=\"font-weight: 400\">In the next article, we will know about <a href=\"https:\/\/data-flair.training\/blogs\/cassandra-shell-commands\/\"><strong>Cassandra Shell Commands<\/strong><\/a>. Furthermore, if you have any query, feel free to ask through the comment section.<\/span><\/p>\n<p><strong>See also &#8211;\u00a0<\/strong><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-interview-questions\/\">Cassandra Interview Questions<\/a><\/strong><br \/>\n<strong><a href=\"http:\/\/cassandra.apache.org\/doc\/latest\/cql\/types.html\">For reference<\/a><\/strong><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1928,&quot;href&quot;:&quot;http:\\\/\\\/cassandra.apache.org\\\/doc\\\/latest\\\/cql\\\/types.html&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20210506234226\\\/https:\\\/\\\/cassandra.apache.org\\\/doc\\\/latest\\\/cql\\\/types.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-10 11:04:26&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2025-12-14 05:12:54&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2025-12-18 08:30:53&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2025-12-24 02:39:30&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2025-12-27 16:34:56&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2025-12-31 02:27:21&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-05 08:06:47&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-13 06:48:10&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-16 22:19:33&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-21 03:23:30&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-01-28 06:41:17&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-04 11:02:25&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-08 15:09:03&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-02-15 02:48:12&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-02 11:07:31&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-05 20:29:20&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-10 10:25:44&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-14 23:14:32&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-03 16:19:08&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-08 07:44:14&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-18 09:23:25&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-04-22 09:59:00&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-12 07:20:42&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-23 10:57:53&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-05-30 00:58:41&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-10 13:09:09&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-14 11:06:19&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-17 14:23:16&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-17 14:23:16&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Objective In our Cassandra journey, we will see Cassandra Collection Data Types tutorial. In this, we will know about Collection data type in Cassandra. These are data types just like arrays and structures&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":16030,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[2330,2331,2332,2364,2365,2366,2367,2385,2631],"class_list":["post-15803","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cassandra","tag-cassandra-collection","tag-cassandra-collection-data-types","tag-cassandra-collections-performance","tag-cassandra-list","tag-cassandra-list-of-maps","tag-cassandra-map","tag-cassandra-map-data-type","tag-cassandra-set","tag-collection-data-types-in-cassandra"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cassandra Collection Data Types: List, Set, &amp; Map - DataFlair<\/title>\n<meta name=\"description\" content=\"Cassandra Collection tutorial: collections data types in Cassandra, List, Set &amp; Map Cassandra, Cassandra create table, Syntax, Cassandra collection example\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/cassandra-collection\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cassandra Collection Data Types: List, Set, &amp; Map - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Cassandra Collection tutorial: collections data types in Cassandra, List, Set &amp; Map Cassandra, Cassandra create table, Syntax, Cassandra collection example\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/cassandra-collection\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-05-30T06:40:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-05T08:15:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cassandra Collection Data Types: List, Set, &amp; Map - DataFlair","description":"Cassandra Collection tutorial: collections data types in Cassandra, List, Set & Map Cassandra, Cassandra create table, Syntax, Cassandra collection example","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/","og_locale":"en_US","og_type":"article","og_title":"Cassandra Collection Data Types: List, Set, &amp; Map - DataFlair","og_description":"Cassandra Collection tutorial: collections data types in Cassandra, List, Set & Map Cassandra, Cassandra create table, Syntax, Cassandra collection example","og_url":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-05-30T06:40:58+00:00","article_modified_time":"2021-04-05T08:15:24+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Cassandra Collection Data Types: List, Set, &amp; Map","datePublished":"2018-05-30T06:40:58+00:00","dateModified":"2021-04-05T08:15:24+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/"},"wordCount":898,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg","keywords":["cassandra collection","Cassandra Collection data types","cassandra collections performance","Cassandra list","Cassandra list of maps","Cassandra map","cassandra map data type","Cassandra set","Collection data types in Cassandra"],"articleSection":["Cassandra Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/cassandra-collection\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/","url":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/","name":"Cassandra Collection Data Types: List, Set, &amp; Map - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg","datePublished":"2018-05-30T06:40:58+00:00","dateModified":"2021-04-05T08:15:24+00:00","description":"Cassandra Collection tutorial: collections data types in Cassandra, List, Set & Map Cassandra, Cassandra create table, Syntax, Cassandra collection example","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/cassandra-collection\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/cassandra-collection-.jpg","width":1200,"height":628,"caption":"Cassandra Collection Data Types"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/cassandra-collection\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Cassandra Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/cassandra\/"},{"@type":"ListItem","position":3,"name":"Cassandra Collection Data Types: List, Set, &amp; Map"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322416204232f4dd97ef3901b0a499a5d34d7ba7fe333f4bfe53a907873d293?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team specializes in creating clear, actionable content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Backed by industry expertise, we make learning easy and career-oriented for beginners and pros alike.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam3\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/15803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=15803"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/15803\/revisions"}],"predecessor-version":[{"id":90507,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/15803\/revisions\/90507"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/16030"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=15803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=15803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=15803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}