

{"id":22191,"date":"2018-08-08T07:00:35","date_gmt":"2018-08-08T07:00:35","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=22191"},"modified":"2018-08-08T07:00:35","modified_gmt":"2018-08-08T07:00:35","slug":"avro-schema","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/avro-schema\/","title":{"rendered":"Avro Schema &#8211; Schema Declaration &amp; Schema Resolution"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Today, in this <strong>Apache Avro Tutorial<\/strong>, we will see Avro Schema. Moreover, in this Avro Schema, we will discuss the Schema declaration and Schema resolution. <\/span><\/p>\n<p><span style=\"font-weight: 400\">Also, we will learn how to create Avro Schema using JSON and data types in Schema i.e. primitive data types and complex data types in Apache Avro Schema. Along with this, we will understand Schemas in Apache Avro with Avro Schema Example.<\/span><\/p>\n<p>So, let&#8217;s start Apache Avro Schema.<\/p>\n<h2><span style=\"font-weight: 400\">What is Avro Schema?<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Basically, on schemas, only Avro relies on. The schema used, when Avro data is read, and when writing it is always present. By making serialization both fast and small, it allows each datum to be written with no-par-value overheads.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Avro schema is stored with Avro data when it is stored in a file, hence that files may be later processed by any program. However, there could be an error occur, that the program reading the data expects a different schema. So, we can easily resolve because both schemas are present.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The client and server in Avro exchange schemas in the connection handshake, while Avro is used in RPC. If somehow the client and the server both have the correspondence between same-named fields, other&#8217;s full schema, extra fields, missing fields, etc. we can easily resolve it.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Since Avro schemas are defined with <em>JSON<\/em>. Due to this reason, in all the languages that already have JSON libraries, it facilitates implementation.<\/span><\/p>\n<p><span style=\"font-weight: 400\">However, Avro accepts schemas as input. Avro follows its own standards of defining schemas, instead of variously available schemas. These schemas consist of various details \u2212<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Type of file (record by default)<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Location of record<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Name of the record<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Fields in the record with their corresponding data types<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">We can store serialized values in binary format using less space, with the help of these schemas. Also, note that even without any metadata, these values stores.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Schema Declaration\/Creating Avro Schemas Using JSON<\/span><\/h2>\n<p><span style=\"font-weight: 400\">In a lightweight text-based data interchange format, JavaScript Object Notation (JSON), the Avro schema is created. It is possible to create Avro Schema using JSON in one of the several ways \u2212<\/span><\/p>\n<div id=\"attachment_22253\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Schema-Declaration-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-22253\" class=\"wp-image-22253 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Schema-Declaration-01.jpg\" alt=\"Avro Schema\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Schema-Declaration-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Schema-Declaration-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Schema-Declaration-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Schema-Declaration-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Schema-Declaration-01-1024x536.jpg 1024w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-22253\" class=\"wp-caption-text\">Schema Declaration\/Creating Avro Schemas Using JSON<\/p><\/div>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A JSON string<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">JSON object<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">A JSON array<\/span><\/li>\n<\/ol>\n<h3>a. Avro Schema Example<\/h3>\n<p><span style=\"font-weight: 400\">Now, within <em>&#8220;DataFlair&#8221;<\/em> namespace, the given schema defines a (record type) document. Here, Document\u2019s name is &#8220;Student&#8221; which consists of two &#8220;Fields&#8221; \u2192 Name and Age.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">{\n  \"type\" : \"record\",\n  \"namespace\" : \"DataFlair\",\n  \"name\" : \"Student\",\n  \"fields\" : [\n     { \"name\" : \"Name\" , \"type\" : \"string\" },\n     { \"name\" : \"Age\" , \"type\" : \"int\" }\n  ]\n}<\/pre>\n<p><span style=\"font-weight: 400\">As we can see there are four attributes in this schema, such as \u2212<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">type <\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It describes document type, in this case, a &#8220;record&#8221;.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">namespace \u2212 <\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It illustrates the name of the namespace, where the object resides.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">name<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It explains the schema name.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">fields <\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is an attribute array which consists of:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">name <\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It describes the name of the field<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Type<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It describes data type of field<\/span><\/p>\n<h3><span style=\"font-weight: 400\">b. Primitive Types<\/span><\/h3>\n<p><span style=\"font-weight: 400\">Here is the list of primitive type names in Apache Avro Schema:<\/span><\/p>\n<ol>\n<li><span style=\"font-weight: 400\"><strong> null:<\/strong> no value.<\/span><\/li>\n<li><span style=\"font-weight: 400\"><strong> boolean:<\/strong> a binary value.<\/span><\/li>\n<li><span style=\"font-weight: 400\"><strong> int:<\/strong> 32-bit signed integer.<\/span><\/li>\n<li><span style=\"font-weight: 400\"><strong> long:<\/strong> 64-bit signed integer.<\/span><\/li>\n<li><span style=\"font-weight: 400\"><strong> float:<\/strong> single precision (32-bit) IEEE 754 floating-point number.<\/span><\/li>\n<li><span style=\"font-weight: 400\"><strong> double:<\/strong> double precision (64-bit) IEEE 754 floating-point number.<\/span><\/li>\n<li><span style=\"font-weight: 400\"><strong> bytes:<\/strong> the sequence of 8-bit unsigned bytes.<\/span><\/li>\n<li><span style=\"font-weight: 400\"><strong> string:<\/strong> Unicode character sequence.<\/span><\/li>\n<li><span style=\"font-weight: 400\"> Primitive types have no specified attributes.<\/span><\/li>\n<\/ol>\n<h3><span style=\"font-weight: 400\">c. Complex Types<\/span><\/h3>\n<p><span style=\"font-weight: 400\">There are six kinds of complex types in Apache Avro Schema, such as:<\/span><\/p>\n<h4>i. Avro Schema Records<\/h4>\n<p><span style=\"font-weight: 400\">Basically, it uses the type name &#8220;record&#8221; and does support various attributes, such as:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">name<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is a <em>JSON string<\/em> which describes the name of the record (required).<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">namespace<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This is a JSON string which qualifies the name;<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Doc<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is a JSON string which provides documentation to the user of this schema (optional).<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">aliases<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This is a JSON array of strings, which describes the alternate names for this record (optional).<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">fields<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is a JSON array, listing fields (required).<\/span><span style=\"font-family: Verdana, Geneva, sans-serif\">\u00a0<\/span><\/p>\n<h4>ii. Avro Schema Enums<\/h4>\n<p><span style=\"font-weight: 400\">It uses \u00a0the type name &#8220;enum&#8221; \u00a0also do supports various attributes:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">name<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is a JSON string which provides the name of the enum (required).<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">namespace, <\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This is a JSON string which qualifies the name;<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">aliases<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is a JSON array of strings, which provides the alternate names for this enum (optional).<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">doc<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This is a JSON string which provides documentation to the user of this schema (optional).<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">symbols<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is a JSON array, listing symbols, as JSON strings (required). Make sure, all the symbols in an enum must be Arrays.<\/span><\/p>\n<h4><strong>iii. Arrays in Avro Schema<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">It uses the type name &#8220;array&#8221; and supports only one attribute:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">items<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is simply the schema of the array&#8217;s items.<\/span><\/p>\n<h4><strong>iv. Avro Schema Maps<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">It uses the type name &#8220;map&#8221; and does support only one attribute:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">values<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is the schema of the map&#8217;s values. Make sure, Map keys are assumed to be strings.<\/span><\/p>\n<h4><strong>v. Unions in Avro Schema<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">By using JSON arrays, Unions are represented. Make sure, Unions may not contain other unions, immediately.<\/span><\/p>\n<h4><strong>vi. Fixed Avro Schema<\/strong><\/h4>\n<p><span style=\"font-weight: 400\">It uses the type name &#8220;fixed&#8221; and does support the following attributes:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">name<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">It is a string naming this fixed (required).<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">namespace<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400\">This is a string that qualifies the name.<\/span><\/p>\n<h2><span style=\"font-weight: 400\">Schema Resolution<\/span><\/h2>\n<p><span style=\"font-weight: 400\">At times, this is possible that the schema which is present may not be exactly the schema that was expected. Let\u2019s understand Avro Schema Resolution in this way, the versions of both read and write of data are different, then records may have had fields added or removed.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Basically, the schema which we use to write the data is what we call the writer&#8217;s schema, or the schema what the application expects is the reader&#8217;s schema. So, the differences between both must be resolved as follows: <\/span><\/p>\n<p><strong>A. If the two schemas do not match, this is an error.<\/strong><br \/>\n<span style=\"font-weight: 400\">So, in order to match, one of the following statement must hold:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">It is must that both schemas are arrays, whose item types match.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">When both schemas are maps their value types must match.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">It is must that both the schemas are enums and their names match.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Moreover, both schemas\u00a0which are present their sizes and names must match.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Both the schemas are records but with the same name<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">It is possible either schema is a union.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">It is the must that both schemas have the same primitive type.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Now, make sure that the writer&#8217;s schema may promote to the reader&#8217;s as follows:<\/span><\/li>\n<\/ol>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Int is promotable to long, float, or double.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Long is promotable to float or double.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The float is promotable to double.<\/span><\/li>\n<\/ul>\n<p><strong>B. If both are records<\/strong><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">It is possible that the that the fields are matched by name and order of fields may be different.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Make sure the schemas for fields with the same name in both records\u00a0resolve\u00a0recursively.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The writer&#8217;s value for that field is ignored if the writer&#8217;s record contains a field with a name not present in the reader&#8217;s record.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">The reader should use the default value from its field, if the reader&#8217;s record schema has a field that contains a default value, and writer&#8217;s schema does not have a field with the same name.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">An error occurs, if somehow the reader&#8217;s record schema has a field with no default value, and the writer&#8217;s schema does not have a field with the same name.<\/span><\/li>\n<\/ol>\n<p><strong>C. If both are enums<\/strong><\/p>\n<p><span style=\"font-weight: 400\">An error occurs if the writer&#8217;s symbol is not present in the reader&#8217;s enum.<\/span><\/p>\n<p><strong>D. If both are arrays<\/strong><\/p>\n<p><span style=\"font-weight: 400\">Moreover, there is a case when both are arrays, then this resolution algorithm must apply recursively to the reader&#8217;s and writer&#8217;s array item schemas.<\/span><\/p>\n<p><strong>E. If both are maps<\/strong><\/p>\n<p><span style=\"font-weight: 400\">Further, if both are maps, then this resolution algorithm is applied recursively to the reader&#8217;s and writer&#8217;s value schemas.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>F.<\/strong> I<strong>f in any case the reader&#8217;s is a union, but the writer&#8217;s one is not,<\/strong> then the in the reader&#8217;s union, the first schema, that matches the <\/span><\/p>\n<p><span style=\"font-weight: 400\">writer&#8217;s schema is recursively resolved against it. Here also, an error occurs, if none match.<\/span><\/p>\n<p><span style=\"font-weight: 400\"><strong>G. When a case occurs when a writer is a union, but the reader&#8217;s\u00a0one is not,<\/strong>\u00a0and if the reader&#8217;s schema matches the selected <\/span><span style=\"font-weight: 400\">writer&#8217;s schema, it is recursively resolved against it. An error\u00a0occurs if they do not match.<\/span><\/p>\n<p>So, this was all in Apache Avro Schema. Hope you like our explanation.<\/p>\n<h2><span style=\"font-weight: 400\">Conclusion: Avro Schema<\/span><\/h2>\n<p><span style=\"font-weight: 400\">Hence, in this Avro Schema tutorial, we have learned the whole about Apache Avro Schemas in detail which also includes Schema Declaration &amp; Avro Schema Resolution to understand well.<\/span><\/p>\n<p><span style=\"font-weight: 400\"> Also, we saw Avro Schema example and creating Avro Schema from JSON. Still, if any doubt, ask in the comment tab.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, in this Apache Avro Tutorial, we will see Avro Schema. Moreover, in this Avro Schema, we will discuss the Schema declaration and Schema resolution. Also, we will learn how to create Avro Schema&#46;&#46;&#46;<\/p>\n","protected":false},"author":7,"featured_media":22261,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[737,1303,1304,1305,1306,1307,1308,1309,1310,1312,2796,3050,3051,9966,15034],"class_list":["post-22191","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-avro","tag-apache-avro","tag-avro-schem-registry","tag-avro-schema","tag-avro-schema-evolution","tag-avro-schema-example","tag-avro-schema-generator","tag-avro-schema-map-example","tag-avro-schema-multiple-records","tag-avro-schema-optional-field","tag-avro-schema-validator","tag-complex-data-types","tag-create-avro-schema","tag-create-avro-schema-using-json","tag-primitive-data-types","tag-types-of-complex-data-types"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Avro Schema - Schema Declaration &amp; Schema Resolution - DataFlair<\/title>\n<meta name=\"description\" content=\"Apache Avro Schema,Avro schema resolution,avro schema declaration,avro schema example,generate avro schema from JSON,avro data types- primitive,complex\" \/>\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\/avro-schema\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Avro Schema - Schema Declaration &amp; Schema Resolution - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Apache Avro Schema,Avro schema resolution,avro schema declaration,avro schema example,generate avro schema from JSON,avro data types- primitive,complex\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/avro-schema\/\" \/>\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-08-08T07:00:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Avro-Schema-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=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Avro Schema - Schema Declaration &amp; Schema Resolution - DataFlair","description":"Apache Avro Schema,Avro schema resolution,avro schema declaration,avro schema example,generate avro schema from JSON,avro data types- primitive,complex","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\/avro-schema\/","og_locale":"en_US","og_type":"article","og_title":"Avro Schema - Schema Declaration &amp; Schema Resolution - DataFlair","og_description":"Apache Avro Schema,Avro schema resolution,avro schema declaration,avro schema example,generate avro schema from JSON,avro data types- primitive,complex","og_url":"https:\/\/data-flair.training\/blogs\/avro-schema\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-08-08T07:00:35+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Avro-Schema-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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/beb0cab24b7aa54423a3b50e669a9dcd"},"headline":"Avro Schema &#8211; Schema Declaration &amp; Schema Resolution","datePublished":"2018-08-08T07:00:35+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/"},"wordCount":1446,"commentCount":2,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Avro-Schema-01.jpg","keywords":["Apache Avro","Avro Schem registry","Avro Schema","Avro Schema evolution","Avro Schema example","Avro Schema generator","Avro Schema Map example","Avro Schema Multiple Records","Avro Schema Optional Field","Avro Schema Validator","Complex data Types","Create avro Schema","create Avro Schema using JSON","Primitive data Types","types of Complex data types"],"articleSection":["AVRO Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/avro-schema\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/","url":"https:\/\/data-flair.training\/blogs\/avro-schema\/","name":"Avro Schema - Schema Declaration &amp; Schema Resolution - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Avro-Schema-01.jpg","datePublished":"2018-08-08T07:00:35+00:00","description":"Apache Avro Schema,Avro schema resolution,avro schema declaration,avro schema example,generate avro schema from JSON,avro data types- primitive,complex","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/avro-schema\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Avro-Schema-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/07\/Apache-Avro-Schema-01.jpg","width":1200,"height":628,"caption":"Avro Schema - Schema Declaration &amp; Schema Resolution"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/avro-schema\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"AVRO Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/avro\/"},{"@type":"ListItem","position":3,"name":"Avro Schema &#8211; Schema Declaration &amp; Schema Resolution"}]},{"@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\/22191","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=22191"}],"version-history":[{"count":0,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/22191\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/22261"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=22191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=22191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=22191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}