/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
{
  "type": "record",
  "name": "Sample",
  "namespace": "test",
  "fields": [
    {
      "name": "primitive_double",
      "type": "double",
      "default": 0.0
    },
    {
      "name": "primitive_float",
      "type": "float",
      "default": 0.0
    },
    {
      "name": "primitive_int",
      "type": "int",
      "default": 0
    },
    {
      "name": "primitive_long",
      "type": "long",
      "default": 0
    },
    {
      "name": "primitive_unsigned_int",
      "type": "long",
      "default": 0
    },
    {
      "name": "primitive_unsigned_long",
      "type": {
        "type": "fixed",
        "name": "unsigned_long",
        "namespace": "org.apache.hudi.protos",
        "size": 9,
        "logicalType": "decimal",
        "precision": 20,
        "scale": 0
      },
      "default": "\u0000"
    },
    {
      "name": "primitive_signed_int",
      "type": "int",
      "default": 0
    },
    {
      "name": "primitive_signed_long",
      "type": "long",
      "default": 0
    },
    {
      "name": "primitive_fixed_int",
      "type": "int",
      "default": 0
    },
    {
      "name": "primitive_fixed_long",
      "type": "long",
      "default": 0
    },
    {
      "name": "primitive_fixed_signed_int",
      "type": "int",
      "default": 0
    },
    {
      "name": "primitive_fixed_signed_long",
      "type": "long",
      "default": 0
    },
    {
      "name": "primitive_boolean",
      "type": "boolean",
      "default": false
    },
    {
      "name": "primitive_string",
      "type": {
        "type": "string",
        "avro.java.string": "String"
      },
      "default": ""
    },
    {
      "name": "primitive_bytes",
      "type": "bytes",
      "default": ""
    },
    {
      "name": "repeated_primitive",
      "type": {
        "type": "array",
        "items": "int"
      },
      "default": []
    },
    {
      "name": "map_primitive",
      "type": {
        "type": "array",
        "items": {
          "type": "record",
          "name": "MapPrimitiveEntry",
          "namespace": "test.map_primitive",
          "fields": [
            {
              "name": "key",
              "type": {
                "type": "string",
                "avro.java.string": "String"
              },
              "default": ""
            },
            {
              "name": "value",
              "type": "int",
              "default": 0
            }
          ]
        }
      },
      "default": []
    },
    {
      "name": "nested_message",
      "type": [
        "null",
        {
          "type": "record",
          "name": "Nested",
          "namespace": "test.nested_message",
          "fields": [
            {
              "name": "nested_int",
              "type": "int",
              "default": 0
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "repeated_message",
      "type": {
        "type": "array",
        "items": {
          "type": "record",
          "name": "Nested",
          "namespace": "test.repeated_message",
          "fields": [
            {
              "name": "nested_int",
              "type": "int",
              "default": 0
            }
          ]
        }
      },
      "default": []
    },
    {
      "name": "map_message",
      "type": {
        "type": "array",
        "items": {
          "type": "record",
          "name": "MapMessageEntry",
          "namespace": "test.map_message",
          "fields": [
            {
              "name": "key",
              "type": {
                "type": "string",
                "avro.java.string": "String"
              },
              "default": ""
            },
            {
              "name": "value",
              "type": [
                "null",
                {
                  "type": "record",
                  "name": "Nested",
                  "namespace": "test.map_message.value",
                  "fields": [
                    {
                      "name": "nested_int",
                      "type": "int",
                      "default": 0
                    }
                  ]
                }
              ],
              "default": null
            }
          ]
        }
      },
      "default": []
    },
    {
      "name": "wrapped_string",
      "type": [
        "null",
        {
          "type": "record",
          "name": "StringValue",
          "namespace": "test.wrapped_string",
          "fields": [
            {
              "name": "value",
              "type": {
                "type": "string",
                "avro.java.string": "String"
              },
              "default": ""
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "wrapped_int",
      "type": [
        "null",
        {
          "type": "record",
          "name": "Int32Value",
          "namespace": "test.wrapped_int",
          "fields": [
            {
              "name": "value",
              "type": "int",
              "default": 0
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "wrapped_long",
      "type": [
        "null",
        {
          "type": "record",
          "name": "Int64Value",
          "namespace": "test.wrapped_long",
          "fields": [
            {
              "name": "value",
              "type": "long",
              "default": 0
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "wrapped_unsigned_int",
      "type": [
        "null",
        {
          "type": "record",
          "name": "UInt32Value",
          "namespace": "test.wrapped_unsigned_int",
          "fields": [
            {
              "name": "value",
              "type": "long",
              "default": 0
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "wrapped_unsigned_long",
      "type": [
        "null",
        {
          "type": "record",
          "name": "UInt64Value",
          "namespace": "test.wrapped_unsigned_long",
          "fields": [
            {
              "name": "value",
              "type": "org.apache.hudi.protos.unsigned_long",
              "default": "\u0000"
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "wrapped_double",
      "type": [
        "null",
        {
          "type": "record",
          "name": "DoubleValue",
          "namespace": "test.wrapped_double",
          "fields": [
            {
              "name": "value",
              "type": "double",
              "default": 0.0
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "wrapped_float",
      "type": [
        "null",
        {
          "type": "record",
          "name": "FloatValue",
          "namespace": "test.wrapped_float",
          "fields": [
            {
              "name": "value",
              "type": "float",
              "default": 0.0
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "wrapped_boolean",
      "type": [
        "null",
        {
          "type": "record",
          "name": "BoolValue",
          "namespace": "test.wrapped_boolean",
          "fields": [
            {
              "name": "value",
              "type": "boolean",
              "default": false
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "wrapped_bytes",
      "type": [
        "null",
        {
          "type": "record",
          "name": "BytesValue",
          "namespace": "test.wrapped_bytes",
          "fields": [
            {
              "name": "value",
              "type": "bytes",
              "default": ""
            }
          ]
        }
      ],
      "default": null
    },
    {
      "name": "enum",
      "type": {
        "type": "enum",
        "name": "SampleEnum",
        "symbols": [
          "FIRST",
          "SECOND"
        ]
      },
      "default": "FIRST"
    },
    {
      "name": "timestamp",
      "type": [
        "null",
        {
          "type": "record",
          "name": "Timestamp",
          "namespace": "test.timestamp",
          "fields": [
            {
              "name": "seconds",
              "type": "long",
              "default": 0
            },
            {
              "name": "nanos",
              "type": "int",
              "default": 0
            }
          ]
        }
      ],
      "default": null
    }
  ]
}