Open ayman-sigma opened 1 day ago
Right now ObjectName is just list of identifiers. We parse each object name path segment as a string identifier. Some dialects has more rich types for each path segment. This PR rework the object name to allow different types for each path segment.
ObjectName
Examples this PR will make it easier to support:
IDENTIFIER
SELECT * FROM myschema.IDENTIFIER(:mytab)
(:mytab)
TableFunctionArgs
SELECT * FROM db..table_name
PUBLIC
DefaultSchema
Most changes are mechanical except couple of locations I commented on below, in addition to the ast/mod.rs.
ast/mod.rs
I think ObjectNamePart::Wildcard or something would be better than what I did in #1538, so this seems like a good idea to me.
ObjectNamePart::Wildcard
Right now
ObjectName
is just list of identifiers. We parse each object name path segment as a string identifier. Some dialects has more rich types for each path segment. This PR rework the object name to allow different types for each path segment.Examples this PR will make it easier to support:
IDENTIFIER
clause. Example:SELECT * FROM myschema.IDENTIFIER(:mytab)
. The(:mytab)
is wrongly parsed right now asTableFunctionArgs
. More details: https://docs.databricks.com/en/sql/language-manual/sql-ref-names-identifier-clause.htmlSELECT * FROM db..table_name
. This indicates that use of default schemaPUBLIC
. With this PR, we can useDefaultSchema
variant for the path segment instead of using empty identifier. More details: https://docs.snowflake.com/en/sql-reference/name-resolution#resolution-when-schema-omitted-double-dot-notationMost changes are mechanical except couple of locations I commented on below, in addition to the
ast/mod.rs
.