![](/img/trans.png)
[英]Azure Data Lake Analytics IOutputter get output file name
[英]Azure Data Lake Analytics IOutputter E_RUNTIME_USER_ROWTOOBIG
我正在尝试将自定义IOutputter的结果写入本地磁盘上的中间文件。
之后,我想将数据库文件(〜20MB)复制到adl输出存储中。
可悲的是脚本以以下结尾:
Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.dll中发生了类型为“ Microsoft.Cosmos.ScopeStudio.BusinessObjects.Debugger.ScopeDebugException”的未处理异常
附加信息:{“ diagnosticCode”:195887112,“ severity”:“ Error”,“ component”:“ RUNTIME”,“ source”:“ User”,“ errorId”:“ E_RUNTIME_USER_ROWTOOBIG”,“ message”:“该行有超出了最大允许的4MB大小“,” description“:”“,” resolution“:”“,” helpLink“:”“,” details“:”该行已超过了最大允许的4MB大小“,” internalDiagnostics“ :“ 7ffe97231797 \\ tScopeEngine!?ToStringInternal @ KeySampleCollection @ SSLibV3 @ ScopeEngine @@ AEAA?AV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ std @@ XZ + 11b7 \\ t \\ n 7ffe971d7261 \\ tScopeEngine!?? 0ExceptionWithStack @ ScopeEngine @@ QEAA @ W4ErrorNumber @ 1 @ AEBV?$ initializer_list @ VScopeErrorArg @ ScopeCommon @@@ std @@ _ N @ Z + 121 \\ t \\ n 7ffe971d7f6a \\ tScopeEngine!?? 0RuntimeException @ ScopeEngine @@ QEAA @ W4ErrorNumber @ 1 @ PEBD @ Z + aa \\ t \\ n 7ffe6de06aca \\ t(无模块)(无名称)\\ t \\ n
public class CustomOutputter : IOutputter
{
private Stream stream;
public override void Close()
{
base.Close();
using (var fs = File.Open("mydb.data", FileMode.Open))
{
fs.CopyTo(stream);
}
}
public override void Output(IRow input, IUnstructuredWriter output)
{
if(stream == null)
stream = output.BaseStream;
myDb.Insert("somestuff");
}
}
关于这个问题有什么想法吗?
如错误消息所示,当前对USQL读取或写入的行的长度有限制,即4MB。 如果您使用CSV等面向记录的文件,则将达到此限制。
在https://github.com/Azure/usql/tree/master/Examples/FileCopyUDOs/FileCopyUDOs上有一个面向字节的文件读/写UDO示例,可以帮助您将文件作为二进制文件处理。 您可以使用此方法有效地对数据进行分块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.