-
Notifications
You must be signed in to change notification settings - Fork 136
QuickAvroLoad
Cinchoo edited this page Feb 28, 2021
·
1 revision
To load Avro file, use ChoAvroReader component to parse it. Sample below shows how to load Avro file (Emp.avro)
(Avro is binary format, sample shows the payload in JSON format for illustration purpose)
[
{
"Id": 1,
"Name": "Mark"
},
{
"Id": 2,
"Name": "Tom"
}
]
public class Employee
{
public int Id { get; set; }
public string Name { get; set; }
}
foreach (var e in new ChoAvroReader<Employee>("Emp.avro"))
Console.WriteLine("Id: " + e.Id + " Name: " + e.Name);
var reader = new ChoAvroReader<Employee>("Emp.avro");
Employee rec;
while ((rec = reader.Read()) != null)
Console.WriteLine("Id: " + e.Id + " Name: " + e.Name);
©2017 Cinchoo Inc