Skip to content

Commit

Permalink
chore(cubesql): Support parsing date with time as Date32
Browse files Browse the repository at this point in the history
  • Loading branch information
MazterQyou committed Dec 14, 2023
1 parent a6267bd commit 16b097f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rust/cubesql/cubesql/src/compile/engine/df/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,9 @@ pub fn transform_response<V: ValueObject>(
{
(FieldValue::String(s), builder) => {
let date = NaiveDate::parse_from_str(s.as_str(), "%Y-%m-%d")
// FIXME: temporary solution for cases when expected type is Date32
// but underlying data is a Timestamp
.or_else(|_| NaiveDate::parse_from_str(s.as_str(), "%Y-%m-%dT00:00:00.000"))

Check warning on line 1108 in rust/cubesql/cubesql/src/compile/engine/df/scan.rs

View check run for this annotation

Codecov / codecov/patch

rust/cubesql/cubesql/src/compile/engine/df/scan.rs#L1108

Added line #L1108 was not covered by tests
.map_err(|e| {
DataFusionError::Execution(format!(
"Can't parse date: '{}': {}",
Expand Down

0 comments on commit 16b097f

Please sign in to comment.