我目前使用的ChoETL库读取 parquet 数据,这是代码:
BlobServiceClient blobServiceClient = new BlobServiceClient(azureStorage);
BlobContainerClient container = blobServiceClient.GetBlobContainerClient(contenedor);
var blobs = container.GetBlobs().Where(x => x.Name.Contains(".parquet"));
try
{
foreach (var item in blobs)
{
var blob = container.GetBlobClient(item.Name);
await blob.OpenReadAsync();
//Here i'm trying to read the parquet file, as is shown in the official documentation https://github.com/Cinchoo/ChoETL/wiki/QuickParquetLoad
foreach (dynamic e in new ChoParquetReader(outStream))
{
Console.WriteLine("Id: " + e.Id + " FormNumber: " + e.FormNumber);
}
}
}
catch (Exception ex)
{
throw ex;
}
尝试执行它时,会在此行中引发错误:
foreach (dynamic e in new ChoParquetReader(outStream))
{
Console.WriteLine("Id: " + e.Id + " FormNumber: " + e.FormNumber);
}
有什么办法吗?我试过parquet.net,但我不喜欢
1条答案
按热度按时间vptzau2j1#
我找不到
outStream
在代码中的定义位置,但我认为这就是问题所在,您需要使用blob.OpenReadAsync()
提供的Stream
: