From f984ad488287db281aa4b85450d021f7891e2867 Mon Sep 17 00:00:00 2001 From: Alex Qyoun-ae <4062971+MazterQyou@users.noreply.github.com> Date: Wed, 21 Feb 2024 20:21:03 +0400 Subject: [PATCH] fix(cubesql): Support `Z` postfix in `Timestamp` response transformation --- rust/cubesql/cubesql/src/compile/engine/df/scan.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rust/cubesql/cubesql/src/compile/engine/df/scan.rs b/rust/cubesql/cubesql/src/compile/engine/df/scan.rs index eec9f72f91c35..5ec0ef14b838c 100644 --- a/rust/cubesql/cubesql/src/compile/engine/df/scan.rs +++ b/rust/cubesql/cubesql/src/compile/engine/df/scan.rs @@ -1051,6 +1051,7 @@ pub fn transform_response( let timestamp = NaiveDateTime::parse_from_str(s.as_str(), "%Y-%m-%dT%H:%M:%S.%f") .or_else(|_| NaiveDateTime::parse_from_str(s.as_str(), "%Y-%m-%d %H:%M:%S.%f")) .or_else(|_| NaiveDateTime::parse_from_str(s.as_str(), "%Y-%m-%dT%H:%M:%S")) + .or_else(|_| NaiveDateTime::parse_from_str(s.as_str(), "%Y-%m-%dT%H:%M:%S.%fZ")) .map_err(|e| { DataFusionError::Execution(format!( "Can't parse timestamp: '{}': {}", @@ -1081,6 +1082,7 @@ pub fn transform_response( let timestamp = NaiveDateTime::parse_from_str(s.as_str(), "%Y-%m-%dT%H:%M:%S.%f") .or_else(|_| NaiveDateTime::parse_from_str(s.as_str(), "%Y-%m-%d %H:%M:%S.%f")) .or_else(|_| NaiveDateTime::parse_from_str(s.as_str(), "%Y-%m-%dT%H:%M:%S")) + .or_else(|_| NaiveDateTime::parse_from_str(s.as_str(), "%Y-%m-%dT%H:%M:%S.%fZ")) .map_err(|e| { DataFusionError::Execution(format!( "Can't parse timestamp: '{}': {}",