File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -9869,7 +9869,12 @@ impl<'a> Parser<'a> {
98699869 self.parse_optional_precision()?,
98709870 TimezoneInfo::Tz,
98719871 )),
9872- Keyword::TIMESTAMP_NTZ => Ok(DataType::TimestampNtz),
9872+ // Consume optional precision for Snowflake/Databricks TIMESTAMP_NTZ, e.g. TIMESTAMP_NTZ(3)
9873+ // Precision is currently not represented in the AST variant, but we must not error on it.
9874+ Keyword::TIMESTAMP_NTZ => {
9875+ let _ = self.parse_optional_precision()?;
9876+ Ok(DataType::TimestampNtz)
9877+ }
98739878 Keyword::TIME => {
98749879 let precision = self.parse_optional_precision()?;
98759880 let tz = if self.parse_keyword(Keyword::WITH) {
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ fn test_snowflake_create_table() {
4444 }
4545}
4646
47+ #[ test]
48+ fn test_snowflake_create_table_timestamp_ntz_precision_ctas_values ( ) {
49+ let sql = "CREATE TABLE t (x TIMESTAMP_NTZ(3)) AS SELECT * FROM VALUES ('2025-04-09T21:11:23')" ;
50+ let canonical = "CREATE TABLE t (x TIMESTAMP_NTZ) AS SELECT * FROM (VALUES ('2025-04-09T21:11:23'))" ;
51+ snowflake ( ) . one_statement_parses_to ( sql, canonical) ;
52+ }
53+
4754#[ test]
4855fn parse_sf_create_secure_view_and_materialized_view ( ) {
4956 for sql in [
You can’t perform that action at this time.
0 commit comments