

{"id":10455,"date":"2018-03-10T11:54:05","date_gmt":"2018-03-10T11:54:05","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=10455"},"modified":"2018-03-10T11:54:05","modified_gmt":"2018-03-10T11:54:05","slug":"hive-udf","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/hive-udf\/","title":{"rendered":"Hive UDF &#8211; User Defined Function with Example"},"content":{"rendered":"<p><span style=\"font-weight: 400\">In the last hive tutorial, we studied the <strong>Hive View &amp; Index<\/strong>. In this blog, we will learn the whole concept of\u00a0<strong>Apache Hive<\/strong> UDF (User-Defined Function)<\/span><span style=\"font-weight: 400\">. Also, we will learn Hive UDF example as well as be testing to understand Hive user-defined function well.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">What is Hive UDF?<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Basically, we can use two different interfaces for writing Apache Hive User Defined Functions. <\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400\"> Simple API <\/span><\/li>\n<li><span style=\"font-weight: 400\"> Complex API <\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">As long as our function reads and returns primitive types, we can use the simple API (org.apache.hadoop.hive.ql.exec.UDF). In other words, it means basic <strong>Hadoop<\/strong> &amp; Hive writable types. Such as Text, IntWritable, LongWritable, DoubleWritable, etc.<\/span><\/p>\n<p>Before we proceed, let&#8217;s discuss <strong>Hive Features &amp; Limitations<\/strong> in detail.<br \/>\n<span style=\"font-weight: 400\">So, let\u2019s discuss each Hive UDF API in detail:<\/span><\/p>\n<h3><span style=\"font-weight: 400\">a. Simple API<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Basically, with the simpler UDF API, building a Hive User Defined Function involves little more than writing a class with one function (evaluate). However, let\u2019s see an example to understand it well:<\/span><br \/>\n<strong>Simple API &#8211; Hive UDF Example<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\">class SimpleUDFExample extends UDF\n      {\n         \u00a0public Text evaluate(Text input)\n               {\n \u00a0\u00a0                 \u00a0return new Text(\"Hello \" + input.toString());\n\u00a0              }\n      }<\/pre>\n<h4><strong>i. TESTING SIMPLE Hive UDF<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">Moreover, we can test it with regular testing tools, like JUnit, since the Hive UDF is simple one function.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">public class SimpleUDFExampleTest\n    { \u00a0\n\u00a0      @Test\n      \u00a0public void testUDF()\n          {\n\u00a0\u00a0\u00a0          SimpleUDFExample example = new SimpleUDFExample();\n\u00a0\u00a0          \u00a0Assert.assertEquals(\"Hello world\", example.evaluate(new Text(\"world\")).toString());\n\u00a0         }\n   }<\/pre>\n<h3><span style=\"font-weight: 400\">b. Complex API<\/span><\/h3>\n<p><span style=\"font-weight: 400\">However, to write code for objects that are not writable types. Like struct, map and array types. Hence the org.apache.hadoop.hive.ql.udf.generic. GenericUDF API offers a way.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In addition, for the function arguments, it needs us to manually manage object inspectors. Also, to verify the number and types of the arguments we receive. To be more specific, an object inspector offers a consistent interface for underlying object types.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> Hence, that different object implementation can all be accessed in a consistent way from within hive. For example, we could implement a struct as a Map so long as you provide a corresponding object inspector.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Moreover, with this API we need to implement three methods:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">\/\/ this is like the evaluate method of the simple API. It takes the actual arguments and returns the result\nabstract Object evaluate(GenericUDF.DeferredObject[] arguments);\n\/\/ Doesn't really matter, we can return anything but should be a string representation of the function.\nabstract String getDisplayString(String[] children);\n\/\/ called once, before any evaluate() calls. You receive an array of object inspectors that represent the arguments of the function\n\/\/ this is where you validate that the function is receiving the correct argument types and the correct number of arguments.\nabstract ObjectInspector initialize(ObjectInspector[] arguments);<\/pre>\n<p><span style=\"font-weight: 400\">To understand this properly, \u00a0let\u2019s take an example.<\/span><br \/>\n<strong>Complex API &#8211; Apache Hive UDF Example<\/strong><br \/>\n<span style=\"font-weight: 400\">Basically, here the creation of a function called containsString. However, it takes two arguments:<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400\"> A list of Strings:<\/span><\/li>\n<li><span style=\"font-weight: 400\"> A String<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">Further, it returns true\/false on whether the list contains the string that we offer, for example:<\/span><br \/>\nLet&#8217;s learn<strong> Apache Hive Operators<\/strong> in detail.<br \/>\n<span style=\"font-weight: 400\">containsString(List(&#8220;a&#8221;, &#8220;b&#8221;, &#8220;c&#8221;), &#8220;b&#8221;); \/\/ true<\/span><br \/>\n<span style=\"font-weight: 400\">containsString(List(&#8220;a&#8221;, &#8220;b&#8221;, &#8220;c&#8221;), &#8220;d&#8221;); \/\/ false<\/span><\/p>\n<h4>i.\u00a0GenericUDF API<\/h4>\n<p><span style=\"font-weight: 400\">However, the GenericUDF API needs a little more boilerplate, unlike with Hive UDF API:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">class ComplexUDFExample extends GenericUDF\n   {\n     \u00a0ListObjectInspector listOI;\n     \u00a0StringObjectInspector elementOI;\n\u00a0     @Override\n\u00a0     public String getDisplayString(String[] arg0)\n         {\n\u00a0\u00a0\u00a0         return \"arrayContainsExample()\"; \/\/ this should probably be better\n\u00a0        }\n@Override\n\u00a0    public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException\n        {\n\u00a0\u00a0\u00a0       if (arguments.length != 2)\n              {\n\u00a0\u00a0\u00a0\u00a0\u00a0              throw new UDFArgumentLengthException(\"arrayContainsExample only takes 2 arguments: List&lt;T&gt;, T\");\n\u00a0\u00a0\u00a0           }<\/pre>\n<pre class=\"EnlighterJSRAW\">\/\/ 1. Check we received the right object types.\n\u00a0\u00a0\u00a0ObjectInspector a = arguments[0];\n\u00a0\u00a0\u00a0ObjectInspector b = arguments[1];\n\u00a0\u00a0\u00a0if (!(a instanceof ListObjectInspector) || !(b instanceof StringObjectInspector))\n      {\n\u00a0\u00a0\u00a0\u00a0\u00a0    throw new UDFArgumentException(\"first argument must be a list \/ array, second argument must be a string\");\n\u00a0\u00a0\u00a0   }\n\u00a0\u00a0\u00a0this.listOI = (ListObjectInspector) a;\n\u00a0\u00a0\u00a0this.elementOI = (StringObjectInspector) b;\n\/\/ 2. Check that the list contains strings\n\u00a0\u00a0\u00a0if(!(listOI.getListElementObjectInspector() instanceof StringObjectInspector))\n      {\n\u00a0\u00a0\u00a0\u00a0\u00a0    throw new UDFArgumentException(\"first argument must be a list of strings\");\n\u00a0\u00a0\u00a0   }\u00a0\n\/\/ the return type of our function is a boolean, so we provide the correct object inspector\n \u00a0\u00a0\u00a0return PrimitiveObjectInspectorFactory.javaBooleanObjectInspector;\n    \u00a0}\n\u00a0@Override\n\u00a0 public Object evaluate(DeferredObject[] arguments) throws HiveException\n     { \u00a0\n\/\/ get the list and string from the deferred objects using the object inspectors\n    \u00a0\u00a0\u00a0List&lt;String&gt; list = (List&lt;String&gt;) this.listOI.getList(arguments[0].get());\n\u00a0\u00a0\u00a0    String arg = elementOI.getPrimitiveJavaObject(arguments[1].get());\u00a0\u00a0\n\/\/ check for nulls\n\u00a0\u00a0\u00a0   if (list == null || arg == null)\n        {\n\u00a0\u00a0\u00a0\u00a0\u00a0     return null;\n\u00a0\u00a0     \u00a0}\u00a0\n\/\/ see if our list contains the value we need\n      \u00a0for(String s: list)\n          {\n\u00a0\u00a0\u00a0\u00a0\u00a0        if (arg.equals(s)) return new Boolean(true);\n\u00a0\u00a0\u00a0       }\n\u00a0\u00a0    \u00a0return new Boolean(false);\n\u00a0    }\n  }<\/pre>\n<h4>ii. TESTING\u00a0Complex Hive UDF<\/h4>\n<p><span style=\"font-weight: 400\">However, in the setup, there is the complex part of testing the function.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">public class ComplexUDFExampleTest\n   {\n\u00a0@Test\npublic void testComplexUDFReturnsCorrectValues() throws HiveException\n      {\n\/\/ set up the models we need\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ComplexUDFExample example = new ComplexUDFExample();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectInspector stringOI = PrimitiveObjectInspectorFactory.javaStringObjectInspector;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ObjectInspector listOI = ObjectInspectorFactory.getStandardListObjectInspector(stringOI);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0JavaBooleanObjectInspector resultInspector = (JavaBooleanObjectInspector) example.initialize(new ObjectInspector[]{listOI, stringOI});\u00a0\n\/\/ create the actual UDF arguments\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0List&lt;String&gt; list = new ArrayList&lt;String&gt;();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0list.add(\"a\");\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0list.add(\"b\");\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0list.add(\"c\");\u00a0\u00a0\n\/\/ test our results\u00a0\n\/\/ the value exists\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Object result = example.evaluate(new DeferredObject[]{new DeferredJavaObject(list), new DeferredJavaObject(\"a\")});\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Assert.assertEquals(true, resultInspector.get(result));\u00a0\n\/\/ the value doesn't exist\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Object result2 = example.evaluate(new DeferredObject[]{new DeferredJavaObject(list), new DeferredJavaObject(\"d\")});\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Assert.assertEquals(false, resultInspector.get(result2));\u00a0\u00a0\n\/\/ arguments are null\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Object result3 = example.evaluate(new DeferredObject[]{new DeferredJavaObject(null), new DeferredJavaObject(null)});\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Assert.assertNull(result3);\n     }\n }<\/pre>\n<p>So, this was all\u00a0about Hive User Defined Function Tutorial. Hope you like our explanation user-defined function in Hive.<\/p>\n<h2><span style=\"font-weight: 400\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Hence, we have seen the whole concept of Apache Hive UDF and types of interfaces for writing UDF in Apache Hive: Simple API &amp; Complex API with example. Still, if you have doubt, feel free to ask in the comment section.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last hive tutorial, we studied the Hive View &amp; Index. In this blog, we will learn the whole concept of\u00a0Apache Hive UDF (User-Defined Function). Also, we will learn Hive UDF example as&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":10459,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[2794,2795,5055,5796,5797,5799,12873,12874,14640,14645,14646,14647],"class_list":["post-10455","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hive","tag-complex-api","tag-complex-api-example","tag-genericudf-api","tag-hive-udf","tag-hive-udf-example","tag-hive-user-defined-functions","tag-simple-api","tag-simple-api-example","tag-testing-complex-hive-udf","tag-testing-of-complex-api","tag-testing-of-simple-api","tag-testing-simple-hive-udf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Hive UDF - User Defined Function with Example - DataFlair<\/title>\n<meta name=\"description\" content=\"What is Apache Hive UDF,Hive UDF example,types of interfaces for writing Apache Hive User Defined Function: Simple API &amp; Complex API with testing &amp; 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\/hive-udf\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hive UDF - User Defined Function with Example - DataFlair\" \/>\n<meta property=\"og:description\" content=\"What is Apache Hive UDF,Hive UDF example,types of interfaces for writing Apache Hive User Defined Function: Simple API &amp; Complex API with testing &amp; example\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/hive-udf\/\" \/>\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-10T11:54:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Apache-Hive-UDF-User-Defined-Function-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":"Hive UDF - User Defined Function with Example - DataFlair","description":"What is Apache Hive UDF,Hive UDF example,types of interfaces for writing Apache Hive User Defined Function: Simple API & Complex API with testing & 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\/hive-udf\/","og_locale":"en_US","og_type":"article","og_title":"Hive UDF - User Defined Function with Example - DataFlair","og_description":"What is Apache Hive UDF,Hive UDF example,types of interfaces for writing Apache Hive User Defined Function: Simple API & Complex API with testing & example","og_url":"https:\/\/data-flair.training\/blogs\/hive-udf\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-03-10T11:54:05+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Apache-Hive-UDF-User-Defined-Function-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\/hive-udf\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Hive UDF &#8211; User Defined Function with Example","datePublished":"2018-03-10T11:54:05+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/"},"wordCount":495,"commentCount":4,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Apache-Hive-UDF-User-Defined-Function-01.jpg","keywords":["Complex API","Complex api example","GenericUDF API","Hive UDF","Hive UDF example","hive User-Defined Functions","Simple API","Simple API example","TESTING Complex Hive UDF","testing of Complex api","testing of simple api","TESTING simple Hive UDF"],"articleSection":["Hive Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/hive-udf\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/","url":"https:\/\/data-flair.training\/blogs\/hive-udf\/","name":"Hive UDF - User Defined Function with Example - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Apache-Hive-UDF-User-Defined-Function-01.jpg","datePublished":"2018-03-10T11:54:05+00:00","description":"What is Apache Hive UDF,Hive UDF example,types of interfaces for writing Apache Hive User Defined Function: Simple API & Complex API with testing & example","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/hive-udf\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Apache-Hive-UDF-User-Defined-Function-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Apache-Hive-UDF-User-Defined-Function-01.jpg","width":1200,"height":628,"caption":"Introduction to Hive UDF"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/hive-udf\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Hive Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/hive\/"},{"@type":"ListItem","position":3,"name":"Hive UDF &#8211; User Defined Function with Example"}]},{"@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\/10455","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=10455"}],"version-history":[{"count":0,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/10455\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/10459"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=10455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=10455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=10455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}