开发者社区> 问答> 正文

PyODPS脚本任务不定时出现 IncompleteRead问题

from odps import ODPS
from odps import options

options.tunnel.use_instance_tunnel = True
options.tunnel.limit_instance_tunnel = False

sql_query="select * from dwd.table_name where day='20190101'"
instance = o.run_sql(sql_query)
instance.wait_for_success()

with instance.open_reader() as reader:

print(u'共加载到%d条数据' % reader.count)
for item in reader:
    print (item)

使用上述方法读取odps上的数据时,会不定时的出现:

......
http.client.IncompleteRead: IncompleteRead(284 bytes read, 2785 more expected)

During handling of the above exception, another exception occurred:

......

raise ProtocolError('Connection broken:%r' %e, e)
urllib3,exceptions.ProtocolError:('Connection broken:IncompleteRead(7455 bytes read)',IncompleteRead(7455 bytes read) )

安装pyodps时,需要urllib3依赖,从错误日志中可以看出,上述现象和odps.tunnel.io.reader_c.TunnelRecordReader.__next__
odps.tunnel.io.reader_c.BaseTunnelRecordReader.read 有关系。

请问,这是什么原因导致的,怎样解决?

展开
收起
unliklll 2019-07-19 13:27:19 4943 0
1 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
DataWorks数据集成实时同步最佳实践(含内测邀请)-2020飞天大数据平台实战应用第一季 立即下载
DataWorks调度任务迁移最佳实践-2020飞天大数据平台实战应用第一季 立即下载
DataWorks商业化资源组省钱秘籍-2020飞天大数据平台实战应用第一季 立即下载

相关实验场景

更多