-
Notifications
You must be signed in to change notification settings - Fork 752
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
feat(query): add interval type #16990
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The meta data part looks good to me. Do not forget to add a new version test:
Reviewed 4 of 42 files at r1.
Reviewable status: 4 of 42 files reviewed, all discussions resolved
b43edcf
to
add4db2
Compare
wait databendlabs/bendsql#517 merge |
:) select to_interval('02:01'), to_interval('1 year 1 day 1 hour'); ┌───────────────────────────────────────────────────────────┐ │ to_interval('02:01') │ to_interval('1 year 1 day 1 hour') │ │ Interval │ Interval │ ├──────────────────────┼────────────────────────────────────┤ │ 2:01:00 │ 1year 1day 1:00:00 │ └───────────────────────────────────────────────────────────┘
17816e4
to
9e58cd9
Compare
@TCeason, when this is completed, will we be able to write such conversion as |
Yes, the results are quite similar. I’ve encountered a few issues currently, and I’ll add some similar tests later. |
Excellent, this will hopefully make it easy to wrap in SQLAlchemy for Python 👍 |
EXTENSION_KEY.to_string(), | ||
ARROW_EXT_TYPE_INTERVAL.to_string(), | ||
); | ||
ArrowDataType::LargeBinary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use FixedSizeBinary
instead of LargeBinary
, because the interval value has a fixed length, which will remove the offset and reduce the column size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 33 files at r4.
Reviewable status: 6 of 72 files reviewed, 1 unresolved discussion (waiting on @sundy-li and @TCeason)
Marking this as a draft: Compression support for FixedSizeBinaryColumn is required when using the fs storage type. Implementation is targeted for completion next week. |
I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Support new datatype Interval.
It represent periods of time that can be added to or subtracted from DATE, TIMESTAMP.
Note: Since MySQL does not support the INTERVAL type, querying the INTERVAL type using the MySQL client will result in an error.
Tests
Type of change
This change is