[ 
https://issues.apache.org/jira/browse/DRILL-8519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17935581#comment-17935581
 ] 

Oleg Zinoviev commented on DRILL-8519:
--------------------------------------

[~Moosheimer]
Try to use 'dd' instead of 'DD'
As far as i remember, 'DD' mead day of year, and thus month value erased.
See Format Specifiers for Date/Time Conversions 
(https://drill.apache.org/docs/data-type-conversion/#to_date)

> to_date returns always January
> ------------------------------
>
>                 Key: DRILL-8519
>                 URL: https://issues.apache.org/jira/browse/DRILL-8519
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.21.2
>            Reporter: Kay-Uwe Moosheimer
>            Priority: Critical
>
> Drill always returns January as the month for a select to_date(...).
> select to_date('2025-02-01', 'YYYY-MM-DD') -> 2025-01-01
> select to_date('2019-10-01', 'YYYY-MM-DD') -> 2019-01-01
> select to_date('2020-11-28', 'YYYY-MM-DD') -> 2020-01-28
> This is actually a blocker, but of course there is a workaround with 
> cast('2020-11-28' AS date)
> But it's not generally nice.
> Adopted/copied queries will not deliver a correct result.
> Config
> Drill 1.21.2
> Postgres 17.2
> drill-jdbc-all-1.21.2.jar



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to