xitep commented on code in PR #2185:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2185#discussion_r2747034447
##########
tests/sqlparser_common.rs:
##########
@@ -12785,6 +12785,61 @@ fn parse_connect_by() {
"prior"
)))]
);
+
+ // no START WITH and NOCYCLE
+ let connect_by_5 = "SELECT child, parent FROM t CONNECT BY NOCYCLE parent
= PRIOR child";
+ assert_eq!(
+ dialects.verified_only_select(connect_by_5),
+ Select {
+ select_token: AttachedToken::empty(),
+ optimizer_hint: None,
+ distinct: None,
+ top: None,
+ top_before_distinct: false,
+ projection: vec![
+ SelectItem::UnnamedExpr(Expr::Identifier(Ident::new("child"))),
+
SelectItem::UnnamedExpr(Expr::Identifier(Ident::new("parent"))),
+ ],
+ exclude: None,
+ from: vec![TableWithJoins {
+ relation:
table_from_name(ObjectName::from(vec![Ident::new("t")])),
+ joins: vec![],
+ }],
+ into: None,
+ lateral_views: vec![],
+ prewhere: None,
+ selection: None,
+ group_by: GroupByExpr::Expressions(vec![], vec![]),
+ cluster_by: vec![],
+ distribute_by: vec![],
+ sort_by: vec![],
+ having: None,
+ named_window: vec![],
+ qualify: None,
+ window_before_qualify: false,
+ value_table_mode: None,
+ connect_by: Some(ConnectBy {
+ condition: None,
+ relationships: vec![Expr::BinaryOp {
+ left: Expr::Identifier(Ident::new("parent")).into(),
+ op: BinaryOperator::Eq,
+ right:
Expr::Prior(Expr::Identifier(Ident::new("child")).into()).into(),
+ }],
+ nocycle: true,
+ }),
+ flavor: SelectFlavor::Standard,
+ }
+ );
+
+ // ~ CONNECT BY after WHERE and before GROUP BY
Review Comment:
:D old habits die hard, obviously! (i'm sorry for the troubles.)
--
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]