You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/10/11 15:52:00 UTC
[jira] [Updated] (CALCITE-6624) SqlParser should parse MySQL DATETIME type
[ https://issues.apache.org/jira/browse/CALCITE-6624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated CALCITE-6624:
------------------------------------
Labels: pull-request-available (was: )
> SqlParser should parse MySQL DATETIME type
> ------------------------------------------
>
> Key: CALCITE-6624
> URL: https://issues.apache.org/jira/browse/CALCITE-6624
> Project: Calcite
> Issue Type: Bug
> Components: babel, core
> Reporter: Dmitry Sysolyatin
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.37.0
>
>
> MySQL has two different data types: TIMESTAMP and DATETIME. The difference between them is the range they support.
> From the documentation [1]
> ??The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.??
> ??The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD hh:mm:ss' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.??
> Likely calcite's TIMESTAMP supports both ranges and for unparse logic MySQL dialect class always uses DATETIME, because TIMESTAMP range is subrange of DATETIME.
> The only missing part is parsing the DATETIME datatype. For example
> {code}
> SELECT timestamp_field AS DATETIME FROM <table>
> {code}
> [1] https://dev.mysql.com/doc/refman/8.4/en/datetime.html
--
This message was sent by Atlassian Jira
(v8.20.10#820010)