Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-6624] SqlBabelParser should parse MySQL DATETIME type #4002

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dssysolyatin
Copy link
Contributor

No description provided.

@dssysolyatin dssysolyatin force-pushed the feature/support-mysql-datetime-type-parsing branch from b24d053 to 86e204b Compare October 11, 2024 15:56
@@ -6182,6 +6182,12 @@ SqlTypeNameSpec DateTimeTypeName() :
{
return new SqlBasicTypeNameSpec(typeName, precision, s.end(this));
}
|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this supposed to be in Babel?

Copy link
Contributor Author

@dssysolyatin dssysolyatin Oct 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding Babel, my initial plan was to implement DATETIME datatype parsing at the Babel parser level, but I noticed that we have DATETIME literal parsing for BigQuery inside Parser.jj, which is also valid for MySQL. Therefore, I decided to put DATETIME type parsing in Parser.jj, as it would be better to have both DATETIME datatype parsing and DATETIME literal parsing in the same place.

@dssysolyatin dssysolyatin force-pushed the feature/support-mysql-datetime-type-parsing branch 2 times, most recently from 492a2ae to 2833f46 Compare October 17, 2024 11:41
@dssysolyatin dssysolyatin force-pushed the feature/support-mysql-datetime-type-parsing branch from 2833f46 to 42206a9 Compare October 17, 2024 11:42
@dssysolyatin dssysolyatin changed the title [CALCITE-6624] SqlParser should parse MySQL DATETIME type [CALCITE-6624] SqlBabelParser should parse MySQL DATETIME type Oct 17, 2024
Copy link

sonarcloud bot commented Oct 17, 2024

Please retry analysis of this Pull-Request directly on SonarCloud


!ok

SELECT cast(cast(TIMESTAMP'9999-12-31 23:59:59' as DATETIME) as DATETIME);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also write DATETIME '1000-01-01 00:00:00'?
Are you supposed to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants