运行Python reducer时出现FileNotFoundException

运行Python reducer时出现FileNotFoundException,python,azure-data-lake,u-sql,Python,Azure Data Lake,U Sql,我已经在Python中实现了一个U-SQL reducer,但由于FileNotFoundException而失败 用户代码中未处理的异常:“找不到文件'D:\data\yarnnm\local\usercache\eba8b163-16c8-40b9-9723-43d521d4ab10\appcache\application\u 1480798662039\u 54518\container\u e85\u 1480798662039\u 54518\u 01\u000007\wd\42df

我已经在Python中实现了一个U-SQL reducer,但由于FileNotFoundException而失败

用户代码中未处理的异常:“找不到文件'D:\data\yarnnm\local\usercache\eba8b163-16c8-40b9-9723-43d521d4ab10\appcache\application\u 1480798662039\u 54518\container\u e85\u 1480798662039\u 54518\u 01\u000007\wd\42df9ef75185410d87f0cbf598f4bd55.output.0”。”


你知道为什么吗?

我们也遇到过这种情况。这似乎是当用户代码抛出异常时发生的一般错误。我的猜测是,ADLA中的用户python代码中没有错误的输出机制,因此会抛出未找到的输出文件。下面是我们实现的返回错误或打印通常会被吞没的语句的方法:

def usqlml_main(df):
try:
    stdout = sys.stdout
    sio = StringIO()
    sys.stdout = sio
    // script to run
    return pd.DataFrame({'h': [sio.getvalue()]})
except Exception as e:
    return pd.DataFrame({'h': [str(e)]})
";
请记住将您的产品更改为:

产生 h字符串


这个错误相当简单,它无法定位所请求的文件。你检查过文件是否存在吗?