gpt4 book ai didi

sql - 无法将 hive 中的String日期转换为unix时间戳

转载 作者:行者123 更新时间:2023-12-02 21:48:24 25 4
gpt4 key购买 nike

我试图执行以下查询:

SELECT
L_RETURNFLAG,
L_LINESTATUS,
SUM(L_QUANTITY) AS SUM_QTY,
SUM(L_EXTENDEDPRICE) AS SUM_BASE_PRICE,
SUM(L_EXTENDEDPRICE * (1 - L_DISCOUNT)) AS SUM_DISC_PRICE,
SUM(L_EXTENDEDPRICE * (1 - L_DISCOUNT) * (1 + L_TAX)) AS SUM_CHARGE,
AVG(L_QUANTITY) AS AVG_QTY,
AVG(L_EXTENDEDPRICE) AS AVG_PRICE,
AVG(L_DISCOUNT) AS AVG_DISC,
COUNT(*) AS COUNT_ORDER
FROM
LINEITEM
WHERE
unix_timestamp(L_SHIPDATE, 'yyyy-MM-dd')>1000
GROUP BY
L_RETURNFLAG,
L_LINESTATUS
ORDER BY
L_RETURNFLAG,
L_LINESTATUS;

但,

我收到错误消息:
 The function 'unix_timestamp' with the given argument types cannot be found.

最佳答案

尝试将参数转换为unix_timestamp中的字符串

关于sql - 无法将 hive 中的String日期转换为unix时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23201472/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com