运行Python reducer时出现FileNotFoundException

时间:2016-12-07 15:22:05

标签: python azure-data-lake u-sql

我在Python中实现了一个U-SQL reducer,它因FileNotFoundException而失败。

用户代码未处理的异常:“无法找到文件'D:\ data \ yarnnm \ local \ usercache \ eba8b163-16c8-40b9-9723-43d521d4ab10 \ appcache \ application_1480798662039_54518 \ container_e85_1480798662039_54518_01_000007 \ wd \ 42df9ef75185410d87f0cbf598f4bd55.output.0' 。“

任何想法为什么?

1 个答案:

答案 0 :(得分: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)]})
";

请记住将您的产品更改为:

  

PRODUCE         h string

相关问题