aliyun / aliyun-odps-python-sdk

ODPS Python SDK and data analysis framework
http://pyodps.readthedocs.io
Apache License 2.0
434 stars 97 forks source link

pyodps,writer.write(records)出错 #52

Closed apan-liu closed 6 years ago

apan-liu commented 6 years ago

一次性插入数据报错, odps.models.table,line 476, in write IndexError:list index out of range

apan-liu commented 6 years ago

with t.open_writer(partition='p_date=%s'% self.now_date_format,create_partition=True ) as writer: writer.write(records) 这段出错了,升级到最新的opds模块是否能解决。

qinxuye commented 6 years ago

先升级试下。

apan-liu commented 6 years ago

恩,升级了。之前跑了两天,第3天报这个错误

qinxuye commented 6 years ago

把新的错误栈贴下。

apan-liu commented 6 years ago

最早是一次插入一行,效率感觉低。改成一次性插入后跑了2天就出这个问题

apan-liu commented 6 years ago

新的刚部署,等几天看看

apan-liu commented 6 years ago

升级最新的模块,跑了2天还是报这个错误 odps.models.table,line 565, in write IndexError:list index out of range

qinxuye commented 6 years ago

贴全错误栈

qinxuye commented 6 years ago
564                    elif isinstance(arg, (list, tuple)):
565                        if isinstance(arg[0], Record):

所以你觉得会是什么错误呢,很显然你传进来的 list 里面是空的,这更新版本也没用啊

apan-liu commented 6 years ago

恩,我在看看吧,怎么会传入为空[]

qinxuye commented 6 years ago

本质上你可以写

[
  [0, 'a']
  [1, 'b']
]

这样一次性写入多条,应该有的没有数据写入。应该把这些过滤掉