

{"id":16139,"date":"2018-06-01T06:10:59","date_gmt":"2018-06-01T06:10:59","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=16139"},"modified":"2021-04-05T13:45:21","modified_gmt":"2021-04-05T08:15:21","slug":"cassandra-user-defined-types","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/","title":{"rendered":"Cassandra User Defined Types- Create, Alter, Drop, Describe"},"content":{"rendered":"<h2>1. Objective<\/h2>\n<p><span style=\"font-weight: 400\">In our previous<strong><a href=\"https:\/\/data-flair.training\/blogs\/apache-cassandra-tutorial\/\"> Cassandra<\/a><\/strong> tutorial, we studied about <a href=\"https:\/\/data-flair.training\/blogs\/cassandra-data-types\/\"><strong>data types<\/strong> <strong>used in Cassandra<\/strong><\/a>. In this article, we will know the Cassandra User Defined Types. While using a User Defined Type in Cassandra, we will also look at create, drop, alter and describe the function. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Moreover, we will discuss\u00a0Cassandra user-defined types of\u00a0performance.<\/span><\/p>\n<p>So, let&#8217;s discuss Cassandra User Defined Types in detail.<\/p>\n<div id=\"attachment_16143\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-16143\" class=\"wp-image-16143 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.jpg\" alt=\"Cassandra User Defined Types\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-16143\" class=\"wp-caption-text\">Cassandra User Defined Types<\/p><\/div>\n<h2>2. Cassandra User Defined Types<\/h2>\n<p><span style=\"font-weight: 400\">As the name suggests, the user has the ability to define certain data types. Cassandra Query Language allows the user to do so. The user may create, alter, drop or describe a data type. <\/span><\/p>\n<p><span style=\"font-weight: 400\">The data types can be according to the user&#8217;s requirement as according to the program or field. Let&#8217;s discuss it more.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-collection\/\">Do you know about Cassandra Collection Data Types<\/a><\/strong><\/p>\n<h3>a. Create<\/h3>\n<p><span style=\"font-weight: 400\">CQL allows the user to create data types. The user can create the data type using this syntax:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">CREATE TYPE &lt;keyspace&gt;.&lt;data type&gt;\r\n(variable,variable).<\/pre>\n<p><span style=\"font-weight: 400\">Here, the user has to make sure that the name used for user-defined data type and predefined data type are not the same. <\/span><br \/>\n<span style=\"font-weight: 400\">Let&#8217;s create a cassandra\u00a0<\/span><span style=\"font-weight: 400\">user-defined data type. In the example, we will create &#8216;records&#8217; for college students with following field name and field type.<\/span><br \/>\n<strong>Table.1 Cassandra User Defined Types &#8211; Create<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">FIELD NAME<\/span><\/td>\n<td><span style=\"font-weight: 400\">FIELD TYPE<\/span><\/td>\n<td><span style=\"font-weight: 400\">DESCRIPTION<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Name<\/span><\/td>\n<td><span style=\"font-weight: 400\">Text<\/span><\/td>\n<td><span style=\"font-weight: 400\">Name of the student.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Branch<\/span><\/td>\n<td><span style=\"font-weight: 400\">Text<\/span><\/td>\n<td><span style=\"font-weight: 400\">Major of the degree.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Phone<\/span><\/td>\n<td><span style=\"font-weight: 400\">Int<\/span><\/td>\n<td><span style=\"font-weight: 400\">Phone number.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">City<\/span><\/td>\n<td><span style=\"font-weight: 400\">Text<\/span><\/td>\n<td><span style=\"font-weight: 400\">City they are from.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Id<\/span><\/td>\n<td><span style=\"font-weight: 400\">int<\/span><\/td>\n<td><span style=\"font-weight: 400\">Enrolment number<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-architecture\/\">Learn\u00a0Cassandra Architecture a Complete Guide<\/a><\/strong><br \/>\n<strong>Example 1:<\/strong><span style=\"font-weight: 400\"> Creating the data type.<\/span><br \/>\n<strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace1&gt; CREATE TYPE records (\r\n                         ... name text,\r\n                         ... branch text,\r\n                         ... phone int,\r\n                         ... city text,\r\n                         ... id set &lt;int&gt;,\r\n                         ... );\r\n<\/pre>\n<h3>b. Alter<\/h3>\n<p><span style=\"font-weight: 400\">After creating the data type in cassandra, a user also has an option to alter the contents. The user can add and rename fields of the data type.<\/span><br \/>\n<span style=\"font-weight: 400\">To add a field in a data type, the user can use ALTER TYPE along with ADD command. The syntax is<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">ALTER TYPE &lt;data type&gt;\r\nADD &lt;field name&gt;&lt;field type&gt;;<\/pre>\n<p><strong>Example 2:<\/strong><span style=\"font-weight: 400\"> Adding field email to the data type.<\/span><br \/>\n<strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">ALTER TYPE records\r\nADD email text;<\/pre>\n<p><span style=\"font-weight: 400\">If the user wants to rename a field, he can use ALTER TYPE along with RENAME command. The syntax to rename is.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">ALTER TYPE&lt;data type&gt;\r\nRENAME&lt;existing name&gt;TO&lt;new name&gt;;<\/pre>\n<p><strong>Example 3:<\/strong><span style=\"font-weight: 400\"> Changing the name of field &#8216;id&#8217; to &#8216;en&#8217;.<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-data-model\/\">Cassandra Data Model | How Cassandra Stores Data<\/a><\/strong><br \/>\n<strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">ALTER TYPE records\r\nRENAME id TO en;<\/pre>\n<h3>c. Drop<\/h3>\n<p><span style=\"font-weight: 400\">Using DROP TYPE command user can drop or delete a Cassandra user-defined data type. The user can use syntax given below.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt;DROP TYPE &lt;data type&gt;<\/pre>\n<p><strong>Example 4:<\/strong><span style=\"font-weight: 400\"> Dropping the field &#8216;city&#8217;.<\/span><br \/>\n<strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace1&gt; DROP TYPE city;<\/pre>\n<h3>d. Describe<\/h3>\n<p><span style=\"font-weight: 400\">The user can verify the contents of the data type by using DESCRIBE TYPE command. The syntax used for this is.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:&lt;keyspace&gt;&gt; DESCRIBE TYPE&lt;data type&gt;;\r\n<\/pre>\n<p><strong>Input:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">cqlsh:keyspace1&gt; DESCRIBE TYPE records;<\/pre>\n<p><strong>Output after Example 1:<\/strong><br \/>\n<span style=\"font-weight: 400\">CREATE TYPE<\/span><span style=\"font-weight: 400\"> keyspace1.records<\/span><span style=\"font-weight: 400\">(<\/span><br \/>\n<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&#8230; name <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; branch <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; phone <\/span><span style=\"font-weight: 400\">int,<\/span><br \/>\n<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&#8230; city <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; id <\/span><span style=\"font-weight: 400\">set &lt;int&gt;,<\/span><br \/>\n<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&#8230; <\/span><span style=\"font-weight: 400\">);<\/span><br \/>\n<strong>OUTPUT after Example 2:<\/strong><br \/>\n<span style=\"font-weight: 400\">CREATE TYPE <\/span><span style=\"font-weight: 400\">keyspace1.records<\/span><span style=\"font-weight: 400\">(<\/span><br \/>\n<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&#8230; name <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; branch <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; phone <\/span><span style=\"font-weight: 400\">int,<\/span><br \/>\n<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&#8230; city <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; id <\/span><span style=\"font-weight: 400\">set &lt;int&gt;,<\/span><br \/>\n<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&#8230; email <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; <\/span><span style=\"font-weight: 400\">);<\/span><br \/>\n<strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-features\/\">Let&#8217;s explore\u00a0<\/a><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-features\/\">Cassandra Features<\/a> <\/strong><br \/>\n<strong>OUTPUT after Example 3:<\/strong><br \/>\n<span style=\"font-weight: 400\">CREATE TYPE<\/span><span style=\"font-weight: 400\"> keyspace1.records<\/span><span style=\"font-weight: 400\">(<\/span><br \/>\n<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&#8230; name <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; branch <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; phone <\/span><span style=\"font-weight: 400\">int,<\/span><br \/>\n<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&#8230; city <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; en <\/span><span style=\"font-weight: 400\">set &lt;int&gt;,<\/span><br \/>\n<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&#8230; email <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; <\/span><span style=\"font-weight: 400\">);<\/span><br \/>\n<strong>OUTPUT after Example 4:<\/strong><br \/>\n<span style=\"font-weight: 400\">CREATE TYPE<\/span><span style=\"font-weight: 400\"> keyspace1.records<\/span><span style=\"font-weight: 400\">(<\/span><br \/>\n<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&#8230; name <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; branch <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; phone <\/span><span style=\"font-weight: 400\">int,<\/span><br \/>\n<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&#8230; en <\/span><span style=\"font-weight: 400\">set &lt;int&gt;,<\/span><br \/>\n<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&#8230; email <\/span><span style=\"font-weight: 400\">text,<\/span><br \/>\n<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&#8230; <\/span><span style=\"font-weight: 400\">);<\/span><\/p>\n<p><strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-quiz\/\">How much you learned about Cassandra &#8211; Test Here<\/a><\/strong><br \/>\nSo, this was all about Cassandra User Defined Types. Hope You like our explanation.<\/p>\n<h2>3. Conclusion<\/h2>\n<p><span style=\"font-weight: 400\">Hence, in this article, we got to know about the Cassandra User Defined Data Types. Moreover, we also studied create, alter, drop and describe the user-defined types of Cassandra. In the next article, we will study about <strong><a href=\"https:\/\/data-flair.training\/blogs\/cassandra-troubleshooting\/\">troubleshooting in Cassandra<\/a><\/strong>. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Furthermore, if you have any query regarding Cassandra user defined types, feel free to ask through the comment section.<\/span><br \/>\n<strong>See also &#8211;<\/strong><br \/>\n<a href=\"https:\/\/data-flair.training\/blogs\/cassandra-interview-questions-and-answers\/\"><b>Cassandra Interview Questions<\/b><\/a><br \/>\n<a href=\"http:\/\/cassandra.apache.org\/doc\/latest\/cql\/types.html\"><strong>For reference<\/strong><\/a><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;date&quot;:&quot;2026-06-22 17:34:09&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-29 05:07:18&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-07-03 01:50:43&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-07-07 23:01:57&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-07-11 13:44:40&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-11 13:44:40&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Objective In our previous Cassandra tutorial, we studied about data types used in Cassandra. In this article, we will know the Cassandra User Defined Types. While using a User Defined Type in Cassandra,&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":16143,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[431,2398,3069,3775,4065,15226],"class_list":["post-16139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cassandra","tag-alter-in-cassandra","tag-cassandra-user-defined-types","tag-create-in-cassandra","tag-describe-in-cassandra","tag-drop-command-in-cassandra","tag-user-defined-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 User Defined Types- Create, Alter, Drop, Describe - DataFlair<\/title>\n<meta name=\"description\" content=\"Cassandra CQL User Defined Types, Create, Alter, Drop, Describe, Cassandra User defined types performance, Example and Code\" \/>\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-user-defined-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cassandra User Defined Types- Create, Alter, Drop, Describe - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Cassandra CQL User Defined Types, Create, Alter, Drop, Describe, Cassandra User defined types performance, Example and Code\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/\" \/>\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-06-01T06:10:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-05T08:15:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.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=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cassandra User Defined Types- Create, Alter, Drop, Describe - DataFlair","description":"Cassandra CQL User Defined Types, Create, Alter, Drop, Describe, Cassandra User defined types performance, Example and Code","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-user-defined-types\/","og_locale":"en_US","og_type":"article","og_title":"Cassandra User Defined Types- Create, Alter, Drop, Describe - DataFlair","og_description":"Cassandra CQL User Defined Types, Create, Alter, Drop, Describe, Cassandra User defined types performance, Example and Code","og_url":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-06-01T06:10:59+00:00","article_modified_time":"2021-04-05T08:15:21+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Cassandra User Defined Types- Create, Alter, Drop, Describe","datePublished":"2018-06-01T06:10:59+00:00","dateModified":"2021-04-05T08:15:21+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/"},"wordCount":602,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.jpg","keywords":["alter in Cassandra","Cassandra user defined types","create in Cassandra","describe in cassandra","Drop command in cassandra","user defined types in cassandra"],"articleSection":["Cassandra Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/","url":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/","name":"Cassandra User Defined Types- Create, Alter, Drop, Describe - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.jpg","datePublished":"2018-06-01T06:10:59+00:00","dateModified":"2021-04-05T08:15:21+00:00","description":"Cassandra CQL User Defined Types, Create, Alter, Drop, Describe, Cassandra User defined types performance, Example and Code","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/05\/Cassandra-user-defined-types-01.jpg","width":1200,"height":628,"caption":"User Defined types in Cassandra"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/cassandra-user-defined-types\/#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 User Defined Types- Create, Alter, Drop, Describe"}]},{"@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\/16139","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=16139"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/16139\/revisions"}],"predecessor-version":[{"id":90504,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/16139\/revisions\/90504"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/16143"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=16139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=16139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=16139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}