usql icon indicating copy to clipboard operation
usql copied to clipboard

Is there any Avro outputter example?

Open rwforest opened this issue 7 years ago • 7 comments

There is avro Reader, I am also interested in Avro outputter. Can somebody create an example for USQL based on this?

https://msdn.microsoft.com/en-us/library/dn749865.aspx

Thanks!

rwforest avatar Jul 25 '17 03:07 rwforest

I am working on it. I will soon make a PR.

flomader-zz avatar Sep 18 '17 21:09 flomader-zz

Waiting for Avro outputter

kollikr avatar Sep 22 '17 22:09 kollikr

@flomader any success with this? Starting to look at this same issue myself

rondefreitas avatar Oct 13 '17 19:10 rondefreitas

Any updates? Im also in need of an Avro outputter.

Since I couldnt find any info I wrote a very basic one today, but its very difficult since the documentation is very sparse.. The Apache Avro library only have very limited class documentation, and the documentation for how to implement your own IOutputter is also very very basic.

I have managed to produce a working avro file in a small test project that I can read from a python script, but it behaves very strange:

Apache Avro provides a DataFileWriter object which uses the Stream from the IUnstructuredWriter object. The issue is that DataFileWriter want to call Stream.Position when flushing the written data. But it seems like Position is not available and generates a null ref exception here: Microsoft.Analytics.UnitTest.USqlStreamProxy1.get_Position()`. Now, this is very difficult to research further since the USqlStreamProxy class is part of Microsoft.Analytics.UnitTest that I dont have the source code for..

For now I solved this with a try catch block, but that is very ugly

viblo avatar Oct 19 '17 14:10 viblo

Adding @flomader

MikeRys avatar Oct 20 '17 08:10 MikeRys

In case you are interested, I made a fork with my AvroOutputter here: https://github.com/nordicfactory/usql

viblo avatar Oct 20 '17 10:10 viblo

What is everyone using as an Avro outputter?

alexgman avatar Sep 08 '19 20:09 alexgman