DataWorks这机器人怎么用啊?
gps = DataFrame(o.get_table('gps'))
sql = "SELECT receive_data, COUNT(*) as count FROM gps GROUP BY receive_data;"
with o.execute_sql(sql) as instance:
for record in instance.open_reader():
# record 是一个元组,包含 receive_data 和 count
receive_data = record[0] # 这是 BIGINT 类型的日期
count = record[1] # 这是对应的 GPS 数量
# 打印结果,可以选择将 BIGINT 转换为更易读的日期格式(如果需要)
print(f"Date: {int_to_date(receive_data)}, GPS Count: {count}")
报错Traceback (most recent call last):
File "", line 15, in
with o.execute_sql(sql) as instance:
File "/home/tops/lib/python3.7/site-packages/odps/core.py", line 806, in execute_sql
inst.wait_for_success()
File "/home/tops/lib/python3.7/site-packages/odps/models/instance.py", line 673, in wait_for_success
raise exc
odps.errors.ODPSError: ODPS-0130071: InstanceId: 20240718062855356gcfjhfyui22
with o.execute_sql(sql) as instance:
File "/home/tops/lib/python3.7/site-packages/odps/core.py", line 806, in execute_sql
inst.wait_for_success()
File "/home/tops/lib/python3.7/site-packages/odps/models/instance.py", line 673, in wait_for_success
raise exc
odps.errors.ODPSError: ODPS-0130071: InstanceId: 20240718062855356gcfjhfyui22>
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
DataWorks基于MaxCompute/Hologres/EMR/CDP等大数据引擎,为数据仓库/数据湖/湖仓一体等解决方案提供统一的全链路大数据开发治理平台。