伙计们,我必须把它从pl/sql(oracle)转换成hive格式:
NVL(TO_CHAR(TO_DATE(SUBSTR(LEAD(DATE_TIME) OVER (PARTITION BY CU_NO ORDER BY CR_NO ,TO_NUMBER(DATE_TIME)),1,6),'YYMMDD'),'YYYYMMDD'),'99991231') END_DATE
我已经试过了:
NVL(cast(from_unixtime(UNIX_TIMESTAMP(SUBSTR(LEAD(DATE_TIME) OVER (PARTITION BY CU_NO ORDER BY CR_NO ,TO_NUMBER(DATE_TIME)),1,6), 'yyMMdd' ),'yyyyMMdd') as string)'99991231') END_DATE
它总是在“yyyymmdd”附近的“)”处返回缺少的eof。出什么事了?
2条答案
按热度按时间rsaldnfx1#
NVL(cast(from_unixtime(UNIX_TIMESTAMP(SUBSTR(LEAD(DATE_TIME) OVER (PARTITION BY CU_NO ORDER BY CR_NO ,TO_NUMBER(DATE_TIME)),1,6), 'yyMMdd' ),'yyyyMMdd') as string)
缺少逗号, '99991231')
使用缩进格式:mjqavswn2#
您不需要按以下顺序额外添加到\u number():