diff --git a/src/sql/src/statements.rs b/src/sql/src/statements.rs index 754c98a9f78e..cdb1c3c9ae5a 100644 --- a/src/sql/src/statements.rs +++ b/src/sql/src/statements.rs @@ -141,10 +141,15 @@ macro_rules! parse_number_to_value { Ok(Value::$Type($Target::from(n))) }, )+ - _ => ParseSqlValueSnafu { - msg: format!("Fail to parse number {}, invalid column type: {:?}", - $n, $data_type - )}.fail(), + ConcreteDataType::Timestamp(t) => { + let n = parse_sql_number::($n)?; + Ok(Value::Timestamp(Timestamp::new(n, t.unit()))) + }, + + _ => ParseSqlValueSnafu { + msg: format!("Fail to parse number {}, invalid column type: {:?}", + $n, $data_type + )}.fail(), } } } @@ -163,8 +168,7 @@ pub fn sql_number_to_value(data_type: &ConcreteDataType, n: &str) -> Result