{"id":109275,"date":"2021-02-19T11:57:56","date_gmt":"2021-02-19T06:27:56","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?page_id=109275"},"modified":"2024-04-12T14:30:30","modified_gmt":"2024-04-12T09:00:30","slug":"hive-data-types","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/","title":{"rendered":"Hive Data types"},"content":{"rendered":"\n<p>Hive supports several sizes of integer and floating-point types, a Boolean type, and character strings of arbitrary length. Hive v0.8.0 added types for timestamps and binary fields. The data types supported by Hive are<\/p>\n\n\n\n<p><strong>Numeric Types<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>TINYINT &#8211; 1-byte signed integer, from -128 to 127<\/li><li>SMALLINT &#8211; 2-byte signed integer, from -32,768 to 32,767<\/li><li>INT &#8211; 4-byte signed integer, from -2,147,483,648 to 2,147,483,647<\/li><li>BIGINT &#8211; 8-byte signed integer, from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807<\/li><li>FLOAT &#8211; 4-byte single precision floating point number<\/li><li>DOUBLE &#8211; 8-byte double precision floating point number<\/li><li>DECIMAL Introduced in Hive 0.11.0 with a precision of 38 digits. Hive 0.13.0 introduced user definable precision and scale<\/li><\/ul>\n\n\n\n<p>Integral literals are assumed to be INT by default, unless the number exceeds the range of INT in which case it is interpreted as a BIGINT, or if one of the following postfixes is present on the number.<\/p>\n\n\n\n<p><strong>Date\/Time Types<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>TIMESTAMP &#8211; Only available starting with Hive 0.8.0. Supports traditional UNIX timestamp with optional nanosecond precision.<\/li><li>DATE &#8211; Only available starting with Hive 0.12.0. DATE values describe a particular year\/month\/day, in the form YYYY-\u00adMM-\u00adDD. For example, DATE &#8216;2013-\u00ad01-\u00ad01&#8217;. Date types do not have a time of day component. The range of values supported for the Date type is be 0000-\u00ad01-\u00ad01 to 9999-\u00ad12-\u00ad31, dependent on support by the primitive Java Date type.<\/li><\/ul>\n\n\n\n<p><strong>String Types<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>STRING &#8211; String literals can be expressed with either single quotes (&#8216;) or double quotes (&#8220;). Hive uses C-style escaping within the strings.<\/li><li>VARCHAR Only available starting with Hive 0.12.0. Varchar types are created with a length specifier (between 1 and 65355), which defines the maximum number of characters allowed in the character string.<\/li><li>CHAR Only available starting with Hive 0.13.0. Char types are similar to Varchar but they are fixed-length meaning that values shorter than the specified length value are padded with spaces but trailing spaces are not important during comparisons. The maximum length is fixed at 255.<\/li><\/ul>\n\n\n\n<p><strong>Complex Types<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>arrays: ARRAY&lt;data_type&gt; &#8211; negative values and non-constant expressions are allowed as of Hive 0.14. Arrays in Hive are used the same way they are used in Java &#8211; Syntax: ARRAY&lt;data_type&gt;<\/li><li>maps: MAP&lt;primitive_type, data_type&gt; &#8211; negative values and non-constant expressions are allowed as of Hive 0.14. They are also similar to Java maps &#8211; Syntax: MAP&lt;primitive_type, data_type&gt;<\/li><li>structs: STRUCT&lt;col_name : data_type [COMMENT col_comment], &#8230;&gt;. Structs in Hive is similar to using complex data with comment.<\/li><li>union: UNIONTYPE&lt;data_type, data_type, &#8230;&gt; &#8211; Only available starting with Hive 0.7.0. Union types can at any one point hold exactly one of their specified data types. You can create an instance of this type using the create_union UDF.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Hive supports several sizes of integer and floating-point types, a Boolean type, and character strings of arbitrary length. Hive v0.8.0 added types for timestamps and binary fields. The data types supported by Hive are Numeric Types TINYINT &#8211; 1-byte signed integer, from -128 to 127 SMALLINT &#8211; 2-byte signed integer, from -32,768 to 32,767 INT&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-109275","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Hive Data types - Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hive Data types - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Hive supports several sizes of integer and floating-point types, a Boolean type, and character strings of arbitrary length. Hive v0.8.0 added types for timestamps and binary fields. The data types supported by Hive are Numeric Types TINYINT &#8211; 1-byte signed integer, from -128 to 127 SMALLINT &#8211; 2-byte signed integer, from -32,768 to 32,767 INT...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T09:00:30+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/\",\"name\":\"Hive Data types - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2021-02-19T06:27:56+00:00\",\"dateModified\":\"2024-04-12T09:00:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hive Data types\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hive Data types - Tutorial","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:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/","og_locale":"en_US","og_type":"article","og_title":"Hive Data types - Tutorial","og_description":"Hive supports several sizes of integer and floating-point types, a Boolean type, and character strings of arbitrary length. Hive v0.8.0 added types for timestamps and binary fields. The data types supported by Hive are Numeric Types TINYINT &#8211; 1-byte signed integer, from -128 to 127 SMALLINT &#8211; 2-byte signed integer, from -32,768 to 32,767 INT...","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T09:00:30+00:00","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/","name":"Hive Data types - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2021-02-19T06:27:56+00:00","dateModified":"2024-04-12T09:00:30+00:00","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/hive-data-types\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Hive Data types"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/109275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=109275"}],"version-history":[{"count":1,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/109275\/revisions"}],"predecessor-version":[{"id":109276,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/109275\/revisions\/109276"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=109275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=109275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=109275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}