Skip to content

YYYY-MM-DD HH: mm format date string cast to date returns null object, result is incorrect #837

@wsk1314zwr

Description

@wsk1314zwr

Describe the bug

When the Blaze switch is turned on, the YYYY-MM-DD HH: mm format date string cast to date returns a null object This is inconsistent with the result of Spark without Blaze enabled.

To Reproduce
Steps to reproduce the behavior:

-- one : create table
CREATE TABLE default.test_01 (
  access_time STRING COMMENT '最近访问时间')
stored as orc;

-- two:insert data with YYYY-MM-DD HH: mm format
insert overwrite default.test_01 values('2022-03-22 22:27')

-- three:open blaze
set spark.blaze.enable=true;

-- four: select
select 
access_time,cast('2022-03-22 22:27' as date),cast(access_time as date)
from default.test_01 ;

-- The return result is as follows: the second and third columns have the same input, but different outputs
access_time      | CAST(2022-03-22 22:27 AS DATE) | access_time
2022-03-22 22:27 | 2022-03-22                     |  null

Expected behavior

Looking forward to receiving the correct results

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Spark3.4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions