This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new ff6731401a Unparser add `AtArrow` and `ArrowAt` conversion to
BinaryOperator (#14968)
ff6731401a is described below
commit ff6731401a8aa6812e8d118cbc7d70d7e62407e9
Author: Peter L <[email protected]>
AuthorDate: Thu Mar 6 02:12:31 2025 +1030
Unparser add `AtArrow` and `ArrowAt` conversion to BinaryOperator (#14968)
---
datafusion/sql/src/unparser/expr.rs | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/datafusion/sql/src/unparser/expr.rs
b/datafusion/sql/src/unparser/expr.rs
index a48c077afd..bf63613127 100644
--- a/datafusion/sql/src/unparser/expr.rs
+++ b/datafusion/sql/src/unparser/expr.rs
@@ -948,8 +948,8 @@ impl Unparser<'_> {
Operator::BitwiseShiftRight =>
Ok(BinaryOperator::PGBitwiseShiftRight),
Operator::BitwiseShiftLeft =>
Ok(BinaryOperator::PGBitwiseShiftLeft),
Operator::StringConcat => Ok(BinaryOperator::StringConcat),
- Operator::AtArrow => not_impl_err!("unsupported operation:
{op:?}"),
- Operator::ArrowAt => not_impl_err!("unsupported operation:
{op:?}"),
+ Operator::AtArrow => Ok(BinaryOperator::AtArrow),
+ Operator::ArrowAt => Ok(BinaryOperator::ArrowAt),
}
}
@@ -2113,6 +2113,22 @@ mod tests {
))),
"[1, 2, 3]",
),
+ (
+ Expr::BinaryExpr(BinaryExpr {
+ left: Box::new(col("a")),
+ op: Operator::ArrowAt,
+ right: Box::new(col("b")),
+ }),
+ "(a <@ b)",
+ ),
+ (
+ Expr::BinaryExpr(BinaryExpr {
+ left: Box::new(col("a")),
+ op: Operator::AtArrow,
+ right: Box::new(col("b")),
+ }),
+ "(a @> b)",
+ ),
];
for (expr, expected) in tests {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]