运行Python redu时FileNotFoundException

2024-05-13 21:09:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我在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'。”

知道为什么吗?你知道吗


Tags: 文件代码用户sqldataapplicationlocalcontainer
1条回答
网友
1楼 · 发布于 2024-05-13 21:09:07

我们也遇到过这种情况。这似乎是当用户代码抛出异常时发生的一般错误。我的猜测是,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)]})
";

记得把你的产品换成:

PRODUCE h string

相关问题 更多 >