xitep commented on code in PR #2185:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2185#discussion_r2749282720
##########
src/parser/mod.rs:
##########
@@ -14185,25 +14185,35 @@ impl<'a> Parser<'a> {
/// Parse a `CONNECT BY` clause (Oracle-style hierarchical query support).
pub fn parse_connect_by(&mut self) -> Result<ConnectBy, ParserError> {
- let (condition, relationships) = if
self.parse_keywords(&[Keyword::CONNECT, Keyword::BY]) {
- let relationships = self.with_state(ParserState::ConnectBy,
|parser| {
- parser.parse_comma_separated(Parser::parse_expr)
+ let (condition, relationships, nocycle) = if self
+ .parse_keywords(&[Keyword::CONNECT, Keyword::BY])
+ {
+ let (relationships, nocycle) =
self.with_state(ParserState::ConnectBy, |parser| {
Review Comment:
fyi; i just realised that for validation and error reporting we'll need at
least to have the start tokens of the corresponding "kind" clauses; i'll extend
`ConnectByKind` to this:
```rust
enum ConnectByKind {
ConnectBy{
connect_token: AttachedToken,
nocycle: bool,
relationships: Vec<Expr>,
},
StartsWith {
start_token: AttachedToken,
condition: Expr
}
}
```
--
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]