DataWorks你们这语法是怎么判定参数的, 我入参配置的是字符串,怎么给我解析成数字类型了,而且解析的就不对?
[INFO] [10:53:38.732] resource group is 0[INFO] [10:53:38.752] prepared test environment, take time 158 ms[INFO] [10:53:38.775] api context init , take time 2 ms
[INFO] [10:53:38.776] start to test api[416180068298768]: 查询展馆销售明细
[INFO] [10:53:38.776] test case parameters:
[INFO] [10:53:38.776] QUERY:[{“paramKey”:”pageNum”,”paramValue”:”1″},{“paramKey”:”pageSize”,”paramValue”:”10″},{“paramKey”:”beginTime”,”paramValue”:”20230501″},{“paramKey”:”endTime”,”paramValue”:”20230515″},{“paramKey”:”projectCode”,”paramValue”:”3300″},{“paramKey”:”siteIds”,”paramValue”:”28,45,50,47,52,48,75,77,79,78″},{“paramKey”:”sortValue”,”paramValue”:”gmv”}]
[INFO] [10:53:38.776] not use dynamic sql
[INFO] [10:53:38.777] api request execution started. [OK]
[INFO] [10:53:38.778] api sql realsql : SELECT site_id AS siteId, site_name AS siteName, SUM(day_gmv) AS gmv , SUM(day_sales) AS sales, SUM(gmv_goods_sell_count) AS gmvGoodsSellCount , SUM(sales_goods_sell_count) AS salesGoodsSellCount, SUM(gmv_order_count) AS gmvOrderCount , SUM(sales_order_count) AS salesOrderCount FROM odps_wsnb_online_ds_dws_site_sales_detail WHERE time >= 20230501 AND time <= 20230515 AND project_code = '3300' AND CASE WHEN CONCAT('28', '') IS NULL THEN 1 = 1 ELSE site_id IN ('45', '50', '47', '52', '48', '75', '77', '79', '78', '28,45,50,47,52,48,75,77,79,78') END GROUP BY site_id, site_name ORDER BY CASE WHEN 'gmv' IS NULL THEN 'gmv' ELSE 'gmv' END DESC
[INFO] [10:53:38.778] query database started. [OK]
[ERROR] [10:53:38.834] api request executed [FAILED]
[INFO] [10:53:38.834] api request executed, take time : 58 ms
[INFO] [10:53:38.834] api test finished, take time 60 ms
{
“apiLog”: null,
“data”: null,
“errCode”: 1108110622,
“errMsg”: “数据源查询失败:[PreparedStatementCallback; SQL [SELECT site_id AS siteId, site_name AS siteName, SUM(day_gmv) AS gmv , SUM(day_sales) AS sales, SUM(gmv_goods_sell_count) AS gmvGoodsSellCount , SUM(sales_goods_sell_count) AS salesGoodsSellCount, SUM(gmv_order_count) AS gmvOrderCount , SUM(sales_order_count) AS salesOrderCount FROM odps_wsnb_online_ds_dws_site_sales_detail WHERE time >= ? AND time <= ? AND project_code = ? AND CASE WHEN CONCAT(?, '') IS NULL THEN 1 = 1 ELSE site_id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) END GROUP BY site_id, site_name ORDER BY CASE WHEN ? IS NULL THEN 'gmv' ELSE ? END DESC
limit 10 offset 0]; ERROR: invalid input syntax for integer: \"28,45,50,47,52,48,75,77,79,78\"
位置:529; nested exception is org.postgresql.util.PSQLException: ERROR: invalid input syntax for integer: \"28,45,50,47,52,48,75,77,79,78\"
位置:529]",
“requestId”: “0abb7ee116847240183103713e893f”
}这参数就解析错了
SELECT
site_id AS siteId,
site_name AS siteName,
SUM(day_gmv) AS gmv,
SUM(day_sales) AS sales,
SUM(gmv_goods_sell_count) AS gmvGoodsSellCount,
SUM(sales_goods_sell_count) AS salesGoodsSellCount,
SUM(gmv_order_count) AS gmvOrderCount,
SUM(sales_order_count) AS salesOrderCount
FROM
dws_site_sales_detail
WHERE
time >= ${beginTime}
AND time <= ${endTime}
AND project_code = ${projectCode}
AND (
CASE WHEN CONCAT((${siteIds}), ”) IS NULL THEN
1 = 1
ELSE
(site_id IN (${siteIds}))
END)
GROUP BY
site_id,
site_name
ORDER BY
(
CASE WHEN ${sortValue} IS NULL THEN
‘gmv’
ELSE
${sortValue}
END) DESC这是我写的脚本,麻烦找下技术支持
这sql是可以执行的,就是api接口解析就解析错了
DataWorks你们这语法是怎么判定参数的, 我入参配置的是字符串,怎么给我解析成数字类型了,?[阿里云DataWorks]
「点点赞赏,手留余香」
还没有人赞赏,快来当第一个赞赏的人吧!