-
Notifications
You must be signed in to change notification settings - Fork 209
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
fix: allow interval cast-related functions to accept only literals instead of evaluations #1238
fix: allow interval cast-related functions to accept only literals instead of evaluations #1238
Conversation
f7147ae
to
eb96e7f
Compare
Pull Request Test Coverage Report for Build 5177060014
💛 - Coveralls |
9abbbcf
to
196b74b
Compare
Value
to Interval
,@@ -173,7 +172,7 @@ impl JsonStorage { | |||
|
|||
let value = match value.get_type() { | |||
Some(data_type) if data_type != column_def.data_type => { | |||
block_on(value.cast(&column_def.data_type))? | |||
value.cast(&column_def.data_type)? |
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.
here was the only case which async_io
was used in json-storage.
may be we can remove async_io
in json storage Cargo.toml
core/src/data/interval/string.rs
Outdated
.await | ||
.and_then(Value::try_from) | ||
.map(String::from)?; | ||
let literal = match &*expr { |
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.
rather than &*expr
, expr.as_ref()
would be simple.
- remote async [Value::try_cast_from_literal, Interval::parse] - remove `DataType::Interval` cast to Value - remove `Value::try_into_interval` - Rename `From<&Interval> for String` to `to_sql_str`
60e8eb3
to
6709f06
Compare
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.
Awesome improvement! Thanks a lot 👍 👍
DataType::Interval
cast to ValueValue::try_into_interval
From<&Interval> for String
toto_sql_str