Uh oh!
There was an error while loading. Please reload this page.
Enhance object name path segments - #1539
Conversation
| // the first token is actually a name | ||
| name = Some(n.0[0].clone()); | ||
| match n.0[0].clone() { | ||
| ObjectNamePart::Identifier(ident) => name = Some(ident), |
There was a problem hiding this comment.
Once we start adding more to the ObjectNamePart enum, we will return parsing error for the other variants here.
| let aggregate_functions = self.parse_comma_separated(Self::parse_aliased_function_call)?; | ||
| self.expect_keyword(Keyword::FOR)?; | ||
| let value_column = self.parse_object_name(false)?.0; | ||
| let value_column = self.parse_period_separated_identifiers()?; |
There was a problem hiding this comment.
Giving this is a column name, we should parse it as period-separated identifiers and not as Object name.
mvzink
commented
Nov 20, 2024
I think |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
4b4998e to
18ca48fCompare
iffyio
left a comment
There was a problem hiding this comment.
Thanks @ayman-sigma! left some minor comments, this looks good to me overall
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
e22e3d8 to
176cf13Comparealamb
commented
Nov 30, 2024
Hi @ayman-sigma this PR appears to have some conflicts. Is there any chance you can resolve them so we can merge it in? Thank you! |
6f05bcf to
7791973Compareayman-sigma
commented
Dec 2, 2024
@alamb, Done. |
alamb
left a comment
There was a problem hiding this comment.
I started trying to update DataFusion to use this change -- it turns out to be fairly invasive.
You can try here: apache/datafusion#13546
(the issue is that we have a bunch of handling of ObjectName --> Indents code).
I think we can make the DataFusion code better / easier to follow
alamb
commented
Dec 11, 2024
Given the potential for non trivial downstream conflicts due to this change (look at the list of conflicts it has already collected) I would like to consider it for the next release |
ayman-sigma
commented
Dec 12, 2024
Sounds good. Thanks @alamb! |
iffyio
commented
Jan 18, 2025
@alamb just wanted to double check status of this PR if there were reservations you had or if you feel this is something we would be able to land? |
alamb
commented
Jan 18, 2025
My biggest reservation was that it would cause substantial downstream churn (I tried to make the changes to DataFUsion briefly and it was painful). So I just haven't had the heart to click the merge button I mentially was prepared if you merged it I would sort it out downstraem but I couldn't get myself to inflict the main on myself ... |
iffyio
commented
Jan 19, 2025
Ah yeah this is indeed an invasive change. Alright that makes sense! In that case @ayman-sigma please take a look at resolving the conflicts when you have some time to pick this back up and we can look to merge it? Sorry for the delay in getting to it |
alamb
commented
Jan 19, 2025
FWIW I did a test upgrade to DataFusion to prepare for the next release and it already had some non trivial changes needed (changes to FieldAccess specifically) |
ayman-sigma
commented
Jan 21, 2025
I'm fine to drop this PR if will cause too much pain downstream. Let me know if we still want to go with this PR and I can fix the conflicts. |
iffyio
commented
Jan 22, 2025
@ayman-sigma I think it would be good to get this PR in since it'll be good to support the So my thinking was to get this PR in for the next 0.55 release, and then any further extensions to the representation can come in later releases afterwards |
7791973 to
1c25ec4Compareayman-sigma
commented
Jan 25, 2025
@iffyio I rebased to main and resolved all conflicts. I made some changes in the last commit to best of my knowledge. Please make sure to review the last commit. Thanks! |
iffyio
commented
Jan 26, 2025
Thanks @ayman-sigma! |
This reverts commit 3ec49b2.
Right now
ObjectNameis 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:
IDENTIFIERclause. 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 useDefaultSchemavariant 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.