solontsev commented on code in PR #1928:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1928#discussion_r2193231211


##########
tests/sqlparser_postgres.rs:
##########
@@ -2207,19 +2223,31 @@ fn parse_pg_like_match_ops() {
     ];
 
     for (str_op, op) in pg_like_match_ops {
-        let select = pg().verified_only_select(&format!("SELECT 'abc' {} 
'a_c%'", &str_op));
+        // Basic binary operator usage
+        let select = pg().verified_only_select(&format!("SELECT 'abc' {str_op} 
'a_c%'"));
         assert_eq!(
             SelectItem::UnnamedExpr(Expr::BinaryOp {
-                left: Box::new(Expr::Value(
-                    (Value::SingleQuotedString("abc".into())).with_empty_span()
-                )),
+                left: 
Box::new(Expr::Value(single_quoted_string("abc").with_empty_span(),)),
                 op: op.clone(),
-                right: Box::new(Expr::Value(
-                    
(Value::SingleQuotedString("a_c%".into())).with_empty_span()
-                )),
+                right: 
Box::new(Expr::Value(single_quoted_string("a_c%").with_empty_span(),)),
             }),
             select.projection[0]
         );
+
+        // Binary operator with ALL operator
+        let select =

Review Comment:
   Currently, when parsing expressions with regex and like operators, only 
literals are supported, while syntax like `where a ~ any(array['x'])` is also 
valid (matching against an array of values using ALL or ANY). I've added 
additional more complex expressions to the tests (fails with the current 
version) + allowed 8 more operators before the ALL and ANY functions in the 
`parse_infix` function.
   
   
https://github.com/apache/datafusion-sqlparser-rs/blob/60acdc5bb67383ba0e4b3a6291ca6701ab2ec752/src/parser/mod.rs#L3481-L3488



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to