Impala上的状态请求不正确



请求37563的错误状态:TGetOperationStatusResp(状态=TStatus(errorCode=无,errorMessage=无,sqlState=无,infoMessages=无,statusCode=0(,operationState=5,errorMessage=无,sqlState=无,errorCode=无(

当我尝试运行以下查询时,我正面临此问题。

refresh sst_spot_quotes;
select
case
when maxrecordforSST >= hours_sub (CURRENT_TIMESTAMP(), 4) then ''
else 'error'
end as msg
from
(
select
to_timestamp (
CONCAT (
max(rdate),
MAX(
CONCAT (
LPAD (CAST(rhour as STRING), 2, '0'),
':',
LPAD (CAST(rminute as STRING), 2, '0'),
':',
LPAD (CAST(rsecond as STRING), 2, '0')
)
)
),
'yyyy-mmm-ddhh:mm:ss'
) as maxrecordforSST
from
sst_spot_quotes
where
rdate >= days_sub (to_date (CURRENT_TIMESTAMP()), 1)
) a

有人能帮助解决这个错误吗。

日期格式必须为yyyy-MMM-ddhh:mm:ss。请注意,我将MMM设为大写。你能换一下试试吗?

此外,先得到最大值,然后再到timestamp,但要反转,这不是一个好主意。因为计算日期的最大值会比字符串给出正确的最大日期。

您可以尝试下面的SQL。

select
case
when maxrecordforSST >= hours_sub (CURRENT_TIMESTAMP(), 4) then ''
else 'error'
end as msg
from
(
select
MAX(to_timestamp (
CONCAT (
(rdate),
(
CONCAT (
LPAD (CAST(rhour as STRING), 2, '0'),
':',
LPAD (CAST(rminute as STRING), 2, '0'),
':',
LPAD (CAST(rsecond as STRING), 2, '0')
)
)
),
'yyyy-MMM-ddhh:mm:ss'
)) as maxrecordforSST
from
sst_spot_quotes
where
rdate >= days_sub (to_date (CURRENT_TIMESTAMP()), 1)
) a

相关内容

  • 没有找到相关文章

最新更新