feat: try cast timestamp types from number string (#6060)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2025-05-07 19:29:35 +08:00
committed by GitHub
parent 06126147d2
commit 60acf28f3c
3 changed files with 4 additions and 2 deletions

View File

@@ -107,6 +107,8 @@ fn parse_string_to_value(
target_unit: t.unit(),
},
)?))
} else if let Ok(ts) = i64::from_str(s.as_str()) {
Ok(Value::Timestamp(Timestamp::new(ts, t.unit())))
} else {
ParseSqlValueSnafu {
msg: format!("Failed to parse {s} to Timestamp value"),