code: func ToAvro(namePrefix string, ed *dosa.EntityDefinition) ([]byte, error) {
  	fields := make([]*Field, len(ed.Columns))
  	for i, c := range ed.Columns {
  		props := make(map[string]string)
  		props[dosaTypeKey] = c.Type.String()
  		// TODO add tags
  		fields[i] = &Field{
  			Name:       c.Name,
  			Type:       avroTypes[c.Type],
  			Properties: props,
  			Default:    nil,
  		}
  	}
  
  	meta := make(map[string]interface{})
  	meta[partitionKeys] = ed.Key.PartitionKeys
  	meta[clusteringKeys] = ed.Key.ClusteringKeys
  	meta[indexKeys] = ed.Indexes
  
  	ar := &Record{
  		Name:       ed.Name,
  		Namespace:  namePrefix,
  		Fields:     fields,
  		Properties: meta,
  	}
  
  	bs, err := ar.MarshalJSON()
  	if err != nil {
  		return nil, errors.Wrap(err, "failed to serialize avro schema into json")
  	}
  	return bs, nil
  }
docs: // ToAvro converts dosa entity definition to avro schema