Azure / Azure/usql

AvroExtractor makes new row for each column

Open
#101 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
231
Forks
666
PR merge metrics
No merged PRs in 30d

Description

I am wondering why the AvroExtractor is made to make a new row for each new column, and not a new row after all columns for that object have been read. See my comment in code snippet below, from AvroExtractor.cs
```
while (fileReader.HasNext())
{
var avroRecord = fileReader.Next();

foreach (var column in output.Schema)
{
if (avroRecord[column.Name] != null)
{
output.Set(column.Name, avroRecord[column.Name]);
}
else
{
output.Set(column.Name, null);
}

yield return output.AsReadOnly(); // Why here, and not after the foreach loop?
}
}
```
Consequence is that the output looks like this:
```
City Country Phone
NY
US
345
QD
CH
948
```
instead of
```
City Country Phone
NY US 345
QD CH 948
```

There's probably a purpose with the current way, but I don't quite understand it - so if someone could enlighten me, it would be greatly appreciated!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.