[
https://issues.apache.org/jira/browse/FLINK-31985?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17724681#comment-17724681
]
Jark Wu commented on FLINK-31985:
---------------------------------
Do you mean the return type of Table API {{currentDate()}} doesn't return
"DATE" but "TIMESTAMP"? If that is true, I think this is a bug and welcome
contributing the fix.
> The currentDate() get transformed to TIMESTAMP_LTZ(3) instead of DATE()
> -----------------------------------------------------------------------
>
> Key: FLINK-31985
> URL: https://issues.apache.org/jira/browse/FLINK-31985
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / JDBC
> Affects Versions: 1.16.1
> Reporter: Dheeraj Panangat
> Priority: Major
>
> As per the
> [doc|https://nightlies.apache.org/flink/flink-docs-release-1.17/docs/dev/table/functions/systemfunctions/],
> the currentDate() function should match the SQL Function CURRENT_DATE
> and currentTimestamp() function should match the SQL Function
> CURRENT_TIMESTAMP.
> Currently seeing that the currentDate() transforms the column to TIMESTAMP
> instead of DATE.
> Alternate/Temporary Solution which works :
> If instead of using {{}}
> {code:java}
> table.select(currentDate().as("xyz_date"){code}
> if I write SqlQuery
> {code:java}
> select CURRENT_DATE as xyz_date{code}
> it work fine and gets the value as a DATE and not timestamp
> Can we please fix this for flink version 1.16 ?
> Thanks
--
This message was sent by Atlassian Jira
(v8.20.10#820010)