starrocks icon indicating copy to clipboard operation
starrocks copied to clipboard

Using the date_trunc function and doing date addition or subtraction has inconsistent behavior with trino

Open LZGH opened this issue 1 year ago • 1 comments

Steps to reproduce the behavior (Required)

select date_trunc('month', CURRENT_DATE) - INTERVAL '4' MONTH; The date type is converted to datetime type

Expected behavior (Required)

2024-06-01 00:00:00.0

Real behavior (Required)

2024-06-01

StarRocks version (Required)

3.3.4

LZGH avatar Oct 15 '24 08:10 LZGH

Steps to reproduce the behavior (Required)

select date_trunc('month', CURRENT_DATE) - INTERVAL '4' MONTH; The date type is converted to datetime type

Expected behavior (Required)

2024-06-01 00:00:00.0

Real behavior (Required)

2024-06-01

StarRocks version (Required)

3.3.4

The content in 'Expected behavior' and 'Real behavior' needs to be adjusted.

Expected behavior (Required)
2024-06-01

Real behavior (Required)
2024-06-01 00:00:00

liubotao avatar Oct 16 '24 10:10 liubotao

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!

github-actions[bot] avatar Apr 14 '25 11:04 github-actions[bot]