无法将字符串日期转换为配置单元中的unix时间戳

时间:2014-04-21 16:31:48

标签: sql hadoop mapreduce hive

我尝试执行以下查询:

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.

1 个答案:

答案 0 :(得分:0)

尝试将参数转换为unix_timestamp

中的字符串