首页 文章

Azure Data Lake Analytics IOutputter E_RUNTIME_USER_ROWTOOBIG

提问于
浏览
0

我正在尝试将自定义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”:“”,“分辨率“:”“,”helpLink“:”“,”详细信息“:”行已超过允许的最大大小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");
        }
    }

关于这个问题的任何想法?

1 回答

  • 2

    由于错误消息表明当前对USQL读取或写入的行的长度有限制,即4MB . 如果您使用像CSV这样的面向记录的文件,您将达到此限制 .

    有一个面向字节的文件读/写UDO的例子,它可以帮助你在https://github.com/Azure/usql/tree/master/Examples/FileCopyUDOs/FileCopyUDOs处理文件作为二进制文件 . 您可以使用此方法有效地分块数据 .

相关问题