赞
踩
1. 使用insert or update语句操作数据时,出现如下所示的提示信息
原因:登陆的帐号对表没有写入和删除的权限,
解决方法:申请对表的操作权限
- get_data_frame executing SQL : (pymysql.err.OperationalError) (1142, "errCode = 2, detailMessage = LOAD command denied to user 'default_cluster:dbuser'@'192.2.232.100' for table 'default_cluster:dws: dws_bi__log'")
- [SQL: insert into dws.dws_bi__log ();]
- (Background on this error at: https://sqlalche.me/e/14/e3q8)
2 出现 unsupported operand type(s) for *: 'float' and 'decimal.Decimal' 原因:wac_gapj是小数,而且小数位数有6位,而bdt_qty_sepecial_customer是一个整数的变量,因此不能直接相乘,而是要转化成相同精度的小数,才能计算,修改如下: bdt_amount_sepecial_customer=Decimal(bdt_qty_sepecial_customer)*(wac_gap) bdt_amount_control=(wac_gap)*Decimal(bdt_qty_control) gain_amount=(wac_gap)*Decimal(gain_qty)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。