JamesVorder commented on code in PR #2134:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2134#discussion_r2630712205
##########
src/parser/mod.rs:
##########
@@ -15188,6 +15137,11 @@ impl<'a> Parser<'a> {
let func_name = self.parse_object_name(true)?;
let func = self.parse_function(func_name)?;
return Ok(Some(TableVersion::Function(func)));
+ } else if dialect_of!(self is DatabricksDialect)
Review Comment:
I think relying on `supports_timestamp_versioning` alone might be
insufficient. Please help me understand the desired behavior, I'm pretty new to
the project.
The reason that I think that `supports_timestamp_versioning` may be
insufficient on its own is that if we rely exclusively on that function to
decide whether we parse `TIMESTAMP AS OF` syntax, then it will become available
in the BigQuery dialect (and Snowflake, and MSSQL) - incorrectly. This is the
reason I added an assertion to the BigQuery time travel test, looking for an
error when `TIMESTAMP AS OF` is used.
In fact, I think what I have in this PR is also insufficient. If I use valid
Snowflake time travel syntax (`SELECT * FROM tbl AT(TIMESTAMP => '2024-12-15
00:00:00')`), it's being accepted by the Databricks dialect. Instead, I would
expect the Databricks dialect to throw an error (`AT...` is not valid time
travel syntax in Databricks.)
Please help me understand the desired behavior here. Am I right to expect
that an error should be thrown in the cases mentioned?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]