

{"id":11573,"date":"2018-03-28T06:36:46","date_gmt":"2018-03-28T06:36:46","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=11573"},"modified":"2021-05-09T13:11:17","modified_gmt":"2021-05-09T07:41:17","slug":"impala-data-types","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/impala-data-types\/","title":{"rendered":"Impala Data Types: Usage, Syntax and Examples"},"content":{"rendered":"<p><span style=\"font-weight: 400\">There is a huge set of data types available in <strong>Impala<\/strong>. Basically, those Impala Data Types we use for table columns, expression values, and function arguments and return values. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Each Impala Data Types serves a specific purpose. So, in this article, \u201cImpala Data Types\u201d, we will learn each Impala Data Types in detail. Also, we will cover their syntax, in order to use them.<\/span><\/p>\n<p>So, let&#8217;s start Impala Data Types.<\/p>\n<h2><span style=\"font-weight: 400\">Introduction to Impala Data Types<br \/>\n<\/span><\/h2>\n<p><span style=\"font-weight: 400\">So, let&#8217;s discuss each Impala Data Types one by one, along with their syntax.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">a. BIGINT<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name BIGINT<\/pre>\n<p><span style=\"font-weight: 400\">While it comes to store numerical values, we use BIGINT data type. The range of this data type is -9223372036854775808 to 9223372036854775807. In addition, we use it in create table and alter table statements.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">b. BOOLEAN<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name BOOLEAN<\/pre>\n<p><span style=\"font-weight: 400\">This data type stores only true or false values and it is used in the column definition of create table statement.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">c. CHAR<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name CHAR(length)<\/pre>\n<p><span style=\"font-weight: 400\">CHAR data type fixed length storage which is also padded with spaces. Basically, it stores up to the maximum length of 255.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">d. DECIMAL<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name DECIMAL[(precision[,scale])]<\/pre>\n<p><span style=\"font-weight: 400\">To store decimal values, we use DECIMAL Data Type. In addition, we use it in create table and alter table statements.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">e. DOUBLE<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name DOUBLE<\/pre>\n<p><span style=\"font-weight: 400\">In order to store the floating point values, we use DOUBLE Data Type. It has some specific range of positive or negative 4.94065645841246544e-324d -1.79769313486231570e+308<\/span><\/p>\n<h3><span style=\"font-weight: 400\">f. FLOAT<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name FLOAT<\/pre>\n<p><span style=\"font-weight: 400\">This data type is used to store single precision floating value datatypes in the range of positive or negative 1.40129846432481707e-45 .. 3.40282346638528860e+38.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">g. INT<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name INT<\/pre>\n<p><span style=\"font-weight: 400\">To store 4-byte integer up to the range of -2147483648 to 2147483647, we use INT Data Type. <\/span><\/p>\n<h3><span style=\"font-weight: 400\">h. SMALLINT<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name SMALLINT<\/pre>\n<p><span style=\"font-weight: 400\">While it comes to store the 2-byte integer, we use SMALLINT \u00a0data type. It has the specific range between -32768 to 32767.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">i. STRING<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name STRING<\/pre>\n<p><span style=\"font-weight: 400\">According to its name, STRING Data Type stores string values.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">j. TIMESTAMP<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name TIMESTAMP<\/pre>\n<p><span style=\"font-weight: 400\">To represent a point in a time, we use TIMESTAMP.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">k. TINYINT<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name TINYINT<\/pre>\n<p><span style=\"font-weight: 400\">While it comes to store the 1-byte integer, we use TINYINT. However, it stores value up to the range of -128 to 127.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">l. VARCHAR<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name VARCHAR(max_length)<\/pre>\n<p><span style=\"font-weight: 400\">To store variable-length character up to the maximum length 65,535, we use VARCHAR Type.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">m. ARRAY<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name ARRAY &lt; type &gt;\ntype ::= primitive_type | complex_type<\/pre>\n<p><span style=\"font-weight: 400\">ARRAY Data Type is generally considered as a complex data type. Basically, we use it to store the variable number of ordered elements.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">n. MAP<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name MAP &lt; primitive_type, type &gt;\ntype ::= primitive_type | complex_type<\/pre>\n<p><span style=\"font-weight: 400\">As same as ARRAY, Map is also considered as a complex data type. \u00a0However, we use it to store the variable number of key-value pairs.<\/span><\/p>\n<h3><span style=\"font-weight: 400\">o. STRUCT<\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400\"><strong>Syntax<\/strong><\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\">column_name STRUCT &lt; name : type [COMMENT 'comment_string'], ... &gt;\ntype ::= primitive_type | complex_type<\/pre>\n<p><span style=\"font-weight: 400\">In order to represent multiple fields of a single item, we use STRUCT Data Type. This is also a complex data type.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400\">As a result, we have seen all Impala Data Types, in detail. However, if any doubt occurs, feel free to ask in the comment section.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a huge set of data types available in Impala. Basically, those Impala Data Types we use for table columns, expression values, and function arguments and return values. Each Impala Data Types serves&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":19060,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[3486,6506],"class_list":["post-11573","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-impala","tag-data-types-in-impala","tag-impala-data-types"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Impala Data Types: Usage, Syntax and Examples - DataFlair<\/title>\n<meta name=\"description\" content=\"Impala Data types, Types of Data types in Impala, BIGINT, BOOLEAN, CHAR, DECIMAL, DOUBLE, FLOAT, INT, SMALLINT, STRING, TIMESTAMP, TINYINT, VARCHAR, ARRAY\" \/>\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\/impala-data-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Impala Data Types: Usage, Syntax and Examples - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Impala Data types, Types of Data types in Impala, BIGINT, BOOLEAN, CHAR, DECIMAL, DOUBLE, FLOAT, INT, SMALLINT, STRING, TIMESTAMP, TINYINT, VARCHAR, ARRAY\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/impala-data-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-03-28T06:36:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-09T07:41:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Impala-Data-Types-Usage-Syntax-and-Examples-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=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Impala Data Types: Usage, Syntax and Examples - DataFlair","description":"Impala Data types, Types of Data types in Impala, BIGINT, BOOLEAN, CHAR, DECIMAL, DOUBLE, FLOAT, INT, SMALLINT, STRING, TIMESTAMP, TINYINT, VARCHAR, ARRAY","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\/impala-data-types\/","og_locale":"en_US","og_type":"article","og_title":"Impala Data Types: Usage, Syntax and Examples - DataFlair","og_description":"Impala Data types, Types of Data types in Impala, BIGINT, BOOLEAN, CHAR, DECIMAL, DOUBLE, FLOAT, INT, SMALLINT, STRING, TIMESTAMP, TINYINT, VARCHAR, ARRAY","og_url":"https:\/\/data-flair.training\/blogs\/impala-data-types\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-03-28T06:36:46+00:00","article_modified_time":"2021-05-09T07:41:17+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Impala-Data-Types-Usage-Syntax-and-Examples-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":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Impala Data Types: Usage, Syntax and Examples","datePublished":"2018-03-28T06:36:46+00:00","dateModified":"2021-05-09T07:41:17+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/"},"wordCount":474,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Impala-Data-Types-Usage-Syntax-and-Examples-01.jpg","keywords":["data types in impala","Impala Data Types"],"articleSection":["Impala Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/impala-data-types\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/","url":"https:\/\/data-flair.training\/blogs\/impala-data-types\/","name":"Impala Data Types: Usage, Syntax and Examples - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Impala-Data-Types-Usage-Syntax-and-Examples-01.jpg","datePublished":"2018-03-28T06:36:46+00:00","dateModified":"2021-05-09T07:41:17+00:00","description":"Impala Data types, Types of Data types in Impala, BIGINT, BOOLEAN, CHAR, DECIMAL, DOUBLE, FLOAT, INT, SMALLINT, STRING, TIMESTAMP, TINYINT, VARCHAR, ARRAY","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/impala-data-types\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Impala-Data-Types-Usage-Syntax-and-Examples-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Impala-Data-Types-Usage-Syntax-and-Examples-01.jpg","width":1200,"height":628,"caption":"Impala Data Types: Usage, Syntax and Examples"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/impala-data-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Impala Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/impala\/"},{"@type":"ListItem","position":3,"name":"Impala Data Types: Usage, Syntax and Examples"}]},{"@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\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/11573","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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=11573"}],"version-history":[{"count":1,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/11573\/revisions"}],"predecessor-version":[{"id":94055,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/11573\/revisions\/94055"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/19060"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=11573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=11573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=11573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}