Skip to content

Conversation

@sgrebnov
Copy link

@sgrebnov sgrebnov commented Jul 18, 2024

Which issue does this PR close?

PR implements support for IntervalStyle::MySQL

This fixes spiceai/spiceai#1950

MySQL Interval specification: https://dev.mysql.com/doc/refman/8.4/en/expressions.html#temporal-intervals

Note:

MySQL supports the DAY_MICROSECOND unit type (format is DAYS HOURS:MINUTES:SECONDS.MICROSECONDS), which can be used to optimize the number of INTERVAL elements for complex cases. The decision to use the current version (separate INTERVALs) is made to provide cleaner SQL for typical scenarios where only a few INTERVAL elements are used (day, hours, etc.).

The implementation has been updated to generate single INTERVAL expression as generated intervals sequence can't be wrapped in brackets - (INTERVAL 1 YEAR + INTERVAL 1 MONTH ...) so we need single expression so it works correct for interval subtraction cases

@sgrebnov sgrebnov self-assigned this Jul 18, 2024
@sgrebnov sgrebnov marked this pull request as draft July 18, 2024 08:20
@sgrebnov sgrebnov marked this pull request as ready for review July 18, 2024 19:32
@sgrebnov sgrebnov requested review from phillipleblanc and y-f-u July 19, 2024 01:51
@sgrebnov sgrebnov merged commit d0943b9 into spiceai-40 Jul 19, 2024
@sgrebnov sgrebnov deleted the sgrebnov/mysql-interval branch July 19, 2024 06:20
sgrebnov added a commit that referenced this pull request Jul 22, 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
phillipleblanc pushed a commit that referenced this pull request Apr 22, 2025
… ParquetOpener (apache#15561)

* parquet reader: move pruning predicate creation from ParquetSource to ParquetOpener

* use file schema, avoid loading page index if unecessary

* Add comment

* add comment

* Add comment

* remove check

* fix clippy

* update sqllogictest

* restore to explain plans

* reverted

* modify access

* Fix ArrowReaderOptions should read with physical_file_schema so we do… (#17)

* Fix ArrowReaderOptions should read with physical_file_schema so we don't need to cast back to utf8

* Fix fmt

* Update opener.rs

* Always apply per-file schema during parquet read (#18)

* Update datafusion/datasource-parquet/src/opener.rs

---------

Co-authored-by: Qi Zhu <821684824@qq.com>
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
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.

3 participants