You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Oleg Zinoviev (Jira)" <ji...@apache.org> on 2025/03/14 16:10:00 UTC
[jira] [Comment Edited] (DRILL-8519) to_date returns always January
[ https://issues.apache.org/jira/browse/DRILL-8519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17935581#comment-17935581 ]
Oleg Zinoviev edited comment on DRILL-8519 at 3/14/25 4:09 PM:
---------------------------------------------------------------
[~Moosheimer]
Try to use 'dd' instead of 'DD'
As far as i remember, 'DD' mean 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)
was (Author: le.louch):
[~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)