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

Add configurable date field extraction style for unparsing #21

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

sgrebnov
Copy link

Which issue does this PR close?

PR introduces option to specify Datetime subfield extraction style for unparsing. Different DBMSs follow different standards; popular ones are:

date_part('YEAR', date '2001-02-16')
EXTRACT(YEAR from date '2001-02-16')

Some DBMSs, like Postgres, support both, whereas others like MySQL require EXTRACT.

This is required for MySQL and Athena: spiceai/spiceai#1951

@sgrebnov sgrebnov force-pushed the sgrebnov/custom_date_field_extract branch from d1af73f to 3ab503c Compare July 19, 2024 03:20
@sgrebnov sgrebnov merged commit b255618 into spiceai-40 Jul 19, 2024
@sgrebnov sgrebnov deleted the sgrebnov/custom_date_field_extract branch July 19, 2024 05:26
@sgrebnov sgrebnov self-assigned this Jul 19, 2024
y-f-u pushed a commit that referenced this pull request Jul 29, 2024
* Configurable date field extraction style for unparsing (#21)

* Add support for IntervalStyle::MySQL (#18)

* Support alternate format for Int64 unparsing (SIGNED for MySQL) (#22)

* Alternate format support for Timestamp casting (DATETIME for MySQL) (#23)

* Improve

* Fix clippy and docs
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